sec_mmi: control reset gpio state

Driver cannot set RST gpio direction and state explicitly in pictrl
config dur to compatibility reason. Thus adding the code setting
RST gpio high every time pin control switches from Off to On state

Change-Id: I4217b7546f48ec20204bf93b12a15baf95905475
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1411555
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Konstantin Makariev 2019-08-27 12:44:49 -05:00 • committed by Konstantin Makariev
commit 08dbfb3e64

View file

@ -1079,6 +1079,7 @@ void sec_ts_set_grip_type(struct sec_ts_data *ts, u8 set_type)
int sec_ts_pinctrl_configure(struct sec_ts_data *ts, bool enable)
{
int rc = 0;
struct pinctrl_state *state;
input_info(true, &ts->client->dev, "%s: %s\n", __func__, enable ? "ACTIVE" : "SUSPEND");
@ -1087,21 +1088,23 @@ int sec_ts_pinctrl_configure(struct sec_ts_data *ts, bool enable)
state = pinctrl_lookup_state(ts->plat_data->pinctrl, "on_state");
if (IS_ERR(ts->plat_data->pinctrl))
input_err(true, &ts->client->dev, "%s: could not get active pinstate\n", __func__);
if (gpio_is_valid(ts->plat_data->rst_gpio)) {
/* pinctrl is not setting RESET gpio high by default */
/* due to compatibility issues with Synaptics driver */
gpio_set_value(ts->plat_data->rst_gpio, 1);
}
} else {
state = pinctrl_lookup_state(ts->plat_data->pinctrl, "off_state");
if (IS_ERR(ts->plat_data->pinctrl))
input_err(true, &ts->client->dev, "%s: could not get suspend pinstate\n", __func__);
}
if (!IS_ERR_OR_NULL(state))
return pinctrl_select_state(ts->plat_data->pinctrl, state);
if (!IS_ERR_OR_NULL(state)) {
rc = pinctrl_select_state(ts->plat_data->pinctrl, state);
if (enable && gpio_is_valid(ts->plat_data->rst_gpio)) {
/* pinctrl is not setting RESET gpio high by default */
/* due to compatibility issues with Synaptics driver */
gpio_set_value(ts->plat_data->rst_gpio, 1);
input_dbg(true, &ts->client->dev, "%s: rst gpio is %d\n", __func__, gpio_get_value(ts->plat_data->rst_gpio));
}
}
return 0;
return rc;
}
@ -1201,6 +1204,12 @@ static int sec_ts_parse_dt(struct i2c_client *client)
input_err(true, &client->dev, "%s: Unable to request tsp_rst [%d]\n", __func__, pdata->rst_gpio);
return -EINVAL;
}
if (gpio_is_valid(pdata->rst_gpio)) {
/* pinctrl is not setting RESET gpio high by default */
/* due to compatibility issues with Synaptics driver */
gpio_set_value(pdata->rst_gpio, 1);
input_dbg(true, &client->dev, "%s: rst gpio is %d\n", __func__, gpio_get_value(pdata->rst_gpio));
}
} else
input_info(true, &client->dev, "%s: has no rst gpio\n", __func__);