I.MX6 Power off register hacking
/***********************************************************************
* 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的更多相关文章
- I.MX6 Ar8031 device register hacking
/***************************************************************************** * I.MX6 Ar8031 device ...
- Linux power supply class hacking
/*************************************************************************** * Linux power supply cl ...
- I.MX6 android BatteryService jni hacking
/**************************************************************************** * I.MX6 android Batter ...
- I.MX6 PWM buzzer driver hacking with Demo test
/***************************************************************************** * I.MX6 PWM buzzer dr ...
- I.MX6 U-boot lvds display hacking
/*********************************************************************************** * I.MX6 U-boot ...
- OK335xS GPMC nand device register hacking
/********************************************************************************* * OK335xS GPMC na ...
- OK335xS pwm device register hacking
/************************************************************************* * OK335xS pwm device regi ...
- IOC Unity
1. 依赖倒置原则和IOC2. IOC(Inversion of Control)的好处3. 介绍和使用Unity依赖倒置原则(DIP):上层和下层之间,依赖抽象,而不依赖细节IOC 控制反转,把上端 ...
- PSAM读卡芯片TDA8007BHL开发
WWT:Work Waiting Time ATR:Answer To Reset,复位应答 etu =F/Df 1. PSAM概述和应用 PSAM(PurchaseSecure Access ...
随机推荐
- [nowCoder] 子数组最大乘积
给定一个double类型的数组arr,其中的元素可正可负可0,返回子数组累乘的最大乘积.例如arr=[-2.5,4,0,3,0.5,8,-1],子数组[3,0.5,8]累乘可以获得最大的乘积12,所以 ...
- POJ 1663
#include<iostream>//cheng da cai zi using namespace std; int main() { int time; cin>>tim ...
- Unique Binary Search Tree II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For e ...
- 学习笔记--Grunt、安装、图文详解
学习笔记--Git安装.图文详解 安装Git成功后,现在安装Gruntjs,官网:http://gruntjs.com/ 一.安装node 参考node.js 安装.图文详解 (最新的node会自动安 ...
- poj 1026 Cipher
置换群就可以搞定!!! 注意下格式就好了…… #include<iostream> #include<stdio.h> #include<algorithm> #i ...
- Oracle 6 - 锁和闩 - transaction的可串行化
本文主要内容 1.transaction的可串行化 2.数据库并发带来的问题, dirty read, Nonrepeatable reads, Phantoms幻读 3.隔离级别和2中的问题 4. ...
- hdu 1002 A+B
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1002 复习一下大数 模板: #include <stdio.h> #include <s ...
- Linux Shell 数字计算与比较
直接上脚本, 使用$(())以及$[]进行数字计算 数值比较:n1 -eq n2检查n1是否等于n2 n1 -le n2检查n1是否小于等于n2n1 -ge n2检查n1是否大于等于n ...
- 【Linux高频命令专题(2)】awk
简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分隔符将每行切片,切开的部分再 ...
- (转)SSI开发环境搭建
本文转自:http://blog.csdn.net/lifuxiangcaohui/article/details/7187869 先来点文字性的描述: MVC对于我们来说,已经不陌生了,它起源于20 ...