aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-21 23:04:45 +0200
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-21 23:04:45 +0200
commit0a1182796f6475b8cb2ff1781dad873a744b3197 (patch)
treee15b5256dac226c49a25b5e24594cd638e2fec2c /drivers/input
parent633018c13fe06461d9c60692fbb114734aa37802 (diff)
downloadkernel_samsung_smdk4412-0a1182796f6475b8cb2ff1781dad873a744b3197.zip
kernel_samsung_smdk4412-0a1182796f6475b8cb2ff1781dad873a744b3197.tar.gz
kernel_samsung_smdk4412-0a1182796f6475b8cb2ff1781dad873a744b3197.tar.bz2
samsung opensource update3
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/cypress/cypress-touchkey.c33
-rw-r--r--drivers/input/touchscreen/mms_ts.c13
2 files changed, 39 insertions, 7 deletions
diff --git a/drivers/input/keyboard/cypress/cypress-touchkey.c b/drivers/input/keyboard/cypress/cypress-touchkey.c
index dde89e4..72a3422 100644
--- a/drivers/input/keyboard/cypress/cypress-touchkey.c
+++ b/drivers/input/keyboard/cypress/cypress-touchkey.c
@@ -590,6 +590,13 @@ static int touchkey_firmware_update(struct touchkey_i2c *tkey_i2c)
return TK_UPDATE_FAIL;
}
+ ret = i2c_touchkey_read(tkey_i2c->client, KEYCODE_REG, data, 3);
+ if (ret < 0) {
+ printk(KERN_DEBUG
+ "[TouchKey] i2c read fail. do not excute firm update.\n");
+ }
+ tkey_i2c->firmware_ver = data[1];
+ tkey_i2c->module_ver = data[2];
printk(KERN_DEBUG "[TouchKey] firm ver = %d, module ver = %d\n",
tkey_i2c->firmware_ver, tkey_i2c->module_ver);
} else {
@@ -640,6 +647,7 @@ static int touchkey_firmware_update(struct touchkey_i2c *tkey_i2c)
if (retry <= 0) {
tkey_i2c->pdata->power_on(0);
tkey_i2c->update_status = TK_UPDATE_FAIL;
+ ret = TK_UPDATE_FAIL;
}
} else {
if (tkey_i2c->firmware_ver >= 0x0A) {
@@ -1739,6 +1747,16 @@ static int i2c_touchkey_probe(struct i2c_client *client,
}
}
+ ret = touchkey_i2c_check(tkey_i2c);
+ if (ret < 0) {
+ printk(KERN_DEBUG
+ "[TouchKey] i2c read fail. do not excute firm update.\n");
+
+ input_unregister_device(input_dev);
+ touchkey_probe = false;
+ return -EBUSY;
+ }
+
ret =
request_threaded_irq(tkey_i2c->irq, NULL, touchkey_interrupt,
IRQF_DISABLED | IRQF_TRIGGER_FALLING |
@@ -1751,13 +1769,6 @@ static int i2c_touchkey_probe(struct i2c_client *client,
return -EBUSY;
}
-#ifdef CONFIG_HAS_EARLYSUSPEND
- tkey_i2c->early_suspend.suspend =
- (void *)sec_touchkey_early_suspend;
- tkey_i2c->early_suspend.resume =
- (void *)sec_touchkey_late_resume;
- register_early_suspend(&tkey_i2c->early_suspend);
-#endif
tkey_i2c->pdata->led_power_on(1);
@@ -1772,6 +1783,14 @@ static int i2c_touchkey_probe(struct i2c_client *client,
}
#endif
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ tkey_i2c->early_suspend.suspend =
+ (void *)sec_touchkey_early_suspend;
+ tkey_i2c->early_suspend.resume =
+ (void *)sec_touchkey_late_resume;
+ register_early_suspend(&tkey_i2c->early_suspend);
+#endif
+
#if defined(TK_HAS_AUTOCAL)
touchkey_autocalibration(tkey_i2c);
#endif
diff --git a/drivers/input/touchscreen/mms_ts.c b/drivers/input/touchscreen/mms_ts.c
index 058cc89..3b86885 100644
--- a/drivers/input/touchscreen/mms_ts.c
+++ b/drivers/input/touchscreen/mms_ts.c
@@ -3212,6 +3212,19 @@ static int __devinit mms_ts_probe(struct i2c_client *client,
#endif
touch_is_pressed = 0;
+#if defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_C1)
+ gpio_request(GPIO_OLED_DET, "OLED_DET");
+ ret = gpio_get_value(GPIO_OLED_DET);
+ printk(KERN_DEBUG
+ "[TSP] OLED_DET = %d\n", ret);
+
+ if (ret == 0) {
+ printk(KERN_DEBUG
+ "[TSP] device wasn't connected to board\n");
+ return -EIO;
+ }
+#endif
+
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
return -EIO;