diff options
author | Nitin Garg <nitin.garg@freescale.com> | 2012-12-12 12:37:38 -0600 |
---|---|---|
committer | Tapani <tapani@vmail.me> | 2013-03-29 11:41:24 +0800 |
commit | 382347093e1a435cf67067ef6446aca0579adaa8 (patch) | |
tree | 799e625d17a8c38922ae03f52021cf57732523b4 | |
parent | 5d2da41b861d6d30e005b4bb8050e202c8fff614 (diff) |
ENGR00236827: Enable MPR121 capacitive button driver
Enable MPR121 capacitive button driver in Linux 3.0.35 kernel
as its missing from Makefile/Kconfig. Also enable the
calibration lock bit to improve the touch sensitivity issue.
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
-rw-r--r-- | drivers/input/keyboard/Kconfig | 12 | ||||
-rw-r--r-- | drivers/input/keyboard/Makefile | 1 | ||||
-rw-r--r-- | drivers/input/keyboard/mpr121_touchkey.c | 7 |
3 files changed, 17 insertions, 3 deletions
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index d658f6c48105..b4dee9d5a055 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -335,6 +335,18 @@ config KEYBOARD_MCS To compile this driver as a module, choose M here: the module will be called mcs_touchkey. +config KEYBOARD_MPR121 + tristate "Freescale MPR121 Touchkey" + depends on I2C + help + Say Y here if you have Freescale MPR121 touchkey controller + chip in your system. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called mpr121_touchkey. + config KEYBOARD_IMX tristate "IMX keypad support" depends on ARCH_MXC diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index f520f53819fb..ddde0fd476f7 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile @@ -28,6 +28,7 @@ obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o obj-$(CONFIG_KEYBOARD_MAX7359) += max7359_keypad.o obj-$(CONFIG_KEYBOARD_MCS) += mcs_touchkey.o +obj-$(CONFIG_KEYBOARD_MPR121) += mpr121_touchkey.o obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o obj-$(CONFIG_KEYBOARD_NOMADIK) += nomadik-ske-keypad.o obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 0a9e81194888..20bb6713d491 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -1,7 +1,7 @@ /* * Touchkey driver for Freescale MPR121 Controllor * - * Copyright (C) 2011 Freescale Semiconductor, Inc. + * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. * Author: Zhang Jiejing <jiejing.zhang@freescale.com> * * Based on mcs_touchkey.c @@ -43,6 +43,7 @@ * enabled capacitance sensing inputs and its run/suspend mode. */ #define ELECTRODE_CONF_ADDR 0x5e +#define ECR_CL_BT_5BIT_VAL 0x80 #define AUTO_CONFIG_CTRL_ADDR 0x7b #define AUTO_CONFIG_USL_ADDR 0x7d #define AUTO_CONFIG_LSL_ADDR 0x7e @@ -164,7 +165,7 @@ static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata, ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_LSL_ADDR, lsl); ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_TL_ADDR, tl); ret |= i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, - mpr121->keycount); + ECR_CL_BT_5BIT_VAL | (mpr121->keycount & 0xf)); if (ret != 0) goto err_i2c_write; @@ -297,7 +298,7 @@ static int mpr_resume(struct device *dev) disable_irq_wake(client->irq); i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, - mpr121->keycount); + ECR_CL_BT_5BIT_VAL | (mpr121->keycount & 0xf)); return 0; } |