diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c index 93347b31cd36..6ca19304d11d 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c @@ -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) diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h index b6d3b6f34061..c110251eb569 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h @@ -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];