diff options
Diffstat (limited to 'drivers/input/keyboard/cypress')
-rw-r--r-- | drivers/input/keyboard/cypress/cypress-touchkey.c | 33 |
1 files changed, 26 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 |