From a0ecf9107589c2ee332def3ddbb9014f46de5b54 Mon Sep 17 00:00:00 2001 From: Wenge Zhu Date: Wed, 7 Sep 2022 15:56:08 +0800 Subject: [PATCH] Make compatible for another pinctrl name Because pinctrl names are same with another touch driver and GPIO pin numners are not same,so make compatible for another pinctrl name. Change-Id: I42ad2a1f39f108384ee64585b24c5855a34f59e7 Signed-off-by: Wenge Zhu Reviewed-on: https://gerrit.mot.com/2379912 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- .../focaltech_touch_v3/focaltech_core.c | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c index 41c2c553500e..49e4bcdbd82e 100644 --- a/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c @@ -1346,24 +1346,34 @@ static int fts_pinctrl_init(struct fts_ts_data *ts) ts->pins_active = pinctrl_lookup_state(ts->pinctrl, "pmx_ts_active"); if (IS_ERR_OR_NULL(ts->pins_active)) { - FTS_ERROR("Pin state[active] not found"); - ret = PTR_ERR(ts->pins_active); - goto err_pinctrl_lookup; + ts->pins_active = pinctrl_lookup_state(ts->pinctrl, "cli_pmx_ts_active"); + if (IS_ERR_OR_NULL(ts->pins_active)) { + FTS_ERROR("Pin state[active] not found"); + ret = PTR_ERR(ts->pins_active); + goto err_pinctrl_lookup; + } } ts->pins_suspend = pinctrl_lookup_state(ts->pinctrl, "pmx_ts_suspend"); if (IS_ERR_OR_NULL(ts->pins_suspend)) { - FTS_ERROR("Pin state[suspend] not found"); - ret = PTR_ERR(ts->pins_suspend); - goto err_pinctrl_lookup; + ts->pins_suspend = pinctrl_lookup_state(ts->pinctrl, "cli_pmx_ts_suspend"); + if (IS_ERR_OR_NULL(ts->pins_suspend)) { + FTS_ERROR("Pin state[suspend] not found"); + ret = PTR_ERR(ts->pins_suspend); + goto err_pinctrl_lookup; + } } ts->pins_release = pinctrl_lookup_state(ts->pinctrl, "pmx_ts_release"); if (IS_ERR_OR_NULL(ts->pins_release)) { - FTS_ERROR("Pin state[release] not found"); - ret = PTR_ERR(ts->pins_release); + ts->pins_release = pinctrl_lookup_state(ts->pinctrl, "cli_pmx_ts_release"); + if (IS_ERR_OR_NULL(ts->pins_release)) { + FTS_ERROR("Pin state[release] not found"); + ret = PTR_ERR(ts->pins_release); + } } + FTS_INFO("Pinctrl init success"); return 0; err_pinctrl_lookup: if (ts->pinctrl) {