X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Finput%2Ftouchscreen%2Fct36x_ts%2Ftscore.c;h=c799b80a2e5b32c0053cc6ca906e035475e6aca2;hb=e1ce3c5325d4f2f6bf07b823317669fecc15cf1b;hp=f08670e1cb779836586b3929dff09e5943376aa1;hpb=59bd15e743d53a55310e7f936c72329ee411f1c7;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/input/touchscreen/ct36x_ts/tscore.c b/drivers/input/touchscreen/ct36x_ts/tscore.c index f08670e1cb77..c799b80a2e5b 100644 --- a/drivers/input/touchscreen/ct36x_ts/tscore.c +++ b/drivers/input/touchscreen/ct36x_ts/tscore.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -362,6 +363,7 @@ int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id) /* Hardware reset */ ct36x_platform_hw_reset(ts); + mdelay(500); // Get binary Checksum binchksum = ct36x_chip_get_binchksum(ts->data.buf); @@ -372,7 +374,7 @@ int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id) fwchksum = ct36x_chip_get_fwchksum(client, ts->data.buf); if ( CT36X_TS_CORE_DEBUG ) printk("Fw checksum: 0x%x\n", fwchksum); - +#if 1 updcnt = 5; while ( binchksum != fwchksum && updcnt--) { /* Update Firmware */ @@ -380,15 +382,15 @@ int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id) /* Hardware reset */ ct36x_platform_hw_reset(ts); - + mdelay(500); // Get firmware Checksum fwchksum = ct36x_chip_get_fwchksum(client, ts->data.buf); - if ( CT36X_TS_CORE_DEBUG ) +// if ( CT36X_TS_CORE_DEBUG ) printk("Fw checksum: 0x%x\n", fwchksum); } printk("Fw update %s. 0x%x, 0x%x\n", binchksum != fwchksum ? "Failed" : "Success", binchksum, fwchksum); - +#endif /* Hardware reset */ ct36x_platform_hw_reset(ts); @@ -468,6 +470,22 @@ void ct36x_ts_shutdown(struct i2c_client *client) ct36x_chip_go_sleep(client, ts->data.buf); } +#ifdef CONFIG_MACH_RK3188M_F304 +int ct36x_suspend(struct i2c_client *client, pm_message_t mesg) +{ + struct regulator *vcc_tp=NULL; + vcc_tp = regulator_get(NULL, "ricoh_ldo3"); + if (vcc_tp == NULL) + printk("%s..get vcc_tp error\n",__func__); + else + { + while(regulator_is_enabled(vcc_tp)>0) + regulator_disable(vcc_tp); + regulator_put(vcc_tp); + } + return 0; +} +#endif int ct36x_ts_suspend(struct i2c_client *client, pm_message_t mesg) { @@ -490,6 +508,23 @@ int ct36x_ts_suspend(struct i2c_client *client, pm_message_t mesg) return 0; } +#ifdef CONFIG_MACH_RK3188M_F304 +int ct36x_resume(struct i2c_client *client) +{ + struct regulator *vcc_tp=NULL; + + vcc_tp = regulator_get(NULL, "ricoh_ldo3"); + if (vcc_tp == NULL) + printk("%s..get vcc_tp error\n",__func__); + else + { + regulator_enable(vcc_tp); + regulator_put(vcc_tp); + } + + return 0; +} +#endif int ct36x_ts_resume(struct i2c_client *client) {