mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Add volume key support
1.Build cs_press_mmi module as DLKM module. 2.Add volume key support. Change-Id: Ib18e055e2c5a81aee5647ba09a161616a6071f0e Signed-off-by: Wenge Zhu <zhuwg1@motorola.com> Reviewed-on: https://gerrit.mot.com/2654204 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou <zoujc@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
24bf30a9c9
commit
e7a03cd374
2 changed files with 40 additions and 3 deletions
|
|
@ -608,6 +608,40 @@ unsigned char get_key_event(void)
|
|||
*/
|
||||
void fml_key_report(void)
|
||||
{
|
||||
#ifdef SIDE_KEY_MMI
|
||||
unsigned char rbuf[6];
|
||||
unsigned char addr;
|
||||
int len = 0;
|
||||
|
||||
cs_press_wakeup_iic();
|
||||
|
||||
addr = IIC_KEY_EVENT_MMI;
|
||||
len = 6;
|
||||
memset(rbuf, 0x0, len);
|
||||
if (cs_press_iic_read(addr, rbuf, len) != 0) {
|
||||
LOG_ERR("reg=%02x, buf[0]=%02x, buf[1]=%02x, force=%d len=%d,err\n",
|
||||
addr, rbuf[0], rbuf[1], (int16_t)((rbuf[5] << 8) + rbuf[4]), len);
|
||||
return;
|
||||
} else {
|
||||
LOG_ERR("reg=%02x, buf[0]=%02x, buf[1]=%02x, force=%d len=%d,success\n",
|
||||
addr, rbuf[0], rbuf[1], (int16_t)((rbuf[5] << 8) + rbuf[4]), len);
|
||||
}
|
||||
|
||||
if(rbuf[0] == 1) {
|
||||
LOG_ERR("vol down key.\n");
|
||||
input_report_key(cs_input_dev, KEY_VOLUMEUP, 1);
|
||||
input_sync(cs_input_dev);
|
||||
input_report_key(cs_input_dev, KEY_VOLUMEUP, 0);
|
||||
input_sync(cs_input_dev);
|
||||
} else if(rbuf[1] == 1) {
|
||||
LOG_ERR("vol up key.\n");
|
||||
input_report_key(cs_input_dev, KEY_VOLUMEDOWN, 1);
|
||||
input_sync(cs_input_dev);
|
||||
input_report_key(cs_input_dev, KEY_VOLUMEDOWN, 0);
|
||||
input_sync(cs_input_dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SIDE_KEY
|
||||
unsigned char event = 0;
|
||||
event = get_key_event();
|
||||
|
|
@ -679,6 +713,7 @@ void eint_init(void)
|
|||
|
||||
kthread_run(cs_press_event_handler, 0, CS_PRESS_NAME);
|
||||
cs_irq_disable();
|
||||
cs_irq_enable();
|
||||
LOG_ERR("init_irq ok");
|
||||
fml_input_dev_init();
|
||||
}
|
||||
|
|
@ -2386,7 +2421,7 @@ int cs_check_i2c(void)
|
|||
* @retval
|
||||
*/
|
||||
|
||||
static void update_work_func(struct work_struct *worker)
|
||||
static void __maybe_unused update_work_func(struct work_struct *worker)
|
||||
{
|
||||
/*
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@
|
|||
#define POWER_GPIO_HIGH 1
|
||||
#define POWER_GPIO_LOW 0
|
||||
#define IIC_KEY_EVENT 0xD3
|
||||
#define IIC_KEY_EVENT_MMI 0xD4
|
||||
#define CS_FORCE_TRIG_LENGTH 6
|
||||
#define CS_SCANT_PERIOD_LENGTH 4
|
||||
#define CS_WORK_MODE_LENGTH 3
|
||||
|
|
@ -190,8 +191,9 @@
|
|||
#define SHELL_TEMP_DELAY_TIME (2000)
|
||||
#define CHECK_DELAY_TIME (20000)
|
||||
#define I2C_CHECK_SCHEDULE
|
||||
/*#define INT_SET_EN*/
|
||||
#define SIDE_KEY
|
||||
#define INT_SET_EN
|
||||
//#define SIDE_KEY
|
||||
#define SIDE_KEY_MMI
|
||||
#define CALIBRATION_SUCCESS_FALG 0xf0
|
||||
#define CALIBRATION_FAIL_FALG 0xf2
|
||||
#define CALIBRATION_OVERTIME_FALG 0xff
|
||||
|
|
|
|||
Loading…
Reference in a new issue