summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/auo-pixcir-ts.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-02-23 12:06:44 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-02-24 19:10:10 -0800
commit27cef8b47cfb27fa2955a8577637794f1f275db2 (patch)
treea92f52efaa486cc25b4302272aaef3c23110f86f /drivers/input/touchscreen/auo-pixcir-ts.c
parentfa656308622fdaf54f2ff9ce8a70e4260f701b5d (diff)
downloadop-kernel-dev-27cef8b47cfb27fa2955a8577637794f1f275db2.zip
op-kernel-dev-27cef8b47cfb27fa2955a8577637794f1f275db2.tar.gz
Input: auo-pixcir-ts - handle reset gpio directly
Devicetree based platforms don't handle device callbacks very well and until now no board has come along that needs more extended hwinit than pulling the rst gpio high. Therefore pull the reset handling directly into the driver and remove the callbacks from the driver. If extended device setup is needed at some later point, power-sequences would probably be the solution of choice. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/auo-pixcir-ts.c')
-rw-r--r--drivers/input/touchscreen/auo-pixcir-ts.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 813413e..6317a9c 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);
OpenPOWER on IntegriCloud