/***********************************************************************
* I.MX6 Power off register hacking
* 声明:
* 本文主要记录I.MX6DL中的Power off按键的注册过程。
*
* 2016-1-28 深圳 南山平山村 曾剑锋
**********************************************************************/ 一、cat arch/arm/mach-mx6/board-mx6dl_sabresd.h
......
static iomux_v3_cfg_t mx6dl_sabresd_pads[] = {
......
MX6DL_PAD_GPIO_17__GPIO_7_12, /* power off */
......
}
...... 二、cat arch/arm/mach-mx6/board-mx6q_sabresd.c
......
#define SABRESD_POWER_OFF IMX_GPIO_NR(7, 12)
......
static struct gpio_keys_button new_sabresd_buttons[] = {
GPIO_BUTTON(SABRESD_VOLUME_UP, KEY_VOLUMEUP, , "volume-up", , ),
GPIO_BUTTON(SABRESD_VOLUME_DN, KEY_VOLUMEDOWN, , "volume-down", , ),
GPIO_BUTTON(SABRESD_POWER_OFF, KEY_POWER, , "power-key", , ),
}; static struct gpio_keys_platform_data new_sabresd_button_data = {
.buttons = new_sabresd_buttons,
.nbuttons = ARRAY_SIZE(new_sabresd_buttons),
}; static struct platform_device sabresd_button_device = {
.name = "gpio-keys",
.id = -,
.num_resources = ,
}; static void __init imx6q_add_device_buttons(void)
{
/* fix me */
/* For new sabresd(RevB4 ane above) change the
* ONOFF key(SW1) design, the SW1 now connect
* to GPIO_3_29, it can be use as a general power
* key that Android reuired. But those old sabresd
* such as RevB or older could not support this
* change, so it needs a way to distinguish different
* boards. Before board id/rev are defined cleary,
* there is a simple way to achive this, that is using
* SOC revison to identify differnt board revison.
*
* With the new sabresd change and SW mapping the
* SW1 as power key, below function related to power
* key are OK on new sabresd board(B4 or above).
* 1 Act as power button to power on the device when device is power off
* 2 Act as power button to power on the device(need keep press SW1 >5s)
* 3 Act as power key to let device suspend/resume
* 4 Act screenshort(hold power key and volume down key for 2s)
*/
platform_device_add_data(&sabresd_button_device,
&new_sabresd_button_data,
sizeof(new_sabresd_button_data)); platform_device_register(&sabresd_button_device);
}
......

I.MX6 Power off register hacking的更多相关文章

  1. I.MX6 Ar8031 device register hacking

    /***************************************************************************** * I.MX6 Ar8031 device ...

  2. Linux power supply class hacking

    /*************************************************************************** * Linux power supply cl ...

  3. I.MX6 android BatteryService jni hacking

    /**************************************************************************** * I.MX6 android Batter ...

  4. I.MX6 PWM buzzer driver hacking with Demo test

    /***************************************************************************** * I.MX6 PWM buzzer dr ...

  5. I.MX6 U-boot lvds display hacking

    /*********************************************************************************** * I.MX6 U-boot ...

  6. OK335xS GPMC nand device register hacking

    /********************************************************************************* * OK335xS GPMC na ...

  7. OK335xS pwm device register hacking

    /************************************************************************* * OK335xS pwm device regi ...

  8. IOC Unity

    1. 依赖倒置原则和IOC2. IOC(Inversion of Control)的好处3. 介绍和使用Unity依赖倒置原则(DIP):上层和下层之间,依赖抽象,而不依赖细节IOC 控制反转,把上端 ...

  9. PSAM读卡芯片TDA8007BHL开发

    WWT:Work Waiting Time ATR:Answer To Reset,复位应答 etu =F/Df 1.     PSAM概述和应用 PSAM(PurchaseSecure Access ...

随机推荐

  1. QT windows msvc下使用boost库(备忘)

    win32-msvc2015: { contains(QMAKE_HOST.arch, x86):{ INCLUDEPATH += D:\3SDK\boost_1_61_0 LIBS += -LD:\ ...

  2. nenu contest3

    http://vjudge.net/contest/view.action?cid=55702#overview 12656 - Almost Palindrome http://uva.online ...

  3. gcd,lcm,ext_gcd,inv

    Least Common Multiple http://acm.hdu.edu.cn/showproblem.php?pid=1019 #include<cstdio> int gcd( ...

  4. jquery easyui datagrid 获取选中多行

    var rows = $('#dataTable').datagri('getSelections');

  5. UDP TCP 消息边界

    先明确一个问题,如果定义了一个数据结构,大小是,比方说 32 个字节,然后 UDP 客户端连续向服务端发了两个包.现在假设这两个包都已经到达了服务器,那么服务端调用 recvfrom 来接收数据,并且 ...

  6. 国内一些SCM相关论坛站点

    SCMROAD: http://www.scmroad.com/forum.php SCMEYE:http://www.scmeye.com/ SVN管家:http://www.svnclub.com ...

  7. [转载]Spring Annotation Based Configuration

    Annotation injection is performed before XML injection, thus the latter configuration will override ...

  8. java基础知识回顾之javaIO类--java序列化和反序列化

    /** *  * 一:理解序列化反序列化及其应用 * 序列化:把堆内存的对象转化成字节流的过程. * 反序列化:把字节流序列恢复重构成对象的过程. * 对象的序列化的用途:1.把对象的字节序列持久化, ...

  9. 2013 Multi-University Training Contest 1 I-number

    水题,注意不要去掉前导0…… ;}

  10. 黑马程序员-C#学习笔记

    ---------------------- ASP.Net+Android+IOS开发..Net培训.期待与您交流! ---------------------- C#学习笔记 1..NET/.do ...