focaltech_0flash: share gpio with LCD if defined in dts

TP:
For TDDI IC, TP reset is controled by LCD, LCD request reset gpio.
But focaltech IC still need HW reset in TP driver.
So we can control reset GPIO without request it, this GPIO is shared
with LCD

Change-Id: I65bbdb614ce7d9fd4f510ea4e23690072903bcf7
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1372626
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2019-06-18 17:16:53 +08:00 • committed by Jialei Hao
commit e409ca8038
2 changed files with 11 additions and 4 deletions

View file

@ -1087,10 +1087,12 @@ static int fts_gpio_configure(struct fts_ts_data *data)
/* request reset gpio */
if (gpio_is_valid(data->pdata->reset_gpio)) {
ret = gpio_request(data->pdata->reset_gpio, "fts_reset_gpio");
if (ret) {
FTS_ERROR("[GPIO]reset gpio request failed");
goto err_irq_gpio_dir;
if(!data->pdata->share_reset_gpio) {
ret = gpio_request(data->pdata->reset_gpio, "fts_reset_gpio");
if (ret) {
FTS_ERROR("[GPIO]reset gpio request failed");
goto err_irq_gpio_dir;
}
}
ret = gpio_direction_output(data->pdata->reset_gpio, 1);
@ -1208,6 +1210,10 @@ static int fts_parse_dt(struct device *dev, struct fts_ts_platform_data *pdata)
if (pdata->reset_gpio < 0)
FTS_ERROR("Unable to get reset_gpio");
pdata->share_reset_gpio = of_property_read_bool(np, "focaltech,share_reset_gpio");
if (pdata->share_reset_gpio)
FTS_INFO("TP reset pin is shared with LCD");
pdata->irq_gpio = of_get_named_gpio_flags(np, "focaltech,irq-gpio",
0, &pdata->irq_gpio_flags);
if (pdata->irq_gpio < 0)

View file

@ -118,6 +118,7 @@ struct fts_ts_platform_data {
u32 irq_gpio_flags;
u32 reset_gpio;
u32 reset_gpio_flags;
bool share_reset_gpio;
bool have_key;
u32 key_number;
u32 keys[FTS_MAX_KEYS];