aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-02-23 15:06:44 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-02-24 22:10:10 -0500
commit27cef8b47cfb27fa2955a8577637794f1f275db2 (patch)
treea92f52efaa486cc25b4302272aaef3c23110f86f
parentfa656308622fdaf54f2ff9ce8a70e4260f701b5d (diff)
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>
-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,
511 goto err_gpio_dir; 511 goto err_gpio_dir;
512 } 512 }
513 513
514 if (pdata->init_hw) 514 ret = gpio_request(pdata->gpio_rst, "auo_pixcir_ts_rst");
515 pdata->init_hw(client); 515 if (ret) {
516 dev_err(&client->dev, "request of gpio %d failed, %d\n",
517 pdata->gpio_rst, ret);
518 goto err_gpio_dir;
519 }
520
521 ret = gpio_direction_output(pdata->gpio_rst, 1);
522 if (ret) {
523 dev_err(&client->dev, "setting direction of gpio %d failed %d\n",
524 pdata->gpio_rst, ret);
525 goto err_gpio_rst;
526 }
527
528 msleep(200);
516 529
517 ts->client = client; 530 ts->client = client;
518 ts->touch_ind_mode = 0; 531 ts->touch_ind_mode = 0;
@@ -597,8 +610,9 @@ err_input_register:
597err_fw_vers: 610err_fw_vers:
598 input_free_device(input_dev); 611 input_free_device(input_dev);
599err_input_alloc: 612err_input_alloc:
600 if (pdata->exit_hw) 613 gpio_set_value(pdata->gpio_rst, 0);
601 pdata->exit_hw(client); 614err_gpio_rst:
615 gpio_free(pdata->gpio_rst);
602err_gpio_dir: 616err_gpio_dir:
603 gpio_free(pdata->gpio_int); 617 gpio_free(pdata->gpio_int);
604err_gpio_int: 618err_gpio_int:
@@ -616,8 +630,8 @@ static int auo_pixcir_remove(struct i2c_client *client)
616 630
617 input_unregister_device(ts->input); 631 input_unregister_device(ts->input);
618 632
619 if (pdata->exit_hw) 633 gpio_set_value(pdata->gpio_rst, 0);
620 pdata->exit_hw(client); 634 gpio_free(pdata->gpio_rst);
621 635
622 gpio_free(pdata->gpio_int); 636 gpio_free(pdata->gpio_int);
623 637
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 @@
43 */ 43 */
44struct auo_pixcir_ts_platdata { 44struct auo_pixcir_ts_platdata {
45 int gpio_int; 45 int gpio_int;
46 int gpio_rst;
46 47
47 int int_setting; 48 int int_setting;
48 49
49 void (*init_hw)(struct i2c_client *);
50 void (*exit_hw)(struct i2c_client *);
51
52 unsigned int x_max; 50 unsigned int x_max;
53 unsigned int y_max; 51 unsigned int y_max;
54}; 52};