aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorJiejing Zhang <jiejing.zhang@freescale.com>2011-06-29 04:28:21 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-06-29 04:32:49 -0400
commitc7b4a5d58bffdf3aa7f923319643af0ebf925515 (patch)
treee84f07099a5be7ca9543a3d5111c74f97045ef80 /drivers/input/keyboard
parent631b16e81eab82e2894425a94c3fc14bf21adb26 (diff)
Input: mpr121 - improve sensibility of touch key
The Quick Charge bit in Electrode conf register should be set in init function. This bit was missed in chip's document, which may cause touch controller charge too slow to generate an interrupt. Also, adjust the default vlaue of touch and release threshold to make touch key more sensitive, this fix touch may not sensitive after setup with plastic case. Signed-off-by: Jiejing Zhang <jiejing.zhang@freescale.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/mpr121_touchkey.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
index 0a9e81194888..1c1615d9a7f9 100644
--- a/drivers/input/keyboard/mpr121_touchkey.c
+++ b/drivers/input/keyboard/mpr121_touchkey.c
@@ -43,14 +43,15 @@
43 * enabled capacitance sensing inputs and its run/suspend mode. 43 * enabled capacitance sensing inputs and its run/suspend mode.
44 */ 44 */
45#define ELECTRODE_CONF_ADDR 0x5e 45#define ELECTRODE_CONF_ADDR 0x5e
46#define ELECTRODE_CONF_QUICK_CHARGE 0x80
46#define AUTO_CONFIG_CTRL_ADDR 0x7b 47#define AUTO_CONFIG_CTRL_ADDR 0x7b
47#define AUTO_CONFIG_USL_ADDR 0x7d 48#define AUTO_CONFIG_USL_ADDR 0x7d
48#define AUTO_CONFIG_LSL_ADDR 0x7e 49#define AUTO_CONFIG_LSL_ADDR 0x7e
49#define AUTO_CONFIG_TL_ADDR 0x7f 50#define AUTO_CONFIG_TL_ADDR 0x7f
50 51
51/* Threshold of touch/release trigger */ 52/* Threshold of touch/release trigger */
52#define TOUCH_THRESHOLD 0x0f 53#define TOUCH_THRESHOLD 0x08
53#define RELEASE_THRESHOLD 0x0a 54#define RELEASE_THRESHOLD 0x05
54/* Masks for touch and release triggers */ 55/* Masks for touch and release triggers */
55#define TOUCH_STATUS_MASK 0xfff 56#define TOUCH_STATUS_MASK 0xfff
56/* MPR121 has 12 keys */ 57/* MPR121 has 12 keys */
@@ -127,7 +128,7 @@ static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata,
127 struct i2c_client *client) 128 struct i2c_client *client)
128{ 129{
129 const struct mpr121_init_register *reg; 130 const struct mpr121_init_register *reg;
130 unsigned char usl, lsl, tl; 131 unsigned char usl, lsl, tl, eleconf;
131 int i, t, vdd, ret; 132 int i, t, vdd, ret;
132 133
133 /* Set up touch/release threshold for ele0-ele11 */ 134 /* Set up touch/release threshold for ele0-ele11 */
@@ -163,8 +164,15 @@ static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata,
163 ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_USL_ADDR, usl); 164 ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_USL_ADDR, usl);
164 ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_LSL_ADDR, lsl); 165 ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_LSL_ADDR, lsl);
165 ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_TL_ADDR, tl); 166 ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_TL_ADDR, tl);
167
168 /*
169 * Quick charge bit will let the capacitive charge to ready
170 * state quickly, or the buttons may not function after system
171 * boot.
172 */
173 eleconf = mpr121->keycount | ELECTRODE_CONF_QUICK_CHARGE;
166 ret |= i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, 174 ret |= i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR,
167 mpr121->keycount); 175 eleconf);
168 if (ret != 0) 176 if (ret != 0)
169 goto err_i2c_write; 177 goto err_i2c_write;
170 178