From 0680049b4a0e54f52e9b7977ea2fc239069ad83d Mon Sep 17 00:00:00 2001 From: litong Date: Wed, 29 Apr 2020 17:29:57 +0800 Subject: [PATCH] Modify synaptics' log information 1. The i2c error message is output only when the i2c transmission error exceeds the maximum number of attempts. 2. Output coordinate information when the touchscreen is pressed. Change-Id: Ida9f51904b0d40e39111529843b146844b4240b6 Reviewed-on: https://gerrit.mot.com/1543943 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jialei Hao Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../synaptics_tcm_mmi_v2/synaptics_i2c.c | 20 +++++++++++++++---- .../synaptics_tcm_mmi_v2/synaptics_touch.c | 7 +++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_i2c.c b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_i2c.c index 6d79a44b47e3..1d32e7352670 100644 --- a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_i2c.c +++ b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_i2c.c @@ -284,11 +284,14 @@ static int syna_tcm_i2c_rmi_read(struct syna_tcm_hcd *tcm_hcd, retval = length; goto exit; } - LOGE(&i2c->dev, + LOGD(&i2c->dev, "Transfer attempt %d failed\n", attempt + 1); if (attempt + 1 == XFER_ATTEMPTS) { + LOGE(&i2c->dev, + "Transfer attempt %d failed, exceeding the maximum number of attempts\n", + attempt + 1); retval = -EIO; goto exit; } @@ -345,11 +348,14 @@ static int syna_tcm_i2c_rmi_write(struct syna_tcm_hcd *tcm_hcd, retval = length; goto exit; } - LOGE(&i2c->dev, + LOGD(&i2c->dev, "Transfer attempt %d failed\n", attempt + 1); if (attempt + 1 == XFER_ATTEMPTS) { + LOGE(&i2c->dev, + "Transfer attempt %d failed, exceeding the maximum number of attempts\n", + attempt + 1); retval = -EIO; goto exit; } @@ -383,11 +389,14 @@ static int syna_tcm_i2c_read(struct syna_tcm_hcd *tcm_hcd, unsigned char *data, retval = length; goto exit; } - LOGE(&i2c->dev, + LOGD(&i2c->dev, "Transfer attempt %d failed\n", attempt + 1); if (attempt + 1 == XFER_ATTEMPTS) { + LOGE(&i2c->dev, + "Transfer attempt %d failed, exceeding the maximum number of attempts\n", + attempt + 1); retval = -EIO; goto exit; } @@ -421,11 +430,14 @@ static int syna_tcm_i2c_write(struct syna_tcm_hcd *tcm_hcd, unsigned char *data, retval = length; goto exit; } - LOGE(&i2c->dev, + LOGD(&i2c->dev, "Transfer attempt %d failed\n", attempt + 1); if (attempt + 1 == XFER_ATTEMPTS) { + LOGE(&i2c->dev, + "Transfer attempt %d failed, exceeding the maximum number of attempts\n", + attempt + 1); retval = -EIO; goto exit; } diff --git a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_touch.c b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_touch.c index d2036c6868a3..5dc7c660777a 100644 --- a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_touch.c +++ b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_touch.c @@ -762,6 +762,8 @@ static void touch_report(void) input_mt_slot(touch_hcd->input_dev, idx); input_mt_report_slot_state(touch_hcd->input_dev, MT_TOOL_FINGER, 0); + LOGI(tcm_hcd->pdev->dev.parent, + "[R]Finger %d: UP\n", idx); #endif break; case FINGER: @@ -808,6 +810,11 @@ static void touch_report(void) "Finger %d: x = %d, y = %d, x_width = %d, y_width = %d\n", idx, x, y, object_data[idx].x_width, object_data[idx].y_width); touch_count++; + + if (object_data[idx].status != touch_hcd->prev_status[idx]) + LOGI(tcm_hcd->pdev->dev.parent, + "[P]Finger %d: x=%d, y=%d, x_width=%d, y_width=%d\n", + idx, x, y, object_data[idx].x_width, object_data[idx].y_width); break; default: break;