/***********************************************************************
* 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. hihocoder #1300 : 展胜地的鲤鱼旗 dp

    题目链接: http://hihocoder.com/problemset/problem/1300 题解: 先用栈预处理出每个‘)’匹配的‘(’的位子,放在pos数组中. dp[i]表示以i结尾的合 ...

  2. firefox同步ajax请求报错的问题 A parameter or an operation is not supported by the underlying object

    今天在测试系统时,一个很正常的功能在firefox下报错,经过验证在ie和chrome浏览器中功能这个正常.   调试后发现: 请求比其他请求的特殊点在于同步请求.   经过firefox的控制台上测 ...

  3. C++文件操作之 seekg/seekp/tellg/tellp

    问题描述: C++文件操作之 tellg/tellp/seekg/seekp 的使用 问题解决: (1)seekg/tellg/seekp/tellp 使用 tellp用于ostream调用,用来&q ...

  4. gcd,lcm,ext_gcd,inv

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

  5. Unity3D脚本中文系列教程(七)

    http://dong2008hong.blog.163.com/blog/static/4696882720140311445677/?suggestedreading&wumii Unit ...

  6. Building Plugins for iOS

    This page describes Native Code Plugins for the iOS platform. Building an Application with a Native ...

  7. LightOj 1065 - Number Sequence (矩阵快速幂,简单)

    题目 和 LightOj 1096 - nth Term 差不多的题目和解法,这道相对更简单些,万幸,这道比赛时没把模版给抽风坏. #include<stdio.h> #include&l ...

  8. 递归算法实现10进制到N进制的转换

    #include<iostream> using namespace std; int BaseTrans(int data,int B){ int s; ) ; //结束递归算法 s=d ...

  9. JDK与JRE

    dos命令行中常见的命令: 1.dir:列出当前目录下的文件以及文件夹 2.md:创建目录(即文件夹) |-----C:\>md kkk(在C盘下创建了一个名为kkk的文件夹) 3.rd:删除目 ...

  10. H5 移动Web框架集合

    http://frozenui.github.io/  一个简洁的h5前端框架 http://weui.github.io/weui/ 腾讯出的WebUI 风格是基于微信