input: misc: add condition check for ddic reset
LCD can control DDIC reset by itself, so add condition check and allow not to define DDIC reset pin in device tree. CRs-Fixed: 1097675 Change-ID: I802bb0ecc86349c7e0380b54811bfae776a41f49 Signed-off-by: Jin Fu <jinf@codeaurora.org>
This commit is contained in:
parent
5142c18bae
commit
92a038f916
1 changed files with 11 additions and 6 deletions
|
@ -54,6 +54,7 @@ struct hbtp_data {
|
||||||
struct pinctrl *ts_pinctrl;
|
struct pinctrl *ts_pinctrl;
|
||||||
struct pinctrl_state *gpio_state_active;
|
struct pinctrl_state *gpio_state_active;
|
||||||
struct pinctrl_state *gpio_state_suspend;
|
struct pinctrl_state *gpio_state_suspend;
|
||||||
|
bool ddic_rst_enabled;
|
||||||
struct pinctrl_state *ddic_rst_state_active;
|
struct pinctrl_state *ddic_rst_state_active;
|
||||||
struct pinctrl_state *ddic_rst_state_suspend;
|
struct pinctrl_state *ddic_rst_state_suspend;
|
||||||
u32 ts_pinctrl_seq_delay;
|
u32 ts_pinctrl_seq_delay;
|
||||||
|
@ -521,15 +522,17 @@ static int hbtp_pinctrl_enable(struct hbtp_data *ts, bool on)
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
rc = hbtp_ddic_rst_select(ts, true);
|
if (ts->ddic_rst_enabled) {
|
||||||
if (rc < 0)
|
rc = hbtp_ddic_rst_select(ts, true);
|
||||||
goto err_ddic_rst_pinctrl_enable;
|
if (rc < 0)
|
||||||
|
goto err_ddic_rst_pinctrl_enable;
|
||||||
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
pinctrl_suspend:
|
pinctrl_suspend:
|
||||||
if (ts->ddic_rst_state_suspend)
|
if (ts->ddic_rst_enabled)
|
||||||
hbtp_ddic_rst_select(ts, true);
|
hbtp_ddic_rst_select(ts, false);
|
||||||
err_ddic_rst_pinctrl_enable:
|
err_ddic_rst_pinctrl_enable:
|
||||||
hbtp_gpio_select(ts, false);
|
hbtp_gpio_select(ts, false);
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1078,8 +1081,10 @@ static int hbtp_pinctrl_init(struct hbtp_data *data)
|
||||||
dev_err(&data->pdev->dev, "count(%u) is not same as %u\n",
|
dev_err(&data->pdev->dev, "count(%u) is not same as %u\n",
|
||||||
(u32)count, HBTP_PINCTRL_DDIC_SEQ_NUM);
|
(u32)count, HBTP_PINCTRL_DDIC_SEQ_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data->ddic_rst_enabled = true;
|
||||||
} else {
|
} else {
|
||||||
dev_err(&data->pdev->dev, "ddic pinctrl act/sus not found\n");
|
dev_warn(&data->pdev->dev, "ddic pinctrl act/sus not found\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
data->manage_pin_ctrl = true;
|
data->manage_pin_ctrl = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue