From 83030db6197a8f7fc1fd799dd66b6763aecc8d49 Mon Sep 17 00:00:00 2001 From: Konstantin Makariev Date: Tue, 27 Aug 2019 15:43:51 -0500 Subject: [PATCH] sec_mmi: product info when stuck in bootloader Firmware update can go wrong causing touch IC unable to enter Apps mode. In this case touch IC stuck in Bootloader mode and only Device ID info in register 0x22 is available. Make driver deriving value reported in productinfo from Device ID register regardless what mode touch IC is in. That will help init.mmi.touch.sh to find matching firmware file and recover touch function. Change-Id: I4e29bdf86dec0d35990004960ca06d4f6e454528 Signed-off-by: Konstantin Makariev Reviewed-on: https://gerrit.mot.com/1411635 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Konstantin Makariev Submit-Approved: Jira Key --- drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c b/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c index 4f13019b2b88..3afc838eb30b 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c +++ b/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c @@ -478,10 +478,6 @@ static void sec_mmi_fw_read_id(struct sec_mmi_data *data) __func__, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7]); } - - snprintf(data->product_id, sizeof(data->product_id), "%c%c%c%02x", - tolower(ts->device_id[0]), tolower(ts->device_id[1]), - ts->device_id[2], ts->device_id[3]); } static void sec_mmi_ic_reset(struct sec_mmi_data *data, int mode) @@ -580,7 +576,12 @@ static void sec_mmi_work(struct work_struct *w) sec_ts_sense_on(ts); dev_dbg(DEV_MMI, "%s: sensing turned on\n", __func__); - } + } else /* stuck in BL mode, update productinfo to report 'se77c' */ + ts->device_id[3] = 0x7C; + + snprintf(data->product_id, sizeof(data->product_id), "%c%c%c%02x", + tolower(ts->device_id[0]), tolower(ts->device_id[1]), + ts->device_id[2], ts->device_id[3]); } static void sec_mmi_queued_resume(struct work_struct *w)