aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/input/touchscreen/auo-pixcir-ts.c26
-rw-r--r--include/linux/input/auo-pixcir-ts.h4
2 files changed, 21 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 813413eebab7..6317a9c7884c 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -511,8 +511,21 @@ static int auo_pixcir_probe(struct i2c_client *client,
goto err_gpio_dir;
}
- if (pdata->init_hw)
- pdata->init_hw(client);
+ ret = gpio_request(pdata->gpio_rst, "auo_pixcir_ts_rst");
+ if (ret) {
+ dev_err(&client->dev, "request of gpio %d failed, %d\n",
+ pdata->gpio_rst, ret);
+ goto err_gpio_dir;
+ }
+
+ ret = gpio_direction_output(pdata->gpio_rst, 1);
+ if (ret) {
+ dev_err(&client->dev, "setting direction of gpio %d failed %d\n",
+ pdata->gpio_rst, ret);
+ goto err_gpio_rst;
+ }
+
+ msleep(200);
ts->client = client;
ts->touch_ind_mode = 0;
@@ -597,8 +610,9 @@ err_input_register:
err_fw_vers:
input_free_device(input_dev);
err_input_alloc:
- if (pdata->exit_hw)
- pdata->exit_hw(client);
+ gpio_set_value(pdata->gpio_rst, 0);
+err_gpio_rst:
+ gpio_free(pdata->gpio_rst);
err_gpio_dir:
gpio_free(pdata->gpio_int);
err_gpio_int:
@@ -616,8 +630,8 @@ static int auo_pixcir_remove(struct i2c_client *client)
input_unregister_device(ts->input);
- if (pdata->exit_hw)
- pdata->exit_hw(client);
+ gpio_set_value(pdata->gpio_rst, 0);
+ gpio_free(pdata->gpio_rst);
gpio_free(pdata->gpio_int);
diff --git a/include/linux/input/auo-pixcir-ts.h b/include/linux/input/auo-pixcir-ts.h
index 75d4be717714..5049f21928e4 100644
--- a/include/linux/input/auo-pixcir-ts.h
+++ b/include/linux/input/auo-pixcir-ts.h
@@ -43,12 +43,10 @@
*/
struct auo_pixcir_ts_platdata {
int gpio_int;
+ int gpio_rst;
int int_setting;
- void (*init_hw)(struct i2c_client *);
- void (*exit_hw)(struct i2c_client *);
-
unsigned int x_max;
unsigned int y_max;
};