diff options
author | Nitin Garg <nitin.garg@freescale.com> | 2012-03-15 14:48:04 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2012-03-15 14:48:04 -0500 |
commit | 3a4cc222f95c22e84a50b2a4934ca5e208943b3a (patch) | |
tree | 1d6923cc71dbc7e8038804eb0e893ae427bb78ff /drivers/input | |
parent | d1da121bf06cb08e49485dbe419f5c5336d567b8 (diff) |
ENGR00177017: Improve the mpr121 capacitive button responsiveness on iMX53 SMDimx-android-r14-alpha
The capacitive buttons on iMX53 SMD sometimes misses
the touch events. Improve the sentivity by reducing
touch threshold and enabling baseline tracking in ECR.
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/mpr121.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/input/keyboard/mpr121.c b/drivers/input/keyboard/mpr121.c index 3e92eaf7735e..aa5e4e2523fd 100644 --- a/drivers/input/keyboard/mpr121.c +++ b/drivers/input/keyboard/mpr121.c @@ -30,7 +30,6 @@ #include <linux/delay.h> #include <linux/bitops.h> - struct mpr121_touchkey_data { struct i2c_client *client; struct input_dev *input_dev; @@ -88,8 +87,7 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id) data->statusbits = reg; data->key_val = data->keycodes[key_num]; - input_event(input, EV_MSC, MSC_SCAN, data->key_val); - input_report_key(input, data->key_val, pressed); + input_event(input, EV_KEY, data->key_val, !!pressed); input_sync(input); dev_dbg(&client->dev, "key %d %d %s\n", key_num, data->key_val, @@ -125,6 +123,7 @@ static int mpr121_phys_init(struct mpr121_platform_data *pdata, if (ret < 0) goto err_i2c_write; } + /* setup auto-register by vdd,the formula please ref:AN3889 */ vdd = pdata->vdd_uv / 1000; usl = ((vdd - 700) * 256) / vdd; @@ -140,7 +139,7 @@ static int mpr121_phys_init(struct mpr121_platform_data *pdata, if (ret < 0) goto err_i2c_write; ret = i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, - data->keycount); + ECR_CL_BT_5BIT_VAL | (data->keycount & 0xf)); if (ret < 0) goto err_i2c_write; @@ -203,11 +202,10 @@ static int __devinit mpr_touchkey_probe(struct i2c_client *client, input_dev->keycodemax = data->keycount; for (i = 0; i < input_dev->keycodemax; i++) { - __set_bit(pdata->matrix[i], input_dev->keybit); + input_set_capability(input_dev, EV_KEY, pdata->matrix[i]); data->keycodes[i] = pdata->matrix[i]; } - input_set_capability(input_dev, EV_KEY, MSC_SCAN); input_set_drvdata(input_dev, data); error = request_threaded_irq(client->irq, NULL, @@ -264,7 +262,8 @@ static int mpr_resume(struct i2c_client *client) if (device_may_wakeup(&client->dev)) disable_irq_wake(client->irq); - i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, data->keycount); + i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, + ECR_CL_BT_5BIT_VAL | (data->keycount & 0xf)); return 0; } |