diff options
author | jt1134 <jt1134@gmail.com> | 2012-07-28 17:24:32 -0500 |
---|---|---|
committer | jt1134 <jt1134@gmail.com> | 2012-07-28 17:24:32 -0500 |
commit | 4afad77c61c7cb54cce293034cdb07a928f22d20 (patch) | |
tree | f528d894344b323dcdbbdcdabb47695430b5f850 /drivers/input | |
parent | 773cfadd2281811ae482d9f51fd26f2aacdd01ba (diff) | |
download | kernel_samsung_aries-4afad77c61c7cb54cce293034cdb07a928f22d20.zip kernel_samsung_aries-4afad77c61c7cb54cce293034cdb07a928f22d20.tar.gz kernel_samsung_aries-4afad77c61c7cb54cce293034cdb07a928f22d20.tar.bz2 |
cypress-touchkey: attempt to filter out "phantom" key-presses
* this issue only affects the fascinate
* this patch attempts to work-around a hardware defect that causes
"phantom" key-presses to be sent during high levels of 3G radio
activity
* based on work by Electric Bill
* reference: http://forum.xda-developers.com/showthread.php?t=1551580
Change-Id: I1fc6f56ad02f31c60a8e399b03d5f0e0b8c1f2df
Diffstat (limited to 'drivers/input')
-rwxr-xr-x | drivers/input/keyboard/cypress-touchkey.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/drivers/input/keyboard/cypress-touchkey.c b/drivers/input/keyboard/cypress-touchkey.c index 7972f27..3514dc1 100755 --- a/drivers/input/keyboard/cypress-touchkey.c +++ b/drivers/input/keyboard/cypress-touchkey.c @@ -32,6 +32,12 @@ #include <linux/miscdevice.h> #include <linux/input/cypress-touchkey.h> +#ifdef CONFIG_SAMSUNG_FASCINATE +#include <mach/gpio.h> +#include <mach/gpio-aries.h> +#include <mach/regs-gpio.h> +#endif + #define SCANCODE_MASK 0x07 #define UPDOWN_EVENT_MASK 0x08 #define ESD_STATE_MASK 0x10 @@ -44,6 +50,11 @@ #define DEVICE_NAME "cypress-touchkey" +#ifdef CONFIG_SAMSUNG_FASCINATE +extern const unsigned long touch_int_flt_width; +void touch_key_set_int_flt(unsigned long width); +#endif + int bl_on = 0; static DEFINE_SEMAPHORE(enable_sem); static DEFINE_SEMAPHORE(i2c_sem); @@ -179,8 +190,12 @@ static int recovery_routine(struct cypress_touchkey_devdata *devdata) devdata->pdata->touchkey_onoff(TOUCHKEY_ON); ret = i2c_touchkey_read_byte(devdata, &data); if (!ret) { - if (!devdata->is_sleeping) + if (!devdata->is_sleeping) { enable_irq(irq_eint); +#ifdef CONFIG_SAMSUNG_FASCINATE + touch_key_set_int_flt(touch_int_flt_width); +#endif + } goto out; } dev_err(&devdata->client->dev, "%s: i2c transfer error retry = " @@ -206,6 +221,19 @@ static irqreturn_t touchkey_interrupt_thread(int irq, void *touchkey_devdata) int scancode; struct cypress_touchkey_devdata *devdata = touchkey_devdata; +#ifdef CONFIG_SAMSUNG_FASCINATE + for (i = 0; i < 10; ++i) + { + ret = gpio_get_value(_3_GPIO_TOUCH_INT); + + if (ret & 1) { + dev_err(&devdata->client->dev, "%s: possible phantom key press... " + "ignore it!\n", __func__); + goto err; + } + } +#endif + ret = i2c_touchkey_read_byte(devdata, &data); if (ret || (data & ESD_STATE_MASK)) { ret = recovery_routine(devdata); @@ -249,7 +277,13 @@ static irqreturn_t touchkey_interrupt_handler(int irq, void *touchkey_devdata) { struct cypress_touchkey_devdata *devdata = touchkey_devdata; +#ifdef CONFIG_SAMSUNG_FASCINATE + int i = gpio_get_value(_3_GPIO_TOUCH_INT); + + if ((i & 1) || devdata->is_powering_on) { +#else if (devdata->is_powering_on) { +#endif dev_dbg(&devdata->client->dev, "%s: ignoring spurious boot " "interrupt\n", __func__); return IRQ_HANDLED; @@ -345,6 +379,9 @@ static void cypress_touchkey_early_resume(struct early_suspend *h) } devdata->is_dead = false; enable_irq(devdata->client->irq); +#ifdef CONFIG_SAMSUNG_FASCINATE + touch_key_set_int_flt(touch_int_flt_width); +#endif devdata->is_powering_on = false; devdata->is_sleeping = false; @@ -502,6 +539,10 @@ static int cypress_touchkey_probe(struct i2c_client *client, goto err_req_irq; } +#ifdef CONFIG_SAMSUNG_FASCINATE + touch_key_set_int_flt(touch_int_flt_width); +#endif + #ifdef CONFIG_HAS_EARLYSUSPEND devdata->early_suspend.suspend = cypress_touchkey_early_suspend; devdata->early_suspend.resume = cypress_touchkey_early_resume; |