input: ilitek_0flash_mmi: pull down reset when shutdown

ilitek_0flash_mmi:
Pull down reset when shutdown to meet IC SPEC.
NO_PROP_NEEDED: ILITEK IC for NPI

Change-Id: I4d6a81068e16ff89b1028def9936b327040aa272
Signed-off-by: wangyq13 <wangyq13@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1664373
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangyq13 2020-07-06 16:13:11 +08:00 • committed by Yeqing Wang
commit d20b99e172
4 changed files with 45 additions and 0 deletions

View file

@ -1040,6 +1040,39 @@ void ili_dev_remove(void)
ili_interface_dev_exit(ilits);
}
void ilitek_spi_shutdown(struct spi_device *spi)
{
ILI_INFO("Shutdown driver...\n");
ili_irq_disable();
#ifdef ILI_CONFIG_PANEL_NOTIFICATIONS
ilitek_panel_notifier_unregister();
#endif
if (esd_wq != NULL) {
cancel_delayed_work_sync(&esd_work);
flush_workqueue(esd_wq);
destroy_workqueue(esd_wq);
}
if (bat_wq != NULL) {
cancel_delayed_work_sync(&bat_work);
flush_workqueue(bat_wq);
destroy_workqueue(bat_wq);
}
if (ilits->ws)
wakeup_source_unregister(ilits->ws);
ilits->gesture = DISABLE;
if(gpio_is_valid(ilits->tp_rst)) {
gpio_direction_output(ilits->tp_rst, 0);
mdelay(1);
gpio_set_value(ilits->tp_rst, 0);
}
}
int ili_dev_init(struct ilitek_hwif_info *hwif)
{
ILI_INFO("TP Interface: %s\n", (hwif->bus_type == BUS_I2C) ? "I2C" : "SPI");

View file

@ -1130,6 +1130,10 @@ extern int ili_get_tp_recore_ctrl(int data);
extern int ili_get_tp_recore_data(void);
extern void ili_demo_debug_info_mode(u8 *buf, size_t rlen);
extern void ili_demo_debug_info_id0(u8 *buf, size_t len);
#ifdef ILI_CONFIG_PANEL_NOTIFICATIONS
extern void ilitek_panel_notifier_unregister(void);
#endif
extern void ilitek_spi_shutdown(struct spi_device *spi);
static inline void ipio_kfree(void **mem)
{

View file

@ -720,6 +720,13 @@ static int ili_panel_notifier_callback(struct notifier_block *self, unsigned lon
return 0;
}
void ilitek_panel_notifier_unregister(void)
{
if (register_panel_notifier(&ilits->panel_notif)) {
ILI_ERR("unregister panel_notifier failed\n");
}
}
#endif
static void ilitek_plat_sleep_init(void)

View file

@ -596,6 +596,7 @@ int ili_interface_dev_init(struct ilitek_hwif_info *hwif)
info->bus_driver.probe = ilitek_spi_probe;
info->bus_driver.remove = ilitek_spi_remove;
info->bus_driver.shutdown = ilitek_spi_shutdown;
info->bus_driver.id_table = tp_spi_id;
info->hwif = hwif;