aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/auo-pixcir-ts.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-02-23 15:06:48 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-02-24 22:10:14 -0500
commit38e83f7f9169400047aa3033d643891da1b00441 (patch)
tree096ca7da97495076c71a3d24851507ee04fc1728 /drivers/input/touchscreen/auo-pixcir-ts.c
parent27cef8b47cfb27fa2955a8577637794f1f275db2 (diff)
Input: auo_pixcir_ts - keep own pointer to platform_data
When supporting devicetree the platformdata may not necessarily come from the dev but may be generated in the driver instead. Therefore keep the pointer in the driver struct instead of using dev.platform_data. 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 6317a9c7884c..c0a2483b30cb 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -111,6 +111,7 @@
111struct auo_pixcir_ts { 111struct auo_pixcir_ts {
112 struct i2c_client *client; 112 struct i2c_client *client;
113 struct input_dev *input; 113 struct input_dev *input;
114 const struct auo_pixcir_ts_platdata *pdata;
114 char phys[32]; 115 char phys[32];
115 116
116 /* special handling for touch_indicate interupt mode */ 117 /* special handling for touch_indicate interupt mode */
@@ -132,7 +133,7 @@ static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts,
132 struct auo_point_t *point) 133 struct auo_point_t *point)
133{ 134{
134 struct i2c_client *client = ts->client; 135 struct i2c_client *client = ts->client;
135 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; 136 const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
136 uint8_t raw_coord[8]; 137 uint8_t raw_coord[8];
137 uint8_t raw_area[4]; 138 uint8_t raw_area[4];
138 int i, ret; 139 int i, ret;
@@ -178,8 +179,7 @@ static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts,
178static irqreturn_t auo_pixcir_interrupt(int irq, void *dev_id) 179static irqreturn_t auo_pixcir_interrupt(int irq, void *dev_id)
179{ 180{
180 struct auo_pixcir_ts *ts = dev_id; 181 struct auo_pixcir_ts *ts = dev_id;
181 struct i2c_client *client = ts->client; 182 const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
182 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
183 struct auo_point_t point[AUO_PIXCIR_REPORT_POINTS]; 183 struct auo_point_t point[AUO_PIXCIR_REPORT_POINTS];
184 int i; 184 int i;
185 int ret; 185 int ret;
@@ -290,7 +290,7 @@ static int auo_pixcir_int_config(struct auo_pixcir_ts *ts,
290 int int_setting) 290 int int_setting)
291{ 291{
292 struct i2c_client *client = ts->client; 292 struct i2c_client *client = ts->client;
293 struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; 293 const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
294 int ret; 294 int ret;
295 295
296 ret = i2c_smbus_read_byte_data(client, AUO_PIXCIR_REG_INT_SETTING); 296 ret = i2c_smbus_read_byte_data(client, AUO_PIXCIR_REG_INT_SETTING);
@@ -527,6 +527,7 @@ static int auo_pixcir_probe(struct i2c_client *client,
527 527
528 msleep(200); 528 msleep(200);
529 529
530 ts->pdata = pdata;
530 ts->client = client; 531 ts->client = client;
531 ts->touch_ind_mode = 0; 532 ts->touch_ind_mode = 0;
532 init_waitqueue_head(&ts->wait); 533 init_waitqueue_head(&ts->wait);
@@ -624,7 +625,7 @@ err_gpio_int:
624static int auo_pixcir_remove(struct i2c_client *client) 625static int auo_pixcir_remove(struct i2c_client *client)
625{ 626{
626 struct auo_pixcir_ts *ts = i2c_get_clientdata(client); 627 struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
627 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; 628 const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
628 629
629 free_irq(client->irq, ts); 630 free_irq(client->irq, ts);
630 631