aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rwxr-xr-xdrivers/input/keyboard/cypress-touchkey.c43
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;