diff options
Diffstat (limited to 'drivers/input/touchscreen')
43 files changed, 375 insertions, 728 deletions
diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c index 326218dbd6e6..c7068942ebe8 100644 --- a/drivers/input/touchscreen/88pm860x-ts.c +++ b/drivers/input/touchscreen/88pm860x-ts.c | |||
@@ -115,7 +115,7 @@ static void pm860x_touch_close(struct input_dev *dev) | |||
115 | } | 115 | } |
116 | 116 | ||
117 | #ifdef CONFIG_OF | 117 | #ifdef CONFIG_OF |
118 | static int __devinit pm860x_touch_dt_init(struct platform_device *pdev, | 118 | static int pm860x_touch_dt_init(struct platform_device *pdev, |
119 | struct pm860x_chip *chip, | 119 | struct pm860x_chip *chip, |
120 | int *res_x) | 120 | int *res_x) |
121 | { | 121 | { |
@@ -169,7 +169,7 @@ static int __devinit pm860x_touch_dt_init(struct platform_device *pdev, | |||
169 | #define pm860x_touch_dt_init(x, y, z) (-1) | 169 | #define pm860x_touch_dt_init(x, y, z) (-1) |
170 | #endif | 170 | #endif |
171 | 171 | ||
172 | static int __devinit pm860x_touch_probe(struct platform_device *pdev) | 172 | static int pm860x_touch_probe(struct platform_device *pdev) |
173 | { | 173 | { |
174 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | 174 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
175 | struct pm860x_touch_pdata *pdata = pdev->dev.platform_data; | 175 | struct pm860x_touch_pdata *pdata = pdev->dev.platform_data; |
@@ -293,7 +293,7 @@ out: | |||
293 | return ret; | 293 | return ret; |
294 | } | 294 | } |
295 | 295 | ||
296 | static int __devexit pm860x_touch_remove(struct platform_device *pdev) | 296 | static int pm860x_touch_remove(struct platform_device *pdev) |
297 | { | 297 | { |
298 | struct pm860x_touch *touch = platform_get_drvdata(pdev); | 298 | struct pm860x_touch *touch = platform_get_drvdata(pdev); |
299 | 299 | ||
@@ -310,7 +310,7 @@ static struct platform_driver pm860x_touch_driver = { | |||
310 | .owner = THIS_MODULE, | 310 | .owner = THIS_MODULE, |
311 | }, | 311 | }, |
312 | .probe = pm860x_touch_probe, | 312 | .probe = pm860x_touch_probe, |
313 | .remove = __devexit_p(pm860x_touch_remove), | 313 | .remove = pm860x_touch_remove, |
314 | }; | 314 | }; |
315 | module_platform_driver(pm860x_touch_driver); | 315 | module_platform_driver(pm860x_touch_driver); |
316 | 316 | ||
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index f7668b24c378..b93b5988ace8 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -111,18 +111,6 @@ config TOUCHSCREEN_AUO_PIXCIR | |||
111 | To compile this driver as a module, choose M here: the | 111 | To compile this driver as a module, choose M here: the |
112 | module will be called auo-pixcir-ts. | 112 | module will be called auo-pixcir-ts. |
113 | 113 | ||
114 | config TOUCHSCREEN_BITSY | ||
115 | tristate "Compaq iPAQ H3600 (Bitsy) touchscreen" | ||
116 | depends on SA1100_BITSY | ||
117 | select SERIO | ||
118 | help | ||
119 | Say Y here if you have the h3600 (Bitsy) touchscreen. | ||
120 | |||
121 | If unsure, say N. | ||
122 | |||
123 | To compile this driver as a module, choose M here: the | ||
124 | module will be called h3600_ts_input. | ||
125 | |||
126 | config TOUCHSCREEN_BU21013 | 114 | config TOUCHSCREEN_BU21013 |
127 | tristate "BU21013 based touch panel controllers" | 115 | tristate "BU21013 based touch panel controllers" |
128 | depends on I2C | 116 | depends on I2C |
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 178eb128d90f..5f949c0bf82f 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile | |||
@@ -15,7 +15,6 @@ obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o | |||
15 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o | 15 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o |
16 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o | 16 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o |
17 | obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o | 17 | obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o |
18 | obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o | ||
19 | obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o | 18 | obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o |
20 | obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o | 19 | obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o |
21 | obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o | 20 | obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o |
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 2c7692108e6c..23fa829b869d 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c | |||
@@ -682,7 +682,7 @@ static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts) | |||
682 | } | 682 | } |
683 | } | 683 | } |
684 | 684 | ||
685 | static int __devinit ad7877_probe(struct spi_device *spi) | 685 | static int ad7877_probe(struct spi_device *spi) |
686 | { | 686 | { |
687 | struct ad7877 *ts; | 687 | struct ad7877 *ts; |
688 | struct input_dev *input_dev; | 688 | struct input_dev *input_dev; |
@@ -810,7 +810,7 @@ err_free_mem: | |||
810 | return err; | 810 | return err; |
811 | } | 811 | } |
812 | 812 | ||
813 | static int __devexit ad7877_remove(struct spi_device *spi) | 813 | static int ad7877_remove(struct spi_device *spi) |
814 | { | 814 | { |
815 | struct ad7877 *ts = dev_get_drvdata(&spi->dev); | 815 | struct ad7877 *ts = dev_get_drvdata(&spi->dev); |
816 | 816 | ||
@@ -857,7 +857,7 @@ static struct spi_driver ad7877_driver = { | |||
857 | .pm = &ad7877_pm, | 857 | .pm = &ad7877_pm, |
858 | }, | 858 | }, |
859 | .probe = ad7877_probe, | 859 | .probe = ad7877_probe, |
860 | .remove = __devexit_p(ad7877_remove), | 860 | .remove = ad7877_remove, |
861 | }; | 861 | }; |
862 | 862 | ||
863 | module_spi_driver(ad7877_driver); | 863 | module_spi_driver(ad7877_driver); |
diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index 3054354d0dd3..dcf390771549 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c | |||
@@ -54,7 +54,7 @@ static const struct ad7879_bus_ops ad7879_i2c_bus_ops = { | |||
54 | .write = ad7879_i2c_write, | 54 | .write = ad7879_i2c_write, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | static int __devinit ad7879_i2c_probe(struct i2c_client *client, | 57 | static int ad7879_i2c_probe(struct i2c_client *client, |
58 | const struct i2c_device_id *id) | 58 | const struct i2c_device_id *id) |
59 | { | 59 | { |
60 | struct ad7879 *ts; | 60 | struct ad7879 *ts; |
@@ -75,7 +75,7 @@ static int __devinit ad7879_i2c_probe(struct i2c_client *client, | |||
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | static int __devexit ad7879_i2c_remove(struct i2c_client *client) | 78 | static int ad7879_i2c_remove(struct i2c_client *client) |
79 | { | 79 | { |
80 | struct ad7879 *ts = i2c_get_clientdata(client); | 80 | struct ad7879 *ts = i2c_get_clientdata(client); |
81 | 81 | ||
@@ -98,7 +98,7 @@ static struct i2c_driver ad7879_i2c_driver = { | |||
98 | .pm = &ad7879_pm_ops, | 98 | .pm = &ad7879_pm_ops, |
99 | }, | 99 | }, |
100 | .probe = ad7879_i2c_probe, | 100 | .probe = ad7879_i2c_probe, |
101 | .remove = __devexit_p(ad7879_i2c_remove), | 101 | .remove = ad7879_i2c_remove, |
102 | .id_table = ad7879_id, | 102 | .id_table = ad7879_id, |
103 | }; | 103 | }; |
104 | 104 | ||
diff --git a/drivers/input/touchscreen/ad7879-spi.c b/drivers/input/touchscreen/ad7879-spi.c index db49abf056ba..606da5bd6115 100644 --- a/drivers/input/touchscreen/ad7879-spi.c +++ b/drivers/input/touchscreen/ad7879-spi.c | |||
@@ -110,7 +110,7 @@ static const struct ad7879_bus_ops ad7879_spi_bus_ops = { | |||
110 | .write = ad7879_spi_write, | 110 | .write = ad7879_spi_write, |
111 | }; | 111 | }; |
112 | 112 | ||
113 | static int __devinit ad7879_spi_probe(struct spi_device *spi) | 113 | static int ad7879_spi_probe(struct spi_device *spi) |
114 | { | 114 | { |
115 | struct ad7879 *ts; | 115 | struct ad7879 *ts; |
116 | int err; | 116 | int err; |
@@ -137,7 +137,7 @@ static int __devinit ad7879_spi_probe(struct spi_device *spi) | |||
137 | return 0; | 137 | return 0; |
138 | } | 138 | } |
139 | 139 | ||
140 | static int __devexit ad7879_spi_remove(struct spi_device *spi) | 140 | static int ad7879_spi_remove(struct spi_device *spi) |
141 | { | 141 | { |
142 | struct ad7879 *ts = spi_get_drvdata(spi); | 142 | struct ad7879 *ts = spi_get_drvdata(spi); |
143 | 143 | ||
@@ -154,7 +154,7 @@ static struct spi_driver ad7879_spi_driver = { | |||
154 | .pm = &ad7879_pm_ops, | 154 | .pm = &ad7879_pm_ops, |
155 | }, | 155 | }, |
156 | .probe = ad7879_spi_probe, | 156 | .probe = ad7879_spi_probe, |
157 | .remove = __devexit_p(ad7879_spi_remove), | 157 | .remove = ad7879_spi_remove, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | module_spi_driver(ad7879_spi_driver); | 160 | module_spi_driver(ad7879_spi_driver); |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 78e5d9ab0ba7..4f702b3ec1a3 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -955,7 +955,7 @@ static int ads7846_resume(struct device *dev) | |||
955 | 955 | ||
956 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); | 956 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); |
957 | 957 | ||
958 | static int __devinit ads7846_setup_pendown(struct spi_device *spi, | 958 | static int ads7846_setup_pendown(struct spi_device *spi, |
959 | struct ads7846 *ts) | 959 | struct ads7846 *ts) |
960 | { | 960 | { |
961 | struct ads7846_platform_data *pdata = spi->dev.platform_data; | 961 | struct ads7846_platform_data *pdata = spi->dev.platform_data; |
@@ -997,7 +997,7 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, | |||
997 | * Set up the transfers to read touchscreen state; this assumes we | 997 | * Set up the transfers to read touchscreen state; this assumes we |
998 | * use formula #2 for pressure, not #3. | 998 | * use formula #2 for pressure, not #3. |
999 | */ | 999 | */ |
1000 | static void __devinit ads7846_setup_spi_msg(struct ads7846 *ts, | 1000 | static void ads7846_setup_spi_msg(struct ads7846 *ts, |
1001 | const struct ads7846_platform_data *pdata) | 1001 | const struct ads7846_platform_data *pdata) |
1002 | { | 1002 | { |
1003 | struct spi_message *m = &ts->msg[0]; | 1003 | struct spi_message *m = &ts->msg[0]; |
@@ -1196,7 +1196,7 @@ static void __devinit ads7846_setup_spi_msg(struct ads7846 *ts, | |||
1196 | spi_message_add_tail(x, m); | 1196 | spi_message_add_tail(x, m); |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | static int __devinit ads7846_probe(struct spi_device *spi) | 1199 | static int ads7846_probe(struct spi_device *spi) |
1200 | { | 1200 | { |
1201 | struct ads7846 *ts; | 1201 | struct ads7846 *ts; |
1202 | struct ads7846_packet *packet; | 1202 | struct ads7846_packet *packet; |
@@ -1390,7 +1390,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
1390 | return err; | 1390 | return err; |
1391 | } | 1391 | } |
1392 | 1392 | ||
1393 | static int __devexit ads7846_remove(struct spi_device *spi) | 1393 | static int ads7846_remove(struct spi_device *spi) |
1394 | { | 1394 | { |
1395 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); | 1395 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); |
1396 | 1396 | ||
@@ -1434,7 +1434,7 @@ static struct spi_driver ads7846_driver = { | |||
1434 | .pm = &ads7846_pm, | 1434 | .pm = &ads7846_pm, |
1435 | }, | 1435 | }, |
1436 | .probe = ads7846_probe, | 1436 | .probe = ads7846_probe, |
1437 | .remove = __devexit_p(ads7846_remove), | 1437 | .remove = ads7846_remove, |
1438 | }; | 1438 | }; |
1439 | 1439 | ||
1440 | module_spi_driver(ads7846_driver); | 1440 | module_spi_driver(ads7846_driver); |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 1df2396af008..d04f810cb1dd 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -1095,7 +1095,7 @@ static void mxt_input_close(struct input_dev *dev) | |||
1095 | mxt_stop(data); | 1095 | mxt_stop(data); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | static int __devinit mxt_probe(struct i2c_client *client, | 1098 | static int mxt_probe(struct i2c_client *client, |
1099 | const struct i2c_device_id *id) | 1099 | const struct i2c_device_id *id) |
1100 | { | 1100 | { |
1101 | const struct mxt_platform_data *pdata = client->dev.platform_data; | 1101 | const struct mxt_platform_data *pdata = client->dev.platform_data; |
@@ -1200,7 +1200,7 @@ err_free_mem: | |||
1200 | return error; | 1200 | return error; |
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | static int __devexit mxt_remove(struct i2c_client *client) | 1203 | static int mxt_remove(struct i2c_client *client) |
1204 | { | 1204 | { |
1205 | struct mxt_data *data = i2c_get_clientdata(client); | 1205 | struct mxt_data *data = i2c_get_clientdata(client); |
1206 | 1206 | ||
@@ -1270,7 +1270,7 @@ static struct i2c_driver mxt_driver = { | |||
1270 | .pm = &mxt_pm_ops, | 1270 | .pm = &mxt_pm_ops, |
1271 | }, | 1271 | }, |
1272 | .probe = mxt_probe, | 1272 | .probe = mxt_probe, |
1273 | .remove = __devexit_p(mxt_remove), | 1273 | .remove = mxt_remove, |
1274 | .id_table = mxt_id, | 1274 | .id_table = mxt_id, |
1275 | }; | 1275 | }; |
1276 | 1276 | ||
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c index 201b2d2ec1b3..55092d1c5cb9 100644 --- a/drivers/input/touchscreen/atmel_tsadcc.c +++ b/drivers/input/touchscreen/atmel_tsadcc.c | |||
@@ -177,7 +177,7 @@ static irqreturn_t atmel_tsadcc_interrupt(int irq, void *dev) | |||
177 | * The functions for inserting/removing us as a module. | 177 | * The functions for inserting/removing us as a module. |
178 | */ | 178 | */ |
179 | 179 | ||
180 | static int __devinit atmel_tsadcc_probe(struct platform_device *pdev) | 180 | static int atmel_tsadcc_probe(struct platform_device *pdev) |
181 | { | 181 | { |
182 | struct atmel_tsadcc *ts_dev; | 182 | struct atmel_tsadcc *ts_dev; |
183 | struct input_dev *input_dev; | 183 | struct input_dev *input_dev; |
@@ -323,7 +323,7 @@ err_free_mem: | |||
323 | return err; | 323 | return err; |
324 | } | 324 | } |
325 | 325 | ||
326 | static int __devexit atmel_tsadcc_remove(struct platform_device *pdev) | 326 | static int atmel_tsadcc_remove(struct platform_device *pdev) |
327 | { | 327 | { |
328 | struct atmel_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev); | 328 | struct atmel_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev); |
329 | struct resource *res; | 329 | struct resource *res; |
@@ -346,7 +346,7 @@ static int __devexit atmel_tsadcc_remove(struct platform_device *pdev) | |||
346 | 346 | ||
347 | static struct platform_driver atmel_tsadcc_driver = { | 347 | static struct platform_driver atmel_tsadcc_driver = { |
348 | .probe = atmel_tsadcc_probe, | 348 | .probe = atmel_tsadcc_probe, |
349 | .remove = __devexit_p(atmel_tsadcc_remove), | 349 | .remove = atmel_tsadcc_remove, |
350 | .driver = { | 350 | .driver = { |
351 | .name = "atmel_tsadcc", | 351 | .name = "atmel_tsadcc", |
352 | }, | 352 | }, |
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c index c7047b6bb020..c6e19a96348e 100644 --- a/drivers/input/touchscreen/auo-pixcir-ts.c +++ b/drivers/input/touchscreen/auo-pixcir-ts.c | |||
@@ -286,7 +286,7 @@ static int auo_pixcir_power_mode(struct auo_pixcir_ts *ts, int mode) | |||
286 | return 0; | 286 | return 0; |
287 | } | 287 | } |
288 | 288 | ||
289 | static __devinit int auo_pixcir_int_config(struct auo_pixcir_ts *ts, | 289 | 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; |
@@ -482,7 +482,7 @@ unlock: | |||
482 | static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, auo_pixcir_suspend, | 482 | static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, auo_pixcir_suspend, |
483 | auo_pixcir_resume); | 483 | auo_pixcir_resume); |
484 | 484 | ||
485 | static int __devinit auo_pixcir_probe(struct i2c_client *client, | 485 | static int auo_pixcir_probe(struct i2c_client *client, |
486 | const struct i2c_device_id *id) | 486 | const struct i2c_device_id *id) |
487 | { | 487 | { |
488 | const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; | 488 | const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; |
@@ -599,7 +599,7 @@ err_gpio_int: | |||
599 | return ret; | 599 | return ret; |
600 | } | 600 | } |
601 | 601 | ||
602 | static int __devexit auo_pixcir_remove(struct i2c_client *client) | 602 | static int auo_pixcir_remove(struct i2c_client *client) |
603 | { | 603 | { |
604 | struct auo_pixcir_ts *ts = i2c_get_clientdata(client); | 604 | struct auo_pixcir_ts *ts = i2c_get_clientdata(client); |
605 | const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; | 605 | const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; |
@@ -631,7 +631,7 @@ static struct i2c_driver auo_pixcir_driver = { | |||
631 | .pm = &auo_pixcir_pm_ops, | 631 | .pm = &auo_pixcir_pm_ops, |
632 | }, | 632 | }, |
633 | .probe = auo_pixcir_probe, | 633 | .probe = auo_pixcir_probe, |
634 | .remove = __devexit_p(auo_pixcir_remove), | 634 | .remove = auo_pixcir_remove, |
635 | .id_table = auo_pixcir_idtable, | 635 | .id_table = auo_pixcir_idtable, |
636 | }; | 636 | }; |
637 | 637 | ||
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index 5c487d23f11c..b9b5ddad6658 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c | |||
@@ -14,6 +14,9 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/regulator/consumer.h> | 15 | #include <linux/regulator/consumer.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/gpio.h> | ||
18 | #include <linux/of.h> | ||
19 | #include <linux/of_gpio.h> | ||
17 | 20 | ||
18 | #define PEN_DOWN_INTR 0 | 21 | #define PEN_DOWN_INTR 0 |
19 | #define MAX_FINGERS 2 | 22 | #define MAX_FINGERS 2 |
@@ -148,11 +151,12 @@ | |||
148 | struct bu21013_ts_data { | 151 | struct bu21013_ts_data { |
149 | struct i2c_client *client; | 152 | struct i2c_client *client; |
150 | wait_queue_head_t wait; | 153 | wait_queue_head_t wait; |
151 | bool touch_stopped; | ||
152 | const struct bu21013_platform_device *chip; | 154 | const struct bu21013_platform_device *chip; |
153 | struct input_dev *in_dev; | 155 | struct input_dev *in_dev; |
154 | unsigned int intr_pin; | ||
155 | struct regulator *regulator; | 156 | struct regulator *regulator; |
157 | unsigned int irq; | ||
158 | unsigned int intr_pin; | ||
159 | bool touch_stopped; | ||
156 | }; | 160 | }; |
157 | 161 | ||
158 | /** | 162 | /** |
@@ -262,7 +266,7 @@ static irqreturn_t bu21013_gpio_irq(int irq, void *device_data) | |||
262 | return IRQ_NONE; | 266 | return IRQ_NONE; |
263 | } | 267 | } |
264 | 268 | ||
265 | data->intr_pin = data->chip->irq_read_val(); | 269 | data->intr_pin = gpio_get_value(data->chip->touch_pin); |
266 | if (data->intr_pin == PEN_DOWN_INTR) | 270 | if (data->intr_pin == PEN_DOWN_INTR) |
267 | wait_event_timeout(data->wait, data->touch_stopped, | 271 | wait_event_timeout(data->wait, data->touch_stopped, |
268 | msecs_to_jiffies(2)); | 272 | msecs_to_jiffies(2)); |
@@ -418,8 +422,70 @@ static void bu21013_free_irq(struct bu21013_ts_data *bu21013_data) | |||
418 | { | 422 | { |
419 | bu21013_data->touch_stopped = true; | 423 | bu21013_data->touch_stopped = true; |
420 | wake_up(&bu21013_data->wait); | 424 | wake_up(&bu21013_data->wait); |
421 | free_irq(bu21013_data->chip->irq, bu21013_data); | 425 | free_irq(bu21013_data->irq, bu21013_data); |
426 | } | ||
427 | |||
428 | /** | ||
429 | * bu21013_cs_disable() - deconfigures the touch panel controller | ||
430 | * @bu21013_data: device structure pointer | ||
431 | * | ||
432 | * This function is used to deconfigure the chip selection | ||
433 | * for touch panel controller. | ||
434 | */ | ||
435 | static void bu21013_cs_disable(struct bu21013_ts_data *bu21013_data) | ||
436 | { | ||
437 | int error; | ||
438 | |||
439 | error = gpio_direction_output(bu21013_data->chip->cs_pin, 0); | ||
440 | if (error < 0) | ||
441 | dev_warn(&bu21013_data->client->dev, | ||
442 | "%s: gpio direction failed, error: %d\n", | ||
443 | __func__, error); | ||
444 | else | ||
445 | gpio_set_value(bu21013_data->chip->cs_pin, 0); | ||
446 | |||
447 | gpio_free(bu21013_data->chip->cs_pin); | ||
448 | } | ||
449 | |||
450 | #ifdef CONFIG_OF | ||
451 | static const struct bu21013_platform_device * | ||
452 | bu21013_parse_dt(struct device *dev) | ||
453 | { | ||
454 | struct device_node *np = dev->of_node; | ||
455 | struct bu21013_platform_device *pdata; | ||
456 | |||
457 | if (!np) { | ||
458 | dev_err(dev, "no device tree or platform data\n"); | ||
459 | return ERR_PTR(-EINVAL); | ||
460 | } | ||
461 | |||
462 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); | ||
463 | if (!pdata) | ||
464 | return ERR_PTR(-ENOMEM); | ||
465 | |||
466 | pdata->y_flip = pdata->x_flip = false; | ||
467 | |||
468 | pdata->x_flip = of_property_read_bool(np, "rohm,flip-x"); | ||
469 | pdata->y_flip = of_property_read_bool(np, "rohm,flip-y"); | ||
470 | |||
471 | of_property_read_u32(np, "rohm,touch-max-x", &pdata->touch_x_max); | ||
472 | of_property_read_u32(np, "rohm,touch-max-y", &pdata->touch_y_max); | ||
473 | |||
474 | pdata->touch_pin = of_get_named_gpio(np, "touch-gpio", 0); | ||
475 | pdata->cs_pin = of_get_named_gpio(np, "reset-gpio", 0); | ||
476 | |||
477 | pdata->ext_clk = false; | ||
478 | |||
479 | return pdata; | ||
422 | } | 480 | } |
481 | #else | ||
482 | static inline const struct bu21013_platform_device * | ||
483 | bu21013_parse_dt(struct device *dev) | ||
484 | { | ||
485 | dev_err(dev, "no platform data available\n"); | ||
486 | return ERR_PTR(-EINVAL); | ||
487 | } | ||
488 | #endif | ||
423 | 489 | ||
424 | /** | 490 | /** |
425 | * bu21013_probe() - initializes the i2c-client touchscreen driver | 491 | * bu21013_probe() - initializes the i2c-client touchscreen driver |
@@ -429,13 +495,13 @@ static void bu21013_free_irq(struct bu21013_ts_data *bu21013_data) | |||
429 | * This function used to initializes the i2c-client touchscreen | 495 | * This function used to initializes the i2c-client touchscreen |
430 | * driver and returns integer. | 496 | * driver and returns integer. |
431 | */ | 497 | */ |
432 | static int __devinit bu21013_probe(struct i2c_client *client, | 498 | static int bu21013_probe(struct i2c_client *client, |
433 | const struct i2c_device_id *id) | 499 | const struct i2c_device_id *id) |
434 | { | 500 | { |
501 | const struct bu21013_platform_device *pdata = | ||
502 | dev_get_platdata(&client->dev); | ||
435 | struct bu21013_ts_data *bu21013_data; | 503 | struct bu21013_ts_data *bu21013_data; |
436 | struct input_dev *in_dev; | 504 | struct input_dev *in_dev; |
437 | const struct bu21013_platform_device *pdata = | ||
438 | client->dev.platform_data; | ||
439 | int error; | 505 | int error; |
440 | 506 | ||
441 | if (!i2c_check_functionality(client->adapter, | 507 | if (!i2c_check_functionality(client->adapter, |
@@ -445,7 +511,13 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
445 | } | 511 | } |
446 | 512 | ||
447 | if (!pdata) { | 513 | if (!pdata) { |
448 | dev_err(&client->dev, "platform data not defined\n"); | 514 | pdata = bu21013_parse_dt(&client->dev); |
515 | if (IS_ERR(pdata)) | ||
516 | return PTR_ERR(pdata); | ||
517 | } | ||
518 | |||
519 | if (!gpio_is_valid(pdata->touch_pin)) { | ||
520 | dev_err(&client->dev, "invalid touch_pin supplied\n"); | ||
449 | return -EINVAL; | 521 | return -EINVAL; |
450 | } | 522 | } |
451 | 523 | ||
@@ -460,8 +532,9 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
460 | bu21013_data->in_dev = in_dev; | 532 | bu21013_data->in_dev = in_dev; |
461 | bu21013_data->chip = pdata; | 533 | bu21013_data->chip = pdata; |
462 | bu21013_data->client = client; | 534 | bu21013_data->client = client; |
535 | bu21013_data->irq = gpio_to_irq(pdata->touch_pin); | ||
463 | 536 | ||
464 | bu21013_data->regulator = regulator_get(&client->dev, "V-TOUCH"); | 537 | bu21013_data->regulator = regulator_get(&client->dev, "avdd"); |
465 | if (IS_ERR(bu21013_data->regulator)) { | 538 | if (IS_ERR(bu21013_data->regulator)) { |
466 | dev_err(&client->dev, "regulator_get failed\n"); | 539 | dev_err(&client->dev, "regulator_get failed\n"); |
467 | error = PTR_ERR(bu21013_data->regulator); | 540 | error = PTR_ERR(bu21013_data->regulator); |
@@ -478,12 +551,11 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
478 | init_waitqueue_head(&bu21013_data->wait); | 551 | init_waitqueue_head(&bu21013_data->wait); |
479 | 552 | ||
480 | /* configure the gpio pins */ | 553 | /* configure the gpio pins */ |
481 | if (pdata->cs_en) { | 554 | error = gpio_request_one(pdata->cs_pin, GPIOF_OUT_INIT_HIGH, |
482 | error = pdata->cs_en(pdata->cs_pin); | 555 | "touchp_reset"); |
483 | if (error < 0) { | 556 | if (error < 0) { |
484 | dev_err(&client->dev, "chip init failed\n"); | 557 | dev_err(&client->dev, "Unable to request gpio reset_pin\n"); |
485 | goto err_disable_regulator; | 558 | goto err_disable_regulator; |
486 | } | ||
487 | } | 559 | } |
488 | 560 | ||
489 | /* configure the touch panel controller */ | 561 | /* configure the touch panel controller */ |
@@ -508,12 +580,13 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
508 | pdata->touch_y_max, 0, 0); | 580 | pdata->touch_y_max, 0, 0); |
509 | input_set_drvdata(in_dev, bu21013_data); | 581 | input_set_drvdata(in_dev, bu21013_data); |
510 | 582 | ||
511 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, | 583 | error = request_threaded_irq(bu21013_data->irq, NULL, bu21013_gpio_irq, |
512 | IRQF_TRIGGER_FALLING | IRQF_SHARED | | 584 | IRQF_TRIGGER_FALLING | IRQF_SHARED | |
513 | IRQF_ONESHOT, | 585 | IRQF_ONESHOT, |
514 | DRIVER_TP, bu21013_data); | 586 | DRIVER_TP, bu21013_data); |
515 | if (error) { | 587 | if (error) { |
516 | dev_err(&client->dev, "request irq %d failed\n", pdata->irq); | 588 | dev_err(&client->dev, "request irq %d failed\n", |
589 | bu21013_data->irq); | ||
517 | goto err_cs_disable; | 590 | goto err_cs_disable; |
518 | } | 591 | } |
519 | 592 | ||
@@ -531,7 +604,7 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
531 | err_free_irq: | 604 | err_free_irq: |
532 | bu21013_free_irq(bu21013_data); | 605 | bu21013_free_irq(bu21013_data); |
533 | err_cs_disable: | 606 | err_cs_disable: |
534 | pdata->cs_dis(pdata->cs_pin); | 607 | bu21013_cs_disable(bu21013_data); |
535 | err_disable_regulator: | 608 | err_disable_regulator: |
536 | regulator_disable(bu21013_data->regulator); | 609 | regulator_disable(bu21013_data->regulator); |
537 | err_put_regulator: | 610 | err_put_regulator: |
@@ -549,13 +622,13 @@ err_free_mem: | |||
549 | * This function uses to remove the i2c-client | 622 | * This function uses to remove the i2c-client |
550 | * touchscreen driver and returns integer. | 623 | * touchscreen driver and returns integer. |
551 | */ | 624 | */ |
552 | static int __devexit bu21013_remove(struct i2c_client *client) | 625 | static int bu21013_remove(struct i2c_client *client) |
553 | { | 626 | { |
554 | struct bu21013_ts_data *bu21013_data = i2c_get_clientdata(client); | 627 | struct bu21013_ts_data *bu21013_data = i2c_get_clientdata(client); |
555 | 628 | ||
556 | bu21013_free_irq(bu21013_data); | 629 | bu21013_free_irq(bu21013_data); |
557 | 630 | ||
558 | bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin); | 631 | bu21013_cs_disable(bu21013_data); |
559 | 632 | ||
560 | input_unregister_device(bu21013_data->in_dev); | 633 | input_unregister_device(bu21013_data->in_dev); |
561 | 634 | ||
@@ -584,9 +657,9 @@ static int bu21013_suspend(struct device *dev) | |||
584 | 657 | ||
585 | bu21013_data->touch_stopped = true; | 658 | bu21013_data->touch_stopped = true; |
586 | if (device_may_wakeup(&client->dev)) | 659 | if (device_may_wakeup(&client->dev)) |
587 | enable_irq_wake(bu21013_data->chip->irq); | 660 | enable_irq_wake(bu21013_data->irq); |
588 | else | 661 | else |
589 | disable_irq(bu21013_data->chip->irq); | 662 | disable_irq(bu21013_data->irq); |
590 | 663 | ||
591 | regulator_disable(bu21013_data->regulator); | 664 | regulator_disable(bu21013_data->regulator); |
592 | 665 | ||
@@ -621,9 +694,9 @@ static int bu21013_resume(struct device *dev) | |||
621 | bu21013_data->touch_stopped = false; | 694 | bu21013_data->touch_stopped = false; |
622 | 695 | ||
623 | if (device_may_wakeup(&client->dev)) | 696 | if (device_may_wakeup(&client->dev)) |
624 | disable_irq_wake(bu21013_data->chip->irq); | 697 | disable_irq_wake(bu21013_data->irq); |
625 | else | 698 | else |
626 | enable_irq(bu21013_data->chip->irq); | 699 | enable_irq(bu21013_data->irq); |
627 | 700 | ||
628 | return 0; | 701 | return 0; |
629 | } | 702 | } |
@@ -649,7 +722,7 @@ static struct i2c_driver bu21013_driver = { | |||
649 | #endif | 722 | #endif |
650 | }, | 723 | }, |
651 | .probe = bu21013_probe, | 724 | .probe = bu21013_probe, |
652 | .remove = __devexit_p(bu21013_remove), | 725 | .remove = bu21013_remove, |
653 | .id_table = bu21013_id, | 726 | .id_table = bu21013_id, |
654 | }; | 727 | }; |
655 | 728 | ||
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index 464f1bf4b61d..96e0eedcc7e5 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c | |||
@@ -99,9 +99,18 @@ static int cy8ctmg110_read_regs(struct cy8ctmg110 *tsc, | |||
99 | int ret; | 99 | int ret; |
100 | struct i2c_msg msg[2] = { | 100 | struct i2c_msg msg[2] = { |
101 | /* first write slave position to i2c devices */ | 101 | /* first write slave position to i2c devices */ |
102 | { client->addr, 0, 1, &cmd }, | 102 | { |
103 | .addr = client->addr, | ||
104 | .len = 1, | ||
105 | .buf = &cmd | ||
106 | }, | ||
103 | /* Second read data from position */ | 107 | /* Second read data from position */ |
104 | { client->addr, I2C_M_RD, len, data } | 108 | { |
109 | .addr = client->addr, | ||
110 | .flags = I2C_M_RD, | ||
111 | .len = len, | ||
112 | .buf = data | ||
113 | } | ||
105 | }; | 114 | }; |
106 | 115 | ||
107 | ret = i2c_transfer(client->adapter, msg, 2); | 116 | ret = i2c_transfer(client->adapter, msg, 2); |
@@ -166,7 +175,7 @@ static irqreturn_t cy8ctmg110_irq_thread(int irq, void *dev_id) | |||
166 | return IRQ_HANDLED; | 175 | return IRQ_HANDLED; |
167 | } | 176 | } |
168 | 177 | ||
169 | static int __devinit cy8ctmg110_probe(struct i2c_client *client, | 178 | static int cy8ctmg110_probe(struct i2c_client *client, |
170 | const struct i2c_device_id *id) | 179 | const struct i2c_device_id *id) |
171 | { | 180 | { |
172 | const struct cy8ctmg110_pdata *pdata = client->dev.platform_data; | 181 | const struct cy8ctmg110_pdata *pdata = client->dev.platform_data; |
@@ -314,7 +323,7 @@ static int cy8ctmg110_resume(struct device *dev) | |||
314 | static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); | 323 | static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); |
315 | #endif | 324 | #endif |
316 | 325 | ||
317 | static int __devexit cy8ctmg110_remove(struct i2c_client *client) | 326 | static int cy8ctmg110_remove(struct i2c_client *client) |
318 | { | 327 | { |
319 | struct cy8ctmg110 *ts = i2c_get_clientdata(client); | 328 | struct cy8ctmg110 *ts = i2c_get_clientdata(client); |
320 | 329 | ||
@@ -348,7 +357,7 @@ static struct i2c_driver cy8ctmg110_driver = { | |||
348 | }, | 357 | }, |
349 | .id_table = cy8ctmg110_idtable, | 358 | .id_table = cy8ctmg110_idtable, |
350 | .probe = cy8ctmg110_probe, | 359 | .probe = cy8ctmg110_probe, |
351 | .remove = __devexit_p(cy8ctmg110_remove), | 360 | .remove = cy8ctmg110_remove, |
352 | }; | 361 | }; |
353 | 362 | ||
354 | module_i2c_driver(cy8ctmg110_driver); | 363 | module_i2c_driver(cy8ctmg110_driver); |
diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c index 2af1d0c52bcd..4dbdf44b8fc5 100644 --- a/drivers/input/touchscreen/cyttsp_i2c.c +++ b/drivers/input/touchscreen/cyttsp_i2c.c | |||
@@ -81,7 +81,7 @@ static const struct cyttsp_bus_ops cyttsp_i2c_bus_ops = { | |||
81 | .read = cyttsp_i2c_read_block_data, | 81 | .read = cyttsp_i2c_read_block_data, |
82 | }; | 82 | }; |
83 | 83 | ||
84 | static int __devinit cyttsp_i2c_probe(struct i2c_client *client, | 84 | static int cyttsp_i2c_probe(struct i2c_client *client, |
85 | const struct i2c_device_id *id) | 85 | const struct i2c_device_id *id) |
86 | { | 86 | { |
87 | struct cyttsp *ts; | 87 | struct cyttsp *ts; |
@@ -102,7 +102,7 @@ static int __devinit cyttsp_i2c_probe(struct i2c_client *client, | |||
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int __devexit cyttsp_i2c_remove(struct i2c_client *client) | 105 | static int cyttsp_i2c_remove(struct i2c_client *client) |
106 | { | 106 | { |
107 | struct cyttsp *ts = i2c_get_clientdata(client); | 107 | struct cyttsp *ts = i2c_get_clientdata(client); |
108 | 108 | ||
@@ -124,7 +124,7 @@ static struct i2c_driver cyttsp_i2c_driver = { | |||
124 | .pm = &cyttsp_pm_ops, | 124 | .pm = &cyttsp_pm_ops, |
125 | }, | 125 | }, |
126 | .probe = cyttsp_i2c_probe, | 126 | .probe = cyttsp_i2c_probe, |
127 | .remove = __devexit_p(cyttsp_i2c_remove), | 127 | .remove = cyttsp_i2c_remove, |
128 | .id_table = cyttsp_i2c_id, | 128 | .id_table = cyttsp_i2c_id, |
129 | }; | 129 | }; |
130 | 130 | ||
diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c index 9f263410407b..638e20310f12 100644 --- a/drivers/input/touchscreen/cyttsp_spi.c +++ b/drivers/input/touchscreen/cyttsp_spi.c | |||
@@ -147,7 +147,7 @@ static const struct cyttsp_bus_ops cyttsp_spi_bus_ops = { | |||
147 | .read = cyttsp_spi_read_block_data, | 147 | .read = cyttsp_spi_read_block_data, |
148 | }; | 148 | }; |
149 | 149 | ||
150 | static int __devinit cyttsp_spi_probe(struct spi_device *spi) | 150 | static int cyttsp_spi_probe(struct spi_device *spi) |
151 | { | 151 | { |
152 | struct cyttsp *ts; | 152 | struct cyttsp *ts; |
153 | int error; | 153 | int error; |
@@ -172,7 +172,7 @@ static int __devinit cyttsp_spi_probe(struct spi_device *spi) | |||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | static int __devexit cyttsp_spi_remove(struct spi_device *spi) | 175 | static int cyttsp_spi_remove(struct spi_device *spi) |
176 | { | 176 | { |
177 | struct cyttsp *ts = spi_get_drvdata(spi); | 177 | struct cyttsp *ts = spi_get_drvdata(spi); |
178 | 178 | ||
@@ -188,7 +188,7 @@ static struct spi_driver cyttsp_spi_driver = { | |||
188 | .pm = &cyttsp_pm_ops, | 188 | .pm = &cyttsp_pm_ops, |
189 | }, | 189 | }, |
190 | .probe = cyttsp_spi_probe, | 190 | .probe = cyttsp_spi_probe, |
191 | .remove = __devexit_p(cyttsp_spi_remove), | 191 | .remove = cyttsp_spi_remove, |
192 | }; | 192 | }; |
193 | 193 | ||
194 | module_spi_driver(cyttsp_spi_driver); | 194 | module_spi_driver(cyttsp_spi_driver); |
diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c index 36b65cf10d7f..34ad84105e6e 100644 --- a/drivers/input/touchscreen/da9034-ts.c +++ b/drivers/input/touchscreen/da9034-ts.c | |||
@@ -297,7 +297,7 @@ static void da9034_touch_close(struct input_dev *dev) | |||
297 | } | 297 | } |
298 | 298 | ||
299 | 299 | ||
300 | static int __devinit da9034_touch_probe(struct platform_device *pdev) | 300 | static int da9034_touch_probe(struct platform_device *pdev) |
301 | { | 301 | { |
302 | struct da9034_touch_pdata *pdata = pdev->dev.platform_data; | 302 | struct da9034_touch_pdata *pdata = pdev->dev.platform_data; |
303 | struct da9034_touch *touch; | 303 | struct da9034_touch *touch; |
@@ -361,7 +361,7 @@ err_free_touch: | |||
361 | return ret; | 361 | return ret; |
362 | } | 362 | } |
363 | 363 | ||
364 | static int __devexit da9034_touch_remove(struct platform_device *pdev) | 364 | static int da9034_touch_remove(struct platform_device *pdev) |
365 | { | 365 | { |
366 | struct da9034_touch *touch = platform_get_drvdata(pdev); | 366 | struct da9034_touch *touch = platform_get_drvdata(pdev); |
367 | 367 | ||
@@ -377,7 +377,7 @@ static struct platform_driver da9034_touch_driver = { | |||
377 | .owner = THIS_MODULE, | 377 | .owner = THIS_MODULE, |
378 | }, | 378 | }, |
379 | .probe = da9034_touch_probe, | 379 | .probe = da9034_touch_probe, |
380 | .remove = __devexit_p(da9034_touch_remove), | 380 | .remove = da9034_touch_remove, |
381 | }; | 381 | }; |
382 | module_platform_driver(da9034_touch_driver); | 382 | module_platform_driver(da9034_touch_driver); |
383 | 383 | ||
diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c index e8df341090c0..303966ffe1e8 100644 --- a/drivers/input/touchscreen/da9052_tsi.c +++ b/drivers/input/touchscreen/da9052_tsi.c | |||
@@ -143,7 +143,7 @@ static void da9052_ts_pen_work(struct work_struct *work) | |||
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | static int __devinit da9052_ts_configure_gpio(struct da9052 *da9052) | 146 | static int da9052_ts_configure_gpio(struct da9052 *da9052) |
147 | { | 147 | { |
148 | int error; | 148 | int error; |
149 | 149 | ||
@@ -162,7 +162,7 @@ static int __devinit da9052_ts_configure_gpio(struct da9052 *da9052) | |||
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
164 | 164 | ||
165 | static int __devinit da9052_configure_tsi(struct da9052_tsi *tsi) | 165 | static int da9052_configure_tsi(struct da9052_tsi *tsi) |
166 | { | 166 | { |
167 | int error; | 167 | int error; |
168 | 168 | ||
@@ -229,7 +229,7 @@ static void da9052_ts_input_close(struct input_dev *input_dev) | |||
229 | da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 1, 0); | 229 | da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 1, 0); |
230 | } | 230 | } |
231 | 231 | ||
232 | static int __devinit da9052_ts_probe(struct platform_device *pdev) | 232 | static int da9052_ts_probe(struct platform_device *pdev) |
233 | { | 233 | { |
234 | struct da9052 *da9052; | 234 | struct da9052 *da9052; |
235 | struct da9052_tsi *tsi; | 235 | struct da9052_tsi *tsi; |
@@ -336,7 +336,7 @@ err_free_mem: | |||
336 | return error; | 336 | return error; |
337 | } | 337 | } |
338 | 338 | ||
339 | static int __devexit da9052_ts_remove(struct platform_device *pdev) | 339 | static int da9052_ts_remove(struct platform_device *pdev) |
340 | { | 340 | { |
341 | struct da9052_tsi *tsi = platform_get_drvdata(pdev); | 341 | struct da9052_tsi *tsi = platform_get_drvdata(pdev); |
342 | 342 | ||
@@ -355,7 +355,7 @@ static int __devexit da9052_ts_remove(struct platform_device *pdev) | |||
355 | 355 | ||
356 | static struct platform_driver da9052_tsi_driver = { | 356 | static struct platform_driver da9052_tsi_driver = { |
357 | .probe = da9052_ts_probe, | 357 | .probe = da9052_ts_probe, |
358 | .remove = __devexit_p(da9052_ts_remove), | 358 | .remove = da9052_ts_remove, |
359 | .driver = { | 359 | .driver = { |
360 | .name = "da9052-tsi", | 360 | .name = "da9052-tsi", |
361 | .owner = THIS_MODULE, | 361 | .owner = THIS_MODULE, |
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 099d144ab7c9..a9170157b442 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c | |||
@@ -491,14 +491,6 @@ static int edt_ft5x06_debugfs_mode_set(void *data, u64 mode) | |||
491 | DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get, | 491 | DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get, |
492 | edt_ft5x06_debugfs_mode_set, "%llu\n"); | 492 | edt_ft5x06_debugfs_mode_set, "%llu\n"); |
493 | 493 | ||
494 | static int edt_ft5x06_debugfs_raw_data_open(struct inode *inode, | ||
495 | struct file *file) | ||
496 | { | ||
497 | file->private_data = inode->i_private; | ||
498 | |||
499 | return 0; | ||
500 | } | ||
501 | |||
502 | static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, | 494 | static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, |
503 | char __user *buf, size_t count, loff_t *off) | 495 | char __user *buf, size_t count, loff_t *off) |
504 | { | 496 | { |
@@ -579,11 +571,11 @@ out: | |||
579 | 571 | ||
580 | 572 | ||
581 | static const struct file_operations debugfs_raw_data_fops = { | 573 | static const struct file_operations debugfs_raw_data_fops = { |
582 | .open = edt_ft5x06_debugfs_raw_data_open, | 574 | .open = simple_open, |
583 | .read = edt_ft5x06_debugfs_raw_data_read, | 575 | .read = edt_ft5x06_debugfs_raw_data_read, |
584 | }; | 576 | }; |
585 | 577 | ||
586 | static void __devinit | 578 | static void |
587 | edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata, | 579 | edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata, |
588 | const char *debugfs_name) | 580 | const char *debugfs_name) |
589 | { | 581 | { |
@@ -600,7 +592,7 @@ edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata, | |||
600 | tsdata->debug_dir, tsdata, &debugfs_raw_data_fops); | 592 | tsdata->debug_dir, tsdata, &debugfs_raw_data_fops); |
601 | } | 593 | } |
602 | 594 | ||
603 | static void __devexit | 595 | static void |
604 | edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) | 596 | edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) |
605 | { | 597 | { |
606 | if (tsdata->debug_dir) | 598 | if (tsdata->debug_dir) |
@@ -625,7 +617,7 @@ edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) | |||
625 | 617 | ||
626 | 618 | ||
627 | 619 | ||
628 | static int __devinit edt_ft5x06_ts_reset(struct i2c_client *client, | 620 | static int edt_ft5x06_ts_reset(struct i2c_client *client, |
629 | int reset_pin) | 621 | int reset_pin) |
630 | { | 622 | { |
631 | int error; | 623 | int error; |
@@ -649,7 +641,7 @@ static int __devinit edt_ft5x06_ts_reset(struct i2c_client *client, | |||
649 | return 0; | 641 | return 0; |
650 | } | 642 | } |
651 | 643 | ||
652 | static int __devinit edt_ft5x06_ts_identify(struct i2c_client *client, | 644 | static int edt_ft5x06_ts_identify(struct i2c_client *client, |
653 | char *model_name, | 645 | char *model_name, |
654 | char *fw_version) | 646 | char *fw_version) |
655 | { | 647 | { |
@@ -683,7 +675,7 @@ static int __devinit edt_ft5x06_ts_identify(struct i2c_client *client, | |||
683 | pdata->name <= edt_ft5x06_attr_##name.limit_high) \ | 675 | pdata->name <= edt_ft5x06_attr_##name.limit_high) \ |
684 | edt_ft5x06_register_write(tsdata, reg, pdata->name) | 676 | edt_ft5x06_register_write(tsdata, reg, pdata->name) |
685 | 677 | ||
686 | static void __devinit | 678 | static void |
687 | edt_ft5x06_ts_get_defaults(struct edt_ft5x06_ts_data *tsdata, | 679 | edt_ft5x06_ts_get_defaults(struct edt_ft5x06_ts_data *tsdata, |
688 | const struct edt_ft5x06_platform_data *pdata) | 680 | const struct edt_ft5x06_platform_data *pdata) |
689 | { | 681 | { |
@@ -697,7 +689,7 @@ edt_ft5x06_ts_get_defaults(struct edt_ft5x06_ts_data *tsdata, | |||
697 | EDT_ATTR_CHECKSET(report_rate, WORK_REGISTER_REPORT_RATE); | 689 | EDT_ATTR_CHECKSET(report_rate, WORK_REGISTER_REPORT_RATE); |
698 | } | 690 | } |
699 | 691 | ||
700 | static void __devinit | 692 | static void |
701 | edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) | 693 | edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) |
702 | { | 694 | { |
703 | tsdata->threshold = edt_ft5x06_register_read(tsdata, | 695 | tsdata->threshold = edt_ft5x06_register_read(tsdata, |
@@ -710,7 +702,7 @@ edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) | |||
710 | tsdata->num_y = edt_ft5x06_register_read(tsdata, WORK_REGISTER_NUM_Y); | 702 | tsdata->num_y = edt_ft5x06_register_read(tsdata, WORK_REGISTER_NUM_Y); |
711 | } | 703 | } |
712 | 704 | ||
713 | static int __devinit edt_ft5x06_ts_probe(struct i2c_client *client, | 705 | static int edt_ft5x06_ts_probe(struct i2c_client *client, |
714 | const struct i2c_device_id *id) | 706 | const struct i2c_device_id *id) |
715 | { | 707 | { |
716 | const struct edt_ft5x06_platform_data *pdata = | 708 | const struct edt_ft5x06_platform_data *pdata = |
@@ -830,7 +822,7 @@ err_free_mem: | |||
830 | return error; | 822 | return error; |
831 | } | 823 | } |
832 | 824 | ||
833 | static int __devexit edt_ft5x06_ts_remove(struct i2c_client *client) | 825 | static int edt_ft5x06_ts_remove(struct i2c_client *client) |
834 | { | 826 | { |
835 | const struct edt_ft5x06_platform_data *pdata = | 827 | const struct edt_ft5x06_platform_data *pdata = |
836 | dev_get_platdata(&client->dev); | 828 | dev_get_platdata(&client->dev); |
@@ -891,7 +883,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = { | |||
891 | }, | 883 | }, |
892 | .id_table = edt_ft5x06_ts_id, | 884 | .id_table = edt_ft5x06_ts_id, |
893 | .probe = edt_ft5x06_ts_probe, | 885 | .probe = edt_ft5x06_ts_probe, |
894 | .remove = __devexit_p(edt_ft5x06_ts_remove), | 886 | .remove = edt_ft5x06_ts_remove, |
895 | }; | 887 | }; |
896 | 888 | ||
897 | module_i2c_driver(edt_ft5x06_ts_driver); | 889 | module_i2c_driver(edt_ft5x06_ts_driver); |
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index 908407efc672..55255a940072 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c | |||
@@ -154,7 +154,7 @@ static void eeti_ts_close(struct input_dev *dev) | |||
154 | eeti_ts_stop(priv); | 154 | eeti_ts_stop(priv); |
155 | } | 155 | } |
156 | 156 | ||
157 | static int __devinit eeti_ts_probe(struct i2c_client *client, | 157 | static int eeti_ts_probe(struct i2c_client *client, |
158 | const struct i2c_device_id *idp) | 158 | const struct i2c_device_id *idp) |
159 | { | 159 | { |
160 | struct eeti_ts_platform_data *pdata = client->dev.platform_data; | 160 | struct eeti_ts_platform_data *pdata = client->dev.platform_data; |
@@ -248,7 +248,7 @@ err0: | |||
248 | return err; | 248 | return err; |
249 | } | 249 | } |
250 | 250 | ||
251 | static int __devexit eeti_ts_remove(struct i2c_client *client) | 251 | static int eeti_ts_remove(struct i2c_client *client) |
252 | { | 252 | { |
253 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 253 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
254 | 254 | ||
@@ -321,7 +321,7 @@ static struct i2c_driver eeti_ts_driver = { | |||
321 | #endif | 321 | #endif |
322 | }, | 322 | }, |
323 | .probe = eeti_ts_probe, | 323 | .probe = eeti_ts_probe, |
324 | .remove = __devexit_p(eeti_ts_remove), | 324 | .remove = eeti_ts_remove, |
325 | .id_table = eeti_ts_id, | 325 | .id_table = eeti_ts_id, |
326 | }; | 326 | }; |
327 | 327 | ||
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 13fa62fdfb0b..17c9097f3b5d 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c | |||
@@ -153,7 +153,7 @@ static int egalax_wake_up_device(struct i2c_client *client) | |||
153 | return 0; | 153 | return 0; |
154 | } | 154 | } |
155 | 155 | ||
156 | static int __devinit egalax_firmware_version(struct i2c_client *client) | 156 | static int egalax_firmware_version(struct i2c_client *client) |
157 | { | 157 | { |
158 | static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 }; | 158 | static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 }; |
159 | int ret; | 159 | int ret; |
@@ -165,7 +165,7 @@ static int __devinit egalax_firmware_version(struct i2c_client *client) | |||
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int __devinit egalax_ts_probe(struct i2c_client *client, | 168 | static int egalax_ts_probe(struct i2c_client *client, |
169 | const struct i2c_device_id *id) | 169 | const struct i2c_device_id *id) |
170 | { | 170 | { |
171 | struct egalax_ts *ts; | 171 | struct egalax_ts *ts; |
@@ -246,7 +246,7 @@ err_free_ts: | |||
246 | return error; | 246 | return error; |
247 | } | 247 | } |
248 | 248 | ||
249 | static __devexit int egalax_ts_remove(struct i2c_client *client) | 249 | static int egalax_ts_remove(struct i2c_client *client) |
250 | { | 250 | { |
251 | struct egalax_ts *ts = i2c_get_clientdata(client); | 251 | struct egalax_ts *ts = i2c_get_clientdata(client); |
252 | 252 | ||
@@ -301,7 +301,7 @@ static struct i2c_driver egalax_ts_driver = { | |||
301 | }, | 301 | }, |
302 | .id_table = egalax_ts_id, | 302 | .id_table = egalax_ts_id, |
303 | .probe = egalax_ts_probe, | 303 | .probe = egalax_ts_probe, |
304 | .remove = __devexit_p(egalax_ts_remove), | 304 | .remove = egalax_ts_remove, |
305 | }; | 305 | }; |
306 | 306 | ||
307 | module_i2c_driver(egalax_ts_driver); | 307 | module_i2c_driver(egalax_ts_driver); |
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c deleted file mode 100644 index b9e8686a6f1c..000000000000 --- a/drivers/input/touchscreen/h3600_ts_input.c +++ /dev/null | |||
@@ -1,479 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com | ||
3 | * | ||
4 | * Sponsored by Transvirtual Technology. | ||
5 | * | ||
6 | * Derived from the code in h3600_ts.[ch] by Charles Flynn | ||
7 | */ | ||
8 | |||
9 | /* | ||
10 | * Driver for the h3600 Touch Screen and other Atmel controlled devices. | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License | ||
25 | * along with this program; if not, write to the Free Software | ||
26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
27 | * | ||
28 | * Should you need to contact me, the author, you can do so by | ||
29 | * e-mail - mail your message to <jsimmons@transvirtual.com>. | ||
30 | */ | ||
31 | |||
32 | #include <linux/errno.h> | ||
33 | #include <linux/kernel.h> | ||
34 | #include <linux/module.h> | ||
35 | #include <linux/slab.h> | ||
36 | #include <linux/input.h> | ||
37 | #include <linux/serio.h> | ||
38 | #include <linux/init.h> | ||
39 | #include <linux/delay.h> | ||
40 | |||
41 | /* SA1100 serial defines */ | ||
42 | #include <mach/hardware.h> | ||
43 | #include <mach/irqs.h> | ||
44 | |||
45 | #define DRIVER_DESC "H3600 touchscreen driver" | ||
46 | |||
47 | MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>"); | ||
48 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
49 | MODULE_LICENSE("GPL"); | ||
50 | |||
51 | /* | ||
52 | * Definitions & global arrays. | ||
53 | */ | ||
54 | |||
55 | /* The start and end of frame characters SOF and EOF */ | ||
56 | #define CHAR_SOF 0x02 | ||
57 | #define CHAR_EOF 0x03 | ||
58 | #define FRAME_OVERHEAD 3 /* CHAR_SOF,CHAR_EOF,LENGTH = 3 */ | ||
59 | |||
60 | /* | ||
61 | Atmel events and response IDs contained in frame. | ||
62 | Programmer has no control over these numbers. | ||
63 | TODO there are holes - specifically 1,7,0x0a | ||
64 | */ | ||
65 | #define VERSION_ID 0 /* Get Version (request/response) */ | ||
66 | #define KEYBD_ID 2 /* Keyboard (event) */ | ||
67 | #define TOUCHS_ID 3 /* Touch Screen (event)*/ | ||
68 | #define EEPROM_READ_ID 4 /* (request/response) */ | ||
69 | #define EEPROM_WRITE_ID 5 /* (request/response) */ | ||
70 | #define THERMAL_ID 6 /* (request/response) */ | ||
71 | #define NOTIFY_LED_ID 8 /* (request/response) */ | ||
72 | #define BATTERY_ID 9 /* (request/response) */ | ||
73 | #define SPI_READ_ID 0x0b /* ( request/response) */ | ||
74 | #define SPI_WRITE_ID 0x0c /* ( request/response) */ | ||
75 | #define FLITE_ID 0x0d /* backlight ( request/response) */ | ||
76 | #define STX_ID 0xa1 /* extension pack status (req/resp) */ | ||
77 | |||
78 | #define MAX_ID 14 | ||
79 | |||
80 | #define H3600_MAX_LENGTH 16 | ||
81 | #define H3600_KEY 0xf | ||
82 | |||
83 | #define H3600_SCANCODE_RECORD 1 /* 1 -> record button */ | ||
84 | #define H3600_SCANCODE_CALENDAR 2 /* 2 -> calendar */ | ||
85 | #define H3600_SCANCODE_CONTACTS 3 /* 3 -> contact */ | ||
86 | #define H3600_SCANCODE_Q 4 /* 4 -> Q button */ | ||
87 | #define H3600_SCANCODE_START 5 /* 5 -> start menu */ | ||
88 | #define H3600_SCANCODE_UP 6 /* 6 -> up */ | ||
89 | #define H3600_SCANCODE_RIGHT 7 /* 7 -> right */ | ||
90 | #define H3600_SCANCODE_LEFT 8 /* 8 -> left */ | ||
91 | #define H3600_SCANCODE_DOWN 9 /* 9 -> down */ | ||
92 | |||
93 | /* | ||
94 | * Per-touchscreen data. | ||
95 | */ | ||
96 | struct h3600_dev { | ||
97 | struct input_dev *dev; | ||
98 | struct serio *serio; | ||
99 | unsigned char event; /* event ID from packet */ | ||
100 | unsigned char chksum; | ||
101 | unsigned char len; | ||
102 | unsigned char idx; | ||
103 | unsigned char buf[H3600_MAX_LENGTH]; | ||
104 | char phys[32]; | ||
105 | }; | ||
106 | |||
107 | static irqreturn_t action_button_handler(int irq, void *dev_id) | ||
108 | { | ||
109 | int down = (GPLR & GPIO_BITSY_ACTION_BUTTON) ? 0 : 1; | ||
110 | struct input_dev *dev = dev_id; | ||
111 | |||
112 | input_report_key(dev, KEY_ENTER, down); | ||
113 | input_sync(dev); | ||
114 | |||
115 | return IRQ_HANDLED; | ||
116 | } | ||
117 | |||
118 | static irqreturn_t npower_button_handler(int irq, void *dev_id) | ||
119 | { | ||
120 | int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1; | ||
121 | struct input_dev *dev = dev_id; | ||
122 | |||
123 | /* | ||
124 | * This interrupt is only called when we release the key. So we have | ||
125 | * to fake a key press. | ||
126 | */ | ||
127 | input_report_key(dev, KEY_SUSPEND, 1); | ||
128 | input_report_key(dev, KEY_SUSPEND, down); | ||
129 | input_sync(dev); | ||
130 | |||
131 | return IRQ_HANDLED; | ||
132 | } | ||
133 | |||
134 | #ifdef CONFIG_PM | ||
135 | |||
136 | static int flite_brightness = 25; | ||
137 | |||
138 | enum flite_pwr { | ||
139 | FLITE_PWR_OFF = 0, | ||
140 | FLITE_PWR_ON = 1 | ||
141 | }; | ||
142 | |||
143 | /* | ||
144 | * h3600_flite_power: enables or disables power to frontlight, using last bright */ | ||
145 | unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr) | ||
146 | { | ||
147 | unsigned char brightness = (pwr == FLITE_PWR_OFF) ? 0 : flite_brightness; | ||
148 | struct h3600_dev *ts = input_get_drvdata(dev); | ||
149 | |||
150 | /* Must be in this order */ | ||
151 | serio_write(ts->serio, 1); | ||
152 | serio_write(ts->serio, pwr); | ||
153 | serio_write(ts->serio, brightness); | ||
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | #endif | ||
159 | |||
160 | /* | ||
161 | * This function translates the native event packets to linux input event | ||
162 | * packets. Some packets coming from serial are not touchscreen related. In | ||
163 | * this case we send them off to be processed elsewhere. | ||
164 | */ | ||
165 | static void h3600ts_process_packet(struct h3600_dev *ts) | ||
166 | { | ||
167 | struct input_dev *dev = ts->dev; | ||
168 | static int touched = 0; | ||
169 | int key, down = 0; | ||
170 | |||
171 | switch (ts->event) { | ||
172 | /* | ||
173 | Buttons - returned as a single byte | ||
174 | 7 6 5 4 3 2 1 0 | ||
175 | S x x x N N N N | ||
176 | |||
177 | S switch state ( 0=pressed 1=released) | ||
178 | x Unused. | ||
179 | NNNN switch number 0-15 | ||
180 | |||
181 | Note: This is true for non interrupt generated key events. | ||
182 | */ | ||
183 | case KEYBD_ID: | ||
184 | down = (ts->buf[0] & 0x80) ? 0 : 1; | ||
185 | |||
186 | switch (ts->buf[0] & 0x7f) { | ||
187 | case H3600_SCANCODE_RECORD: | ||
188 | key = KEY_RECORD; | ||
189 | break; | ||
190 | case H3600_SCANCODE_CALENDAR: | ||
191 | key = KEY_PROG1; | ||
192 | break; | ||
193 | case H3600_SCANCODE_CONTACTS: | ||
194 | key = KEY_PROG2; | ||
195 | break; | ||
196 | case H3600_SCANCODE_Q: | ||
197 | key = KEY_Q; | ||
198 | break; | ||
199 | case H3600_SCANCODE_START: | ||
200 | key = KEY_PROG3; | ||
201 | break; | ||
202 | case H3600_SCANCODE_UP: | ||
203 | key = KEY_UP; | ||
204 | break; | ||
205 | case H3600_SCANCODE_RIGHT: | ||
206 | key = KEY_RIGHT; | ||
207 | break; | ||
208 | case H3600_SCANCODE_LEFT: | ||
209 | key = KEY_LEFT; | ||
210 | break; | ||
211 | case H3600_SCANCODE_DOWN: | ||
212 | key = KEY_DOWN; | ||
213 | break; | ||
214 | default: | ||
215 | key = 0; | ||
216 | } | ||
217 | if (key) | ||
218 | input_report_key(dev, key, down); | ||
219 | break; | ||
220 | /* | ||
221 | * Native touchscreen event data is formatted as shown below:- | ||
222 | * | ||
223 | * +-------+-------+-------+-------+ | ||
224 | * | Xmsb | Xlsb | Ymsb | Ylsb | | ||
225 | * +-------+-------+-------+-------+ | ||
226 | * byte 0 1 2 3 | ||
227 | */ | ||
228 | case TOUCHS_ID: | ||
229 | if (!touched) { | ||
230 | input_report_key(dev, BTN_TOUCH, 1); | ||
231 | touched = 1; | ||
232 | } | ||
233 | |||
234 | if (ts->len) { | ||
235 | unsigned short x, y; | ||
236 | |||
237 | x = ts->buf[0]; x <<= 8; x += ts->buf[1]; | ||
238 | y = ts->buf[2]; y <<= 8; y += ts->buf[3]; | ||
239 | |||
240 | input_report_abs(dev, ABS_X, x); | ||
241 | input_report_abs(dev, ABS_Y, y); | ||
242 | } else { | ||
243 | input_report_key(dev, BTN_TOUCH, 0); | ||
244 | touched = 0; | ||
245 | } | ||
246 | break; | ||
247 | default: | ||
248 | /* Send a non input event elsewhere */ | ||
249 | break; | ||
250 | } | ||
251 | |||
252 | input_sync(dev); | ||
253 | } | ||
254 | |||
255 | /* | ||
256 | * h3600ts_event() handles events from the input module. | ||
257 | */ | ||
258 | static int h3600ts_event(struct input_dev *dev, unsigned int type, | ||
259 | unsigned int code, int value) | ||
260 | { | ||
261 | #if 0 | ||
262 | struct h3600_dev *ts = input_get_drvdata(dev); | ||
263 | |||
264 | switch (type) { | ||
265 | case EV_LED: { | ||
266 | // serio_write(ts->serio, SOME_CMD); | ||
267 | return 0; | ||
268 | } | ||
269 | } | ||
270 | return -1; | ||
271 | #endif | ||
272 | return 0; | ||
273 | } | ||
274 | |||
275 | /* | ||
276 | Frame format | ||
277 | byte 1 2 3 len + 4 | ||
278 | +-------+---------------+---------------+--=------------+ | ||
279 | |SOF |id |len | len bytes | Chksum | | ||
280 | +-------+---------------+---------------+--=------------+ | ||
281 | bit 0 7 8 11 12 15 16 | ||
282 | |||
283 | +-------+---------------+-------+ | ||
284 | |SOF |id |0 |Chksum | - Note Chksum does not include SOF | ||
285 | +-------+---------------+-------+ | ||
286 | bit 0 7 8 11 12 15 16 | ||
287 | |||
288 | */ | ||
289 | |||
290 | static int state; | ||
291 | |||
292 | /* decode States */ | ||
293 | #define STATE_SOF 0 /* start of FRAME */ | ||
294 | #define STATE_ID 1 /* state where we decode the ID & len */ | ||
295 | #define STATE_DATA 2 /* state where we decode data */ | ||
296 | #define STATE_EOF 3 /* state where we decode checksum or EOF */ | ||
297 | |||
298 | static irqreturn_t h3600ts_interrupt(struct serio *serio, unsigned char data, | ||
299 | unsigned int flags) | ||
300 | { | ||
301 | struct h3600_dev *ts = serio_get_drvdata(serio); | ||
302 | |||
303 | /* | ||
304 | * We have a new frame coming in. | ||
305 | */ | ||
306 | switch (state) { | ||
307 | case STATE_SOF: | ||
308 | if (data == CHAR_SOF) | ||
309 | state = STATE_ID; | ||
310 | break; | ||
311 | case STATE_ID: | ||
312 | ts->event = (data & 0xf0) >> 4; | ||
313 | ts->len = (data & 0xf); | ||
314 | ts->idx = 0; | ||
315 | if (ts->event >= MAX_ID) { | ||
316 | state = STATE_SOF; | ||
317 | break; | ||
318 | } | ||
319 | ts->chksum = data; | ||
320 | state = (ts->len > 0) ? STATE_DATA : STATE_EOF; | ||
321 | break; | ||
322 | case STATE_DATA: | ||
323 | ts->chksum += data; | ||
324 | ts->buf[ts->idx]= data; | ||
325 | if (++ts->idx == ts->len) | ||
326 | state = STATE_EOF; | ||
327 | break; | ||
328 | case STATE_EOF: | ||
329 | state = STATE_SOF; | ||
330 | if (data == CHAR_EOF || data == ts->chksum) | ||
331 | h3600ts_process_packet(ts); | ||
332 | break; | ||
333 | default: | ||
334 | printk("Error3\n"); | ||
335 | break; | ||
336 | } | ||
337 | |||
338 | return IRQ_HANDLED; | ||
339 | } | ||
340 | |||
341 | /* | ||
342 | * h3600ts_connect() is the routine that is called when someone adds a | ||
343 | * new serio device that supports H3600 protocol and registers it as | ||
344 | * an input device. | ||
345 | */ | ||
346 | static int h3600ts_connect(struct serio *serio, struct serio_driver *drv) | ||
347 | { | ||
348 | struct h3600_dev *ts; | ||
349 | struct input_dev *input_dev; | ||
350 | int err; | ||
351 | |||
352 | ts = kzalloc(sizeof(struct h3600_dev), GFP_KERNEL); | ||
353 | input_dev = input_allocate_device(); | ||
354 | if (!ts || !input_dev) { | ||
355 | err = -ENOMEM; | ||
356 | goto fail1; | ||
357 | } | ||
358 | |||
359 | ts->serio = serio; | ||
360 | ts->dev = input_dev; | ||
361 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", serio->phys); | ||
362 | |||
363 | input_dev->name = "H3600 TouchScreen"; | ||
364 | input_dev->phys = ts->phys; | ||
365 | input_dev->id.bustype = BUS_RS232; | ||
366 | input_dev->id.vendor = SERIO_H3600; | ||
367 | input_dev->id.product = 0x0666; /* FIXME !!! We can ask the hardware */ | ||
368 | input_dev->id.version = 0x0100; | ||
369 | input_dev->dev.parent = &serio->dev; | ||
370 | |||
371 | input_set_drvdata(input_dev, ts); | ||
372 | |||
373 | input_dev->event = h3600ts_event; | ||
374 | |||
375 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | | ||
376 | BIT_MASK(EV_LED) | BIT_MASK(EV_PWR); | ||
377 | input_dev->ledbit[0] = BIT_MASK(LED_SLEEP); | ||
378 | input_set_abs_params(input_dev, ABS_X, 60, 985, 0, 0); | ||
379 | input_set_abs_params(input_dev, ABS_Y, 35, 1024, 0, 0); | ||
380 | |||
381 | set_bit(KEY_RECORD, input_dev->keybit); | ||
382 | set_bit(KEY_Q, input_dev->keybit); | ||
383 | set_bit(KEY_PROG1, input_dev->keybit); | ||
384 | set_bit(KEY_PROG2, input_dev->keybit); | ||
385 | set_bit(KEY_PROG3, input_dev->keybit); | ||
386 | set_bit(KEY_UP, input_dev->keybit); | ||
387 | set_bit(KEY_RIGHT, input_dev->keybit); | ||
388 | set_bit(KEY_LEFT, input_dev->keybit); | ||
389 | set_bit(KEY_DOWN, input_dev->keybit); | ||
390 | set_bit(KEY_ENTER, input_dev->keybit); | ||
391 | set_bit(KEY_SUSPEND, input_dev->keybit); | ||
392 | set_bit(BTN_TOUCH, input_dev->keybit); | ||
393 | |||
394 | /* Device specific stuff */ | ||
395 | set_GPIO_IRQ_edge(GPIO_BITSY_ACTION_BUTTON, GPIO_BOTH_EDGES); | ||
396 | set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE); | ||
397 | |||
398 | if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler, | ||
399 | IRQF_SHARED, "h3600_action", ts->dev)) { | ||
400 | printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n"); | ||
401 | err = -EBUSY; | ||
402 | goto fail1; | ||
403 | } | ||
404 | |||
405 | if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler, | ||
406 | IRQF_SHARED, "h3600_suspend", ts->dev)) { | ||
407 | printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n"); | ||
408 | err = -EBUSY; | ||
409 | goto fail2; | ||
410 | } | ||
411 | |||
412 | serio_set_drvdata(serio, ts); | ||
413 | |||
414 | err = serio_open(serio, drv); | ||
415 | if (err) | ||
416 | goto fail3; | ||
417 | |||
418 | //h3600_flite_control(1, 25); /* default brightness */ | ||
419 | err = input_register_device(ts->dev); | ||
420 | if (err) | ||
421 | goto fail4; | ||
422 | |||
423 | return 0; | ||
424 | |||
425 | fail4: serio_close(serio); | ||
426 | fail3: serio_set_drvdata(serio, NULL); | ||
427 | free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev); | ||
428 | fail2: free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev); | ||
429 | fail1: input_free_device(input_dev); | ||
430 | kfree(ts); | ||
431 | return err; | ||
432 | } | ||
433 | |||
434 | /* | ||
435 | * h3600ts_disconnect() is the opposite of h3600ts_connect() | ||
436 | */ | ||
437 | |||
438 | static void h3600ts_disconnect(struct serio *serio) | ||
439 | { | ||
440 | struct h3600_dev *ts = serio_get_drvdata(serio); | ||
441 | |||
442 | free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev); | ||
443 | free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev); | ||
444 | input_get_device(ts->dev); | ||
445 | input_unregister_device(ts->dev); | ||
446 | serio_close(serio); | ||
447 | serio_set_drvdata(serio, NULL); | ||
448 | input_put_device(ts->dev); | ||
449 | kfree(ts); | ||
450 | } | ||
451 | |||
452 | /* | ||
453 | * The serio driver structure. | ||
454 | */ | ||
455 | |||
456 | static struct serio_device_id h3600ts_serio_ids[] = { | ||
457 | { | ||
458 | .type = SERIO_RS232, | ||
459 | .proto = SERIO_H3600, | ||
460 | .id = SERIO_ANY, | ||
461 | .extra = SERIO_ANY, | ||
462 | }, | ||
463 | { 0 } | ||
464 | }; | ||
465 | |||
466 | MODULE_DEVICE_TABLE(serio, h3600ts_serio_ids); | ||
467 | |||
468 | static struct serio_driver h3600ts_drv = { | ||
469 | .driver = { | ||
470 | .name = "h3600ts", | ||
471 | }, | ||
472 | .description = DRIVER_DESC, | ||
473 | .id_table = h3600ts_serio_ids, | ||
474 | .interrupt = h3600ts_interrupt, | ||
475 | .connect = h3600ts_connect, | ||
476 | .disconnect = h3600ts_disconnect, | ||
477 | }; | ||
478 | |||
479 | module_serio_driver(h3600ts_drv); | ||
diff --git a/drivers/input/touchscreen/htcpen.c b/drivers/input/touchscreen/htcpen.c index d13143b68b3e..6c4fb8436957 100644 --- a/drivers/input/touchscreen/htcpen.c +++ b/drivers/input/touchscreen/htcpen.c | |||
@@ -102,7 +102,7 @@ static void htcpen_close(struct input_dev *dev) | |||
102 | synchronize_irq(HTCPEN_IRQ); | 102 | synchronize_irq(HTCPEN_IRQ); |
103 | } | 103 | } |
104 | 104 | ||
105 | static int __devinit htcpen_isa_probe(struct device *dev, unsigned int id) | 105 | static int htcpen_isa_probe(struct device *dev, unsigned int id) |
106 | { | 106 | { |
107 | struct input_dev *htcpen_dev; | 107 | struct input_dev *htcpen_dev; |
108 | int err = -EBUSY; | 108 | int err = -EBUSY; |
@@ -174,7 +174,7 @@ static int __devinit htcpen_isa_probe(struct device *dev, unsigned int id) | |||
174 | return err; | 174 | return err; |
175 | } | 175 | } |
176 | 176 | ||
177 | static int __devexit htcpen_isa_remove(struct device *dev, unsigned int id) | 177 | static int htcpen_isa_remove(struct device *dev, unsigned int id) |
178 | { | 178 | { |
179 | struct input_dev *htcpen_dev = dev_get_drvdata(dev); | 179 | struct input_dev *htcpen_dev = dev_get_drvdata(dev); |
180 | 180 | ||
@@ -210,7 +210,7 @@ static int htcpen_isa_resume(struct device *dev, unsigned int n) | |||
210 | 210 | ||
211 | static struct isa_driver htcpen_isa_driver = { | 211 | static struct isa_driver htcpen_isa_driver = { |
212 | .probe = htcpen_isa_probe, | 212 | .probe = htcpen_isa_probe, |
213 | .remove = __devexit_p(htcpen_isa_remove), | 213 | .remove = htcpen_isa_remove, |
214 | #ifdef CONFIG_PM | 214 | #ifdef CONFIG_PM |
215 | .suspend = htcpen_isa_suspend, | 215 | .suspend = htcpen_isa_suspend, |
216 | .resume = htcpen_isa_resume, | 216 | .resume = htcpen_isa_resume, |
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index 4ac69760ec08..1418bdda61bb 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c | |||
@@ -180,7 +180,7 @@ static const struct attribute_group ili210x_attr_group = { | |||
180 | .attrs = ili210x_attributes, | 180 | .attrs = ili210x_attributes, |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static int __devinit ili210x_i2c_probe(struct i2c_client *client, | 183 | static int ili210x_i2c_probe(struct i2c_client *client, |
184 | const struct i2c_device_id *id) | 184 | const struct i2c_device_id *id) |
185 | { | 185 | { |
186 | struct device *dev = &client->dev; | 186 | struct device *dev = &client->dev; |
@@ -298,7 +298,7 @@ err_free_mem: | |||
298 | return error; | 298 | return error; |
299 | } | 299 | } |
300 | 300 | ||
301 | static int __devexit ili210x_i2c_remove(struct i2c_client *client) | 301 | static int ili210x_i2c_remove(struct i2c_client *client) |
302 | { | 302 | { |
303 | struct ili210x *priv = i2c_get_clientdata(client); | 303 | struct ili210x *priv = i2c_get_clientdata(client); |
304 | 304 | ||
@@ -350,7 +350,7 @@ static struct i2c_driver ili210x_ts_driver = { | |||
350 | }, | 350 | }, |
351 | .id_table = ili210x_i2c_id, | 351 | .id_table = ili210x_i2c_id, |
352 | .probe = ili210x_i2c_probe, | 352 | .probe = ili210x_i2c_probe, |
353 | .remove = __devexit_p(ili210x_i2c_remove), | 353 | .remove = ili210x_i2c_remove, |
354 | }; | 354 | }; |
355 | 355 | ||
356 | module_i2c_driver(ili210x_ts_driver); | 356 | module_i2c_driver(ili210x_ts_driver); |
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c index cf299377fc49..465db5dba8b4 100644 --- a/drivers/input/touchscreen/intel-mid-touch.c +++ b/drivers/input/touchscreen/intel-mid-touch.c | |||
@@ -427,7 +427,7 @@ out: | |||
427 | } | 427 | } |
428 | 428 | ||
429 | /* Utility to read PMIC ID */ | 429 | /* Utility to read PMIC ID */ |
430 | static int __devinit mrstouch_read_pmic_id(uint *vendor, uint *rev) | 430 | static int mrstouch_read_pmic_id(uint *vendor, uint *rev) |
431 | { | 431 | { |
432 | int err; | 432 | int err; |
433 | u8 r; | 433 | u8 r; |
@@ -446,7 +446,7 @@ static int __devinit mrstouch_read_pmic_id(uint *vendor, uint *rev) | |||
446 | * Parse ADC channels to find end of the channel configured by other ADC user | 446 | * Parse ADC channels to find end of the channel configured by other ADC user |
447 | * NEC and MAXIM requires 4 channels and FreeScale needs 18 channels | 447 | * NEC and MAXIM requires 4 channels and FreeScale needs 18 channels |
448 | */ | 448 | */ |
449 | static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) | 449 | static int mrstouch_chan_parse(struct mrstouch_dev *tsdev) |
450 | { | 450 | { |
451 | int found = 0; | 451 | int found = 0; |
452 | int err, i; | 452 | int err, i; |
@@ -478,7 +478,7 @@ static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) | |||
478 | /* | 478 | /* |
479 | * Writes touch screen channels to ADC address selection registers | 479 | * Writes touch screen channels to ADC address selection registers |
480 | */ | 480 | */ |
481 | static int __devinit mrstouch_ts_chan_set(uint offset) | 481 | static int mrstouch_ts_chan_set(uint offset) |
482 | { | 482 | { |
483 | u16 chan; | 483 | u16 chan; |
484 | 484 | ||
@@ -494,7 +494,7 @@ static int __devinit mrstouch_ts_chan_set(uint offset) | |||
494 | } | 494 | } |
495 | 495 | ||
496 | /* Initialize ADC */ | 496 | /* Initialize ADC */ |
497 | static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev) | 497 | static int mrstouch_adc_init(struct mrstouch_dev *tsdev) |
498 | { | 498 | { |
499 | int err, start; | 499 | int err, start; |
500 | u8 ra, rm; | 500 | u8 ra, rm; |
@@ -568,7 +568,7 @@ static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev) | |||
568 | 568 | ||
569 | 569 | ||
570 | /* Probe function for touch screen driver */ | 570 | /* Probe function for touch screen driver */ |
571 | static int __devinit mrstouch_probe(struct platform_device *pdev) | 571 | static int mrstouch_probe(struct platform_device *pdev) |
572 | { | 572 | { |
573 | struct mrstouch_dev *tsdev; | 573 | struct mrstouch_dev *tsdev; |
574 | struct input_dev *input; | 574 | struct input_dev *input; |
@@ -643,7 +643,7 @@ err_free_mem: | |||
643 | return err; | 643 | return err; |
644 | } | 644 | } |
645 | 645 | ||
646 | static int __devexit mrstouch_remove(struct platform_device *pdev) | 646 | static int mrstouch_remove(struct platform_device *pdev) |
647 | { | 647 | { |
648 | struct mrstouch_dev *tsdev = platform_get_drvdata(pdev); | 648 | struct mrstouch_dev *tsdev = platform_get_drvdata(pdev); |
649 | 649 | ||
@@ -662,7 +662,7 @@ static struct platform_driver mrstouch_driver = { | |||
662 | .owner = THIS_MODULE, | 662 | .owner = THIS_MODULE, |
663 | }, | 663 | }, |
664 | .probe = mrstouch_probe, | 664 | .probe = mrstouch_probe, |
665 | .remove = __devexit_p(mrstouch_remove), | 665 | .remove = mrstouch_remove, |
666 | }; | 666 | }; |
667 | module_platform_driver(mrstouch_driver); | 667 | module_platform_driver(mrstouch_driver); |
668 | 668 | ||
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c index 7f03d1bd916e..282d7c7ad2fc 100644 --- a/drivers/input/touchscreen/jornada720_ts.c +++ b/drivers/input/touchscreen/jornada720_ts.c | |||
@@ -99,7 +99,7 @@ static irqreturn_t jornada720_ts_interrupt(int irq, void *dev_id) | |||
99 | return IRQ_HANDLED; | 99 | return IRQ_HANDLED; |
100 | } | 100 | } |
101 | 101 | ||
102 | static int __devinit jornada720_ts_probe(struct platform_device *pdev) | 102 | static int jornada720_ts_probe(struct platform_device *pdev) |
103 | { | 103 | { |
104 | struct jornada_ts *jornada_ts; | 104 | struct jornada_ts *jornada_ts; |
105 | struct input_dev *input_dev; | 105 | struct input_dev *input_dev; |
@@ -151,7 +151,7 @@ static int __devinit jornada720_ts_probe(struct platform_device *pdev) | |||
151 | return error; | 151 | return error; |
152 | } | 152 | } |
153 | 153 | ||
154 | static int __devexit jornada720_ts_remove(struct platform_device *pdev) | 154 | static int jornada720_ts_remove(struct platform_device *pdev) |
155 | { | 155 | { |
156 | struct jornada_ts *jornada_ts = platform_get_drvdata(pdev); | 156 | struct jornada_ts *jornada_ts = platform_get_drvdata(pdev); |
157 | 157 | ||
@@ -168,7 +168,7 @@ MODULE_ALIAS("platform:jornada_ts"); | |||
168 | 168 | ||
169 | static struct platform_driver jornada720_ts_driver = { | 169 | static struct platform_driver jornada720_ts_driver = { |
170 | .probe = jornada720_ts_probe, | 170 | .probe = jornada720_ts_probe, |
171 | .remove = __devexit_p(jornada720_ts_remove), | 171 | .remove = jornada720_ts_remove, |
172 | .driver = { | 172 | .driver = { |
173 | .name = "jornada_ts", | 173 | .name = "jornada_ts", |
174 | .owner = THIS_MODULE, | 174 | .owner = THIS_MODULE, |
diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c index 4c2b8ed3bf16..9101ee529c92 100644 --- a/drivers/input/touchscreen/lpc32xx_ts.c +++ b/drivers/input/touchscreen/lpc32xx_ts.c | |||
@@ -203,7 +203,7 @@ static void lpc32xx_ts_close(struct input_dev *dev) | |||
203 | lpc32xx_stop_tsc(tsc); | 203 | lpc32xx_stop_tsc(tsc); |
204 | } | 204 | } |
205 | 205 | ||
206 | static int __devinit lpc32xx_ts_probe(struct platform_device *pdev) | 206 | static int lpc32xx_ts_probe(struct platform_device *pdev) |
207 | { | 207 | { |
208 | struct lpc32xx_tsc *tsc; | 208 | struct lpc32xx_tsc *tsc; |
209 | struct input_dev *input; | 209 | struct input_dev *input; |
@@ -309,7 +309,7 @@ err_free_mem: | |||
309 | return error; | 309 | return error; |
310 | } | 310 | } |
311 | 311 | ||
312 | static int __devexit lpc32xx_ts_remove(struct platform_device *pdev) | 312 | static int lpc32xx_ts_remove(struct platform_device *pdev) |
313 | { | 313 | { |
314 | struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev); | 314 | struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev); |
315 | struct resource *res; | 315 | struct resource *res; |
@@ -394,7 +394,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_tsc_of_match); | |||
394 | 394 | ||
395 | static struct platform_driver lpc32xx_ts_driver = { | 395 | static struct platform_driver lpc32xx_ts_driver = { |
396 | .probe = lpc32xx_ts_probe, | 396 | .probe = lpc32xx_ts_probe, |
397 | .remove = __devexit_p(lpc32xx_ts_remove), | 397 | .remove = lpc32xx_ts_remove, |
398 | .driver = { | 398 | .driver = { |
399 | .name = MOD_NAME, | 399 | .name = MOD_NAME, |
400 | .owner = THIS_MODULE, | 400 | .owner = THIS_MODULE, |
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c index 4eab50b856d7..00bc6caa27f5 100644 --- a/drivers/input/touchscreen/max11801_ts.c +++ b/drivers/input/touchscreen/max11801_ts.c | |||
@@ -156,7 +156,7 @@ out: | |||
156 | return IRQ_HANDLED; | 156 | return IRQ_HANDLED; |
157 | } | 157 | } |
158 | 158 | ||
159 | static void __devinit max11801_ts_phy_init(struct max11801_data *data) | 159 | static void max11801_ts_phy_init(struct max11801_data *data) |
160 | { | 160 | { |
161 | struct i2c_client *client = data->client; | 161 | struct i2c_client *client = data->client; |
162 | 162 | ||
@@ -174,7 +174,7 @@ static void __devinit max11801_ts_phy_init(struct max11801_data *data) | |||
174 | max11801_write_reg(client, OP_MODE_CONF_REG, 0x36); | 174 | max11801_write_reg(client, OP_MODE_CONF_REG, 0x36); |
175 | } | 175 | } |
176 | 176 | ||
177 | static int __devinit max11801_ts_probe(struct i2c_client *client, | 177 | static int max11801_ts_probe(struct i2c_client *client, |
178 | const struct i2c_device_id *id) | 178 | const struct i2c_device_id *id) |
179 | { | 179 | { |
180 | struct max11801_data *data; | 180 | struct max11801_data *data; |
@@ -228,7 +228,7 @@ err_free_mem: | |||
228 | return error; | 228 | return error; |
229 | } | 229 | } |
230 | 230 | ||
231 | static __devexit int max11801_ts_remove(struct i2c_client *client) | 231 | static int max11801_ts_remove(struct i2c_client *client) |
232 | { | 232 | { |
233 | struct max11801_data *data = i2c_get_clientdata(client); | 233 | struct max11801_data *data = i2c_get_clientdata(client); |
234 | 234 | ||
@@ -252,7 +252,7 @@ static struct i2c_driver max11801_ts_driver = { | |||
252 | }, | 252 | }, |
253 | .id_table = max11801_ts_id, | 253 | .id_table = max11801_ts_id, |
254 | .probe = max11801_ts_probe, | 254 | .probe = max11801_ts_probe, |
255 | .remove = __devexit_p(max11801_ts_remove), | 255 | .remove = max11801_ts_remove, |
256 | }; | 256 | }; |
257 | 257 | ||
258 | module_i2c_driver(max11801_ts_driver); | 258 | module_i2c_driver(max11801_ts_driver); |
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index 48dc5b0d26f1..02103b6abb39 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c | |||
@@ -229,7 +229,7 @@ err_free_mem: | |||
229 | return ret; | 229 | return ret; |
230 | } | 230 | } |
231 | 231 | ||
232 | static int __devexit mc13783_ts_remove(struct platform_device *pdev) | 232 | static int mc13783_ts_remove(struct platform_device *pdev) |
233 | { | 233 | { |
234 | struct mc13783_ts_priv *priv = platform_get_drvdata(pdev); | 234 | struct mc13783_ts_priv *priv = platform_get_drvdata(pdev); |
235 | 235 | ||
@@ -243,7 +243,7 @@ static int __devexit mc13783_ts_remove(struct platform_device *pdev) | |||
243 | } | 243 | } |
244 | 244 | ||
245 | static struct platform_driver mc13783_ts_driver = { | 245 | static struct platform_driver mc13783_ts_driver = { |
246 | .remove = __devexit_p(mc13783_ts_remove), | 246 | .remove = mc13783_ts_remove, |
247 | .driver = { | 247 | .driver = { |
248 | .owner = THIS_MODULE, | 248 | .owner = THIS_MODULE, |
249 | .name = MC13783_TS_NAME, | 249 | .name = MC13783_TS_NAME, |
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c index b528511861ce..f9f4e0c56eda 100644 --- a/drivers/input/touchscreen/mcs5000_ts.c +++ b/drivers/input/touchscreen/mcs5000_ts.c | |||
@@ -187,7 +187,7 @@ static void mcs5000_ts_phys_init(struct mcs5000_ts_data *data) | |||
187 | OP_MODE_ACTIVE | REPORT_RATE_80); | 187 | OP_MODE_ACTIVE | REPORT_RATE_80); |
188 | } | 188 | } |
189 | 189 | ||
190 | static int __devinit mcs5000_ts_probe(struct i2c_client *client, | 190 | static int mcs5000_ts_probe(struct i2c_client *client, |
191 | const struct i2c_device_id *id) | 191 | const struct i2c_device_id *id) |
192 | { | 192 | { |
193 | struct mcs5000_ts_data *data; | 193 | struct mcs5000_ts_data *data; |
@@ -249,7 +249,7 @@ err_free_mem: | |||
249 | return ret; | 249 | return ret; |
250 | } | 250 | } |
251 | 251 | ||
252 | static int __devexit mcs5000_ts_remove(struct i2c_client *client) | 252 | static int mcs5000_ts_remove(struct i2c_client *client) |
253 | { | 253 | { |
254 | struct mcs5000_ts_data *data = i2c_get_clientdata(client); | 254 | struct mcs5000_ts_data *data = i2c_get_clientdata(client); |
255 | 255 | ||
@@ -292,7 +292,7 @@ MODULE_DEVICE_TABLE(i2c, mcs5000_ts_id); | |||
292 | 292 | ||
293 | static struct i2c_driver mcs5000_ts_driver = { | 293 | static struct i2c_driver mcs5000_ts_driver = { |
294 | .probe = mcs5000_ts_probe, | 294 | .probe = mcs5000_ts_probe, |
295 | .remove = __devexit_p(mcs5000_ts_remove), | 295 | .remove = mcs5000_ts_remove, |
296 | .driver = { | 296 | .driver = { |
297 | .name = "mcs5000_ts", | 297 | .name = "mcs5000_ts", |
298 | #ifdef CONFIG_PM | 298 | #ifdef CONFIG_PM |
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 560cf09d1c5a..98841d8aa635 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
13 | #include <linux/of.h> | ||
13 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
14 | #include <linux/i2c/mms114.h> | 15 | #include <linux/i2c/mms114.h> |
15 | #include <linux/input/mt.h> | 16 | #include <linux/input/mt.h> |
@@ -360,14 +361,63 @@ static void mms114_input_close(struct input_dev *dev) | |||
360 | mms114_stop(data); | 361 | mms114_stop(data); |
361 | } | 362 | } |
362 | 363 | ||
363 | static int __devinit mms114_probe(struct i2c_client *client, | 364 | #ifdef CONFIG_OF |
365 | static struct mms114_platform_data *mms114_parse_dt(struct device *dev) | ||
366 | { | ||
367 | struct mms114_platform_data *pdata; | ||
368 | struct device_node *np = dev->of_node; | ||
369 | |||
370 | if (!np) | ||
371 | return NULL; | ||
372 | |||
373 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); | ||
374 | if (!pdata) { | ||
375 | dev_err(dev, "failed to allocate platform data\n"); | ||
376 | return NULL; | ||
377 | } | ||
378 | |||
379 | if (of_property_read_u32(np, "x-size", &pdata->x_size)) { | ||
380 | dev_err(dev, "failed to get x-size property\n"); | ||
381 | return NULL; | ||
382 | }; | ||
383 | |||
384 | if (of_property_read_u32(np, "y-size", &pdata->y_size)) { | ||
385 | dev_err(dev, "failed to get y-size property\n"); | ||
386 | return NULL; | ||
387 | }; | ||
388 | |||
389 | of_property_read_u32(np, "contact-threshold", | ||
390 | &pdata->contact_threshold); | ||
391 | of_property_read_u32(np, "moving-threshold", | ||
392 | &pdata->moving_threshold); | ||
393 | |||
394 | if (of_find_property(np, "x-invert", NULL)) | ||
395 | pdata->x_invert = true; | ||
396 | if (of_find_property(np, "y-invert", NULL)) | ||
397 | pdata->y_invert = true; | ||
398 | |||
399 | return pdata; | ||
400 | } | ||
401 | #else | ||
402 | static inline struct mms114_platform_data *mms114_parse_dt(struct device *dev) | ||
403 | { | ||
404 | return NULL; | ||
405 | } | ||
406 | #endif | ||
407 | |||
408 | static int mms114_probe(struct i2c_client *client, | ||
364 | const struct i2c_device_id *id) | 409 | const struct i2c_device_id *id) |
365 | { | 410 | { |
411 | const struct mms114_platform_data *pdata; | ||
366 | struct mms114_data *data; | 412 | struct mms114_data *data; |
367 | struct input_dev *input_dev; | 413 | struct input_dev *input_dev; |
368 | int error; | 414 | int error; |
369 | 415 | ||
370 | if (!client->dev.platform_data) { | 416 | pdata = dev_get_platdata(&client->dev); |
417 | if (!pdata) | ||
418 | pdata = mms114_parse_dt(&client->dev); | ||
419 | |||
420 | if (!pdata) { | ||
371 | dev_err(&client->dev, "Need platform data\n"); | 421 | dev_err(&client->dev, "Need platform data\n"); |
372 | return -EINVAL; | 422 | return -EINVAL; |
373 | } | 423 | } |
@@ -389,7 +439,7 @@ static int __devinit mms114_probe(struct i2c_client *client, | |||
389 | 439 | ||
390 | data->client = client; | 440 | data->client = client; |
391 | data->input_dev = input_dev; | 441 | data->input_dev = input_dev; |
392 | data->pdata = client->dev.platform_data; | 442 | data->pdata = pdata; |
393 | 443 | ||
394 | input_dev->name = "MELPAS MMS114 Touchscreen"; | 444 | input_dev->name = "MELPAS MMS114 Touchscreen"; |
395 | input_dev->id.bustype = BUS_I2C; | 445 | input_dev->id.bustype = BUS_I2C; |
@@ -458,7 +508,7 @@ err_free_mem: | |||
458 | return error; | 508 | return error; |
459 | } | 509 | } |
460 | 510 | ||
461 | static int __devexit mms114_remove(struct i2c_client *client) | 511 | static int mms114_remove(struct i2c_client *client) |
462 | { | 512 | { |
463 | struct mms114_data *data = i2c_get_clientdata(client); | 513 | struct mms114_data *data = i2c_get_clientdata(client); |
464 | 514 | ||
@@ -525,14 +575,22 @@ static const struct i2c_device_id mms114_id[] = { | |||
525 | }; | 575 | }; |
526 | MODULE_DEVICE_TABLE(i2c, mms114_id); | 576 | MODULE_DEVICE_TABLE(i2c, mms114_id); |
527 | 577 | ||
578 | #ifdef CONFIG_OF | ||
579 | static struct of_device_id mms114_dt_match[] = { | ||
580 | { .compatible = "melfas,mms114" }, | ||
581 | { } | ||
582 | }; | ||
583 | #endif | ||
584 | |||
528 | static struct i2c_driver mms114_driver = { | 585 | static struct i2c_driver mms114_driver = { |
529 | .driver = { | 586 | .driver = { |
530 | .name = "mms114", | 587 | .name = "mms114", |
531 | .owner = THIS_MODULE, | 588 | .owner = THIS_MODULE, |
532 | .pm = &mms114_pm_ops, | 589 | .pm = &mms114_pm_ops, |
590 | .of_match_table = of_match_ptr(mms114_dt_match), | ||
533 | }, | 591 | }, |
534 | .probe = mms114_probe, | 592 | .probe = mms114_probe, |
535 | .remove = __devexit_p(mms114_remove), | 593 | .remove = mms114_remove, |
536 | .id_table = mms114_id, | 594 | .id_table = mms114_id, |
537 | }; | 595 | }; |
538 | 596 | ||
diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c index f57aeb80f7e3..f22e04dd4e16 100644 --- a/drivers/input/touchscreen/pcap_ts.c +++ b/drivers/input/touchscreen/pcap_ts.c | |||
@@ -137,7 +137,7 @@ static void pcap_ts_close(struct input_dev *dev) | |||
137 | pcap_ts->read_state << PCAP_ADC_TS_M_SHIFT); | 137 | pcap_ts->read_state << PCAP_ADC_TS_M_SHIFT); |
138 | } | 138 | } |
139 | 139 | ||
140 | static int __devinit pcap_ts_probe(struct platform_device *pdev) | 140 | static int pcap_ts_probe(struct platform_device *pdev) |
141 | { | 141 | { |
142 | struct input_dev *input_dev; | 142 | struct input_dev *input_dev; |
143 | struct pcap_ts *pcap_ts; | 143 | struct pcap_ts *pcap_ts; |
@@ -202,7 +202,7 @@ fail: | |||
202 | return err; | 202 | return err; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int __devexit pcap_ts_remove(struct platform_device *pdev) | 205 | static int pcap_ts_remove(struct platform_device *pdev) |
206 | { | 206 | { |
207 | struct pcap_ts *pcap_ts = platform_get_drvdata(pdev); | 207 | struct pcap_ts *pcap_ts = platform_get_drvdata(pdev); |
208 | 208 | ||
@@ -245,7 +245,7 @@ static const struct dev_pm_ops pcap_ts_pm_ops = { | |||
245 | 245 | ||
246 | static struct platform_driver pcap_ts_driver = { | 246 | static struct platform_driver pcap_ts_driver = { |
247 | .probe = pcap_ts_probe, | 247 | .probe = pcap_ts_probe, |
248 | .remove = __devexit_p(pcap_ts_remove), | 248 | .remove = pcap_ts_remove, |
249 | .driver = { | 249 | .driver = { |
250 | .name = "pcap-ts", | 250 | .name = "pcap-ts", |
251 | .owner = THIS_MODULE, | 251 | .owner = THIS_MODULE, |
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 953b4c105cad..6cc6b36663ff 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c | |||
@@ -125,7 +125,7 @@ static int pixcir_i2c_ts_resume(struct device *dev) | |||
125 | static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, | 125 | static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, |
126 | pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); | 126 | pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); |
127 | 127 | ||
128 | static int __devinit pixcir_i2c_ts_probe(struct i2c_client *client, | 128 | static int pixcir_i2c_ts_probe(struct i2c_client *client, |
129 | const struct i2c_device_id *id) | 129 | const struct i2c_device_id *id) |
130 | { | 130 | { |
131 | const struct pixcir_ts_platform_data *pdata = client->dev.platform_data; | 131 | const struct pixcir_ts_platform_data *pdata = client->dev.platform_data; |
@@ -189,7 +189,7 @@ err_free_mem: | |||
189 | return error; | 189 | return error; |
190 | } | 190 | } |
191 | 191 | ||
192 | static int __devexit pixcir_i2c_ts_remove(struct i2c_client *client) | 192 | static int pixcir_i2c_ts_remove(struct i2c_client *client) |
193 | { | 193 | { |
194 | struct pixcir_i2c_ts_data *tsdata = i2c_get_clientdata(client); | 194 | struct pixcir_i2c_ts_data *tsdata = i2c_get_clientdata(client); |
195 | 195 | ||
@@ -218,7 +218,7 @@ static struct i2c_driver pixcir_i2c_ts_driver = { | |||
218 | .pm = &pixcir_dev_pm_ops, | 218 | .pm = &pixcir_dev_pm_ops, |
219 | }, | 219 | }, |
220 | .probe = pixcir_i2c_ts_probe, | 220 | .probe = pixcir_i2c_ts_probe, |
221 | .remove = __devexit_p(pixcir_i2c_ts_remove), | 221 | .remove = pixcir_i2c_ts_remove, |
222 | .id_table = pixcir_i2c_ts_id, | 222 | .id_table = pixcir_i2c_ts_id, |
223 | }; | 223 | }; |
224 | 224 | ||
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index 549fa29548f8..b061af2c8376 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c | |||
@@ -238,7 +238,7 @@ static void s3c24xx_ts_select(struct s3c_adc_client *client, unsigned select) | |||
238 | * Initialise, find and allocate any resources we need to run and then | 238 | * Initialise, find and allocate any resources we need to run and then |
239 | * register with the ADC and input systems. | 239 | * register with the ADC and input systems. |
240 | */ | 240 | */ |
241 | static int __devinit s3c2410ts_probe(struct platform_device *pdev) | 241 | static int s3c2410ts_probe(struct platform_device *pdev) |
242 | { | 242 | { |
243 | struct s3c2410_ts_mach_info *info; | 243 | struct s3c2410_ts_mach_info *info; |
244 | struct device *dev = &pdev->dev; | 244 | struct device *dev = &pdev->dev; |
@@ -365,7 +365,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev) | |||
365 | * | 365 | * |
366 | * Free up our state ready to be removed. | 366 | * Free up our state ready to be removed. |
367 | */ | 367 | */ |
368 | static int __devexit s3c2410ts_remove(struct platform_device *pdev) | 368 | static int s3c2410ts_remove(struct platform_device *pdev) |
369 | { | 369 | { |
370 | free_irq(ts.irq_tc, ts.input); | 370 | free_irq(ts.irq_tc, ts.input); |
371 | del_timer_sync(&touch_timer); | 371 | del_timer_sync(&touch_timer); |
@@ -430,7 +430,7 @@ static struct platform_driver s3c_ts_driver = { | |||
430 | }, | 430 | }, |
431 | .id_table = s3cts_driver_ids, | 431 | .id_table = s3cts_driver_ids, |
432 | .probe = s3c2410ts_probe, | 432 | .probe = s3c2410ts_probe, |
433 | .remove = __devexit_p(s3c2410ts_remove), | 433 | .remove = s3c2410ts_remove, |
434 | }; | 434 | }; |
435 | module_platform_driver(s3c_ts_driver); | 435 | module_platform_driver(s3c_ts_driver); |
436 | 436 | ||
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index 6cb68a1981bf..d9d05e222428 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c | |||
@@ -139,7 +139,7 @@ end: | |||
139 | return IRQ_HANDLED; | 139 | return IRQ_HANDLED; |
140 | } | 140 | } |
141 | 141 | ||
142 | static int __devinit st1232_ts_probe(struct i2c_client *client, | 142 | static int st1232_ts_probe(struct i2c_client *client, |
143 | const struct i2c_device_id *id) | 143 | const struct i2c_device_id *id) |
144 | { | 144 | { |
145 | struct st1232_ts_data *ts; | 145 | struct st1232_ts_data *ts; |
@@ -206,7 +206,7 @@ err_free_mem: | |||
206 | return error; | 206 | return error; |
207 | } | 207 | } |
208 | 208 | ||
209 | static int __devexit st1232_ts_remove(struct i2c_client *client) | 209 | static int st1232_ts_remove(struct i2c_client *client) |
210 | { | 210 | { |
211 | struct st1232_ts_data *ts = i2c_get_clientdata(client); | 211 | struct st1232_ts_data *ts = i2c_get_clientdata(client); |
212 | 212 | ||
@@ -255,7 +255,7 @@ static const struct i2c_device_id st1232_ts_id[] = { | |||
255 | MODULE_DEVICE_TABLE(i2c, st1232_ts_id); | 255 | MODULE_DEVICE_TABLE(i2c, st1232_ts_id); |
256 | 256 | ||
257 | #ifdef CONFIG_OF | 257 | #ifdef CONFIG_OF |
258 | static const struct of_device_id st1232_ts_dt_ids[] __devinitconst = { | 258 | static const struct of_device_id st1232_ts_dt_ids[] = { |
259 | { .compatible = "sitronix,st1232", }, | 259 | { .compatible = "sitronix,st1232", }, |
260 | { } | 260 | { } |
261 | }; | 261 | }; |
@@ -264,7 +264,7 @@ MODULE_DEVICE_TABLE(of, st1232_ts_dt_ids); | |||
264 | 264 | ||
265 | static struct i2c_driver st1232_ts_driver = { | 265 | static struct i2c_driver st1232_ts_driver = { |
266 | .probe = st1232_ts_probe, | 266 | .probe = st1232_ts_probe, |
267 | .remove = __devexit_p(st1232_ts_remove), | 267 | .remove = st1232_ts_remove, |
268 | .id_table = st1232_ts_id, | 268 | .id_table = st1232_ts_id, |
269 | .driver = { | 269 | .driver = { |
270 | .name = ST1232_TS_NAME, | 270 | .name = ST1232_TS_NAME, |
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index 692b685720ce..84d884b4ec3e 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c | |||
@@ -1,4 +1,5 @@ | |||
1 | /* STMicroelectronics STMPE811 Touchscreen Driver | 1 | /* |
2 | * STMicroelectronics STMPE811 Touchscreen Driver | ||
2 | * | 3 | * |
3 | * (C) 2010 Luotao Fu <l.fu@pengutronix.de> | 4 | * (C) 2010 Luotao Fu <l.fu@pengutronix.de> |
4 | * All rights reserved. | 5 | * All rights reserved. |
@@ -16,6 +17,7 @@ | |||
16 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
17 | #include <linux/init.h> | 18 | #include <linux/init.h> |
18 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/of.h> | ||
19 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
20 | #include <linux/input.h> | 22 | #include <linux/input.h> |
21 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
@@ -166,7 +168,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data) | |||
166 | return IRQ_HANDLED; | 168 | return IRQ_HANDLED; |
167 | } | 169 | } |
168 | 170 | ||
169 | static int __devinit stmpe_init_hw(struct stmpe_touch *ts) | 171 | static int stmpe_init_hw(struct stmpe_touch *ts) |
170 | { | 172 | { |
171 | int ret; | 173 | int ret; |
172 | u8 adc_ctrl1, adc_ctrl1_mask, tsc_cfg, tsc_cfg_mask; | 174 | u8 adc_ctrl1, adc_ctrl1_mask, tsc_cfg, tsc_cfg_mask; |
@@ -261,41 +263,18 @@ static void stmpe_ts_close(struct input_dev *dev) | |||
261 | STMPE_TSC_CTRL_TSC_EN, 0); | 263 | STMPE_TSC_CTRL_TSC_EN, 0); |
262 | } | 264 | } |
263 | 265 | ||
264 | static int __devinit stmpe_input_probe(struct platform_device *pdev) | 266 | static void stmpe_ts_get_platform_info(struct platform_device *pdev, |
267 | struct stmpe_touch *ts) | ||
265 | { | 268 | { |
266 | struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); | 269 | struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); |
267 | struct stmpe_platform_data *pdata = stmpe->pdata; | 270 | struct device_node *np = pdev->dev.of_node; |
268 | struct stmpe_touch *ts; | ||
269 | struct input_dev *idev; | ||
270 | struct stmpe_ts_platform_data *ts_pdata = NULL; | 271 | struct stmpe_ts_platform_data *ts_pdata = NULL; |
271 | int ret; | ||
272 | int ts_irq; | ||
273 | |||
274 | ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); | ||
275 | if (ts_irq < 0) | ||
276 | return ts_irq; | ||
277 | |||
278 | ts = kzalloc(sizeof(*ts), GFP_KERNEL); | ||
279 | if (!ts) { | ||
280 | ret = -ENOMEM; | ||
281 | goto err_out; | ||
282 | } | ||
283 | 272 | ||
284 | idev = input_allocate_device(); | ||
285 | if (!idev) { | ||
286 | ret = -ENOMEM; | ||
287 | goto err_free_ts; | ||
288 | } | ||
289 | |||
290 | platform_set_drvdata(pdev, ts); | ||
291 | ts->stmpe = stmpe; | 273 | ts->stmpe = stmpe; |
292 | ts->idev = idev; | ||
293 | ts->dev = &pdev->dev; | ||
294 | 274 | ||
295 | if (pdata) | 275 | if (stmpe->pdata && stmpe->pdata->ts) { |
296 | ts_pdata = pdata->ts; | 276 | ts_pdata = stmpe->pdata->ts; |
297 | 277 | ||
298 | if (ts_pdata) { | ||
299 | ts->sample_time = ts_pdata->sample_time; | 278 | ts->sample_time = ts_pdata->sample_time; |
300 | ts->mod_12b = ts_pdata->mod_12b; | 279 | ts->mod_12b = ts_pdata->mod_12b; |
301 | ts->ref_sel = ts_pdata->ref_sel; | 280 | ts->ref_sel = ts_pdata->ref_sel; |
@@ -305,22 +284,71 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) | |||
305 | ts->settling = ts_pdata->settling; | 284 | ts->settling = ts_pdata->settling; |
306 | ts->fraction_z = ts_pdata->fraction_z; | 285 | ts->fraction_z = ts_pdata->fraction_z; |
307 | ts->i_drive = ts_pdata->i_drive; | 286 | ts->i_drive = ts_pdata->i_drive; |
287 | } else if (np) { | ||
288 | u32 val; | ||
289 | |||
290 | if (!of_property_read_u32(np, "st,sample-time", &val)) | ||
291 | ts->sample_time = val; | ||
292 | if (!of_property_read_u32(np, "st,mod-12b", &val)) | ||
293 | ts->mod_12b = val; | ||
294 | if (!of_property_read_u32(np, "st,ref-sel", &val)) | ||
295 | ts->ref_sel = val; | ||
296 | if (!of_property_read_u32(np, "st,adc-freq", &val)) | ||
297 | ts->adc_freq = val; | ||
298 | if (!of_property_read_u32(np, "st,ave-ctrl", &val)) | ||
299 | ts->ave_ctrl = val; | ||
300 | if (!of_property_read_u32(np, "st,touch-det-delay", &val)) | ||
301 | ts->touch_det_delay = val; | ||
302 | if (!of_property_read_u32(np, "st,settling", &val)) | ||
303 | ts->settling = val; | ||
304 | if (!of_property_read_u32(np, "st,fraction-z", &val)) | ||
305 | ts->fraction_z = val; | ||
306 | if (!of_property_read_u32(np, "st,i-drive", &val)) | ||
307 | ts->i_drive = val; | ||
308 | } | 308 | } |
309 | } | ||
310 | |||
311 | static int stmpe_input_probe(struct platform_device *pdev) | ||
312 | { | ||
313 | struct stmpe_touch *ts; | ||
314 | struct input_dev *idev; | ||
315 | int error; | ||
316 | int ts_irq; | ||
317 | |||
318 | ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); | ||
319 | if (ts_irq < 0) | ||
320 | return ts_irq; | ||
321 | |||
322 | ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); | ||
323 | if (!ts) | ||
324 | return -ENOMEM; | ||
325 | |||
326 | idev = devm_input_allocate_device(&pdev->dev); | ||
327 | if (!idev) | ||
328 | return -ENOMEM; | ||
329 | |||
330 | platform_set_drvdata(pdev, ts); | ||
331 | ts->idev = idev; | ||
332 | ts->dev = &pdev->dev; | ||
333 | |||
334 | stmpe_ts_get_platform_info(pdev, ts); | ||
309 | 335 | ||
310 | INIT_DELAYED_WORK(&ts->work, stmpe_work); | 336 | INIT_DELAYED_WORK(&ts->work, stmpe_work); |
311 | 337 | ||
312 | ret = request_threaded_irq(ts_irq, NULL, stmpe_ts_handler, | 338 | error = devm_request_threaded_irq(&pdev->dev, ts_irq, |
313 | IRQF_ONESHOT, STMPE_TS_NAME, ts); | 339 | NULL, stmpe_ts_handler, |
314 | if (ret) { | 340 | IRQF_ONESHOT, STMPE_TS_NAME, ts); |
341 | if (error) { | ||
315 | dev_err(&pdev->dev, "Failed to request IRQ %d\n", ts_irq); | 342 | dev_err(&pdev->dev, "Failed to request IRQ %d\n", ts_irq); |
316 | goto err_free_input; | 343 | return error; |
317 | } | 344 | } |
318 | 345 | ||
319 | ret = stmpe_init_hw(ts); | 346 | error = stmpe_init_hw(ts); |
320 | if (ret) | 347 | if (error) |
321 | goto err_free_irq; | 348 | return error; |
322 | 349 | ||
323 | idev->name = STMPE_TS_NAME; | 350 | idev->name = STMPE_TS_NAME; |
351 | idev->phys = STMPE_TS_NAME"/input0"; | ||
324 | idev->id.bustype = BUS_I2C; | 352 | idev->id.bustype = BUS_I2C; |
325 | idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 353 | idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
326 | idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); | 354 | idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
@@ -334,40 +362,21 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) | |||
334 | input_set_abs_params(idev, ABS_Y, 0, XY_MASK, 0, 0); | 362 | input_set_abs_params(idev, ABS_Y, 0, XY_MASK, 0, 0); |
335 | input_set_abs_params(idev, ABS_PRESSURE, 0x0, 0xff, 0, 0); | 363 | input_set_abs_params(idev, ABS_PRESSURE, 0x0, 0xff, 0, 0); |
336 | 364 | ||
337 | ret = input_register_device(idev); | 365 | error = input_register_device(idev); |
338 | if (ret) { | 366 | if (error) { |
339 | dev_err(&pdev->dev, "Could not register input device\n"); | 367 | dev_err(&pdev->dev, "Could not register input device\n"); |
340 | goto err_free_irq; | 368 | return error; |
341 | } | 369 | } |
342 | 370 | ||
343 | return ret; | 371 | return 0; |
344 | |||
345 | err_free_irq: | ||
346 | free_irq(ts_irq, ts); | ||
347 | err_free_input: | ||
348 | input_free_device(idev); | ||
349 | platform_set_drvdata(pdev, NULL); | ||
350 | err_free_ts: | ||
351 | kfree(ts); | ||
352 | err_out: | ||
353 | return ret; | ||
354 | } | 372 | } |
355 | 373 | ||
356 | static int __devexit stmpe_ts_remove(struct platform_device *pdev) | 374 | static int stmpe_ts_remove(struct platform_device *pdev) |
357 | { | 375 | { |
358 | struct stmpe_touch *ts = platform_get_drvdata(pdev); | 376 | struct stmpe_touch *ts = platform_get_drvdata(pdev); |
359 | unsigned int ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); | ||
360 | 377 | ||
361 | stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); | 378 | stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); |
362 | 379 | ||
363 | free_irq(ts_irq, ts); | ||
364 | |||
365 | platform_set_drvdata(pdev, NULL); | ||
366 | |||
367 | input_unregister_device(ts->idev); | ||
368 | |||
369 | kfree(ts); | ||
370 | |||
371 | return 0; | 380 | return 0; |
372 | } | 381 | } |
373 | 382 | ||
@@ -377,7 +386,7 @@ static struct platform_driver stmpe_ts_driver = { | |||
377 | .owner = THIS_MODULE, | 386 | .owner = THIS_MODULE, |
378 | }, | 387 | }, |
379 | .probe = stmpe_input_probe, | 388 | .probe = stmpe_input_probe, |
380 | .remove = __devexit_p(stmpe_ts_remove), | 389 | .remove = stmpe_ts_remove, |
381 | }; | 390 | }; |
382 | module_platform_driver(stmpe_ts_driver); | 391 | module_platform_driver(stmpe_ts_driver); |
383 | 392 | ||
diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c index d229c741d544..bcedf2e7468c 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c | |||
@@ -303,7 +303,7 @@ static irqreturn_t tscadc_irq(int irq, void *dev) | |||
303 | * The functions for inserting/removing driver as a module. | 303 | * The functions for inserting/removing driver as a module. |
304 | */ | 304 | */ |
305 | 305 | ||
306 | static int __devinit tscadc_probe(struct platform_device *pdev) | 306 | static int tscadc_probe(struct platform_device *pdev) |
307 | { | 307 | { |
308 | const struct tsc_data *pdata = pdev->dev.platform_data; | 308 | const struct tsc_data *pdata = pdev->dev.platform_data; |
309 | struct resource *res; | 309 | struct resource *res; |
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c index 368d2c6cf780..acfb87607b87 100644 --- a/drivers/input/touchscreen/tnetv107x-ts.c +++ b/drivers/input/touchscreen/tnetv107x-ts.c | |||
@@ -243,7 +243,7 @@ static void tsc_stop(struct input_dev *dev) | |||
243 | clk_disable(ts->clk); | 243 | clk_disable(ts->clk); |
244 | } | 244 | } |
245 | 245 | ||
246 | static int __devinit tsc_probe(struct platform_device *pdev) | 246 | static int tsc_probe(struct platform_device *pdev) |
247 | { | 247 | { |
248 | struct device *dev = &pdev->dev; | 248 | struct device *dev = &pdev->dev; |
249 | struct tsc_data *ts; | 249 | struct tsc_data *ts; |
@@ -357,7 +357,7 @@ error_res: | |||
357 | return error; | 357 | return error; |
358 | } | 358 | } |
359 | 359 | ||
360 | static int __devexit tsc_remove(struct platform_device *pdev) | 360 | static int tsc_remove(struct platform_device *pdev) |
361 | { | 361 | { |
362 | struct tsc_data *ts = platform_get_drvdata(pdev); | 362 | struct tsc_data *ts = platform_get_drvdata(pdev); |
363 | 363 | ||
@@ -374,7 +374,7 @@ static int __devexit tsc_remove(struct platform_device *pdev) | |||
374 | 374 | ||
375 | static struct platform_driver tsc_driver = { | 375 | static struct platform_driver tsc_driver = { |
376 | .probe = tsc_probe, | 376 | .probe = tsc_probe, |
377 | .remove = __devexit_p(tsc_remove), | 377 | .remove = tsc_remove, |
378 | .driver.name = "tnetv107x-ts", | 378 | .driver.name = "tnetv107x-ts", |
379 | .driver.owner = THIS_MODULE, | 379 | .driver.owner = THIS_MODULE, |
380 | }; | 380 | }; |
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index f7eda3d00fad..820a066c3b8a 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c | |||
@@ -345,7 +345,7 @@ err0: | |||
345 | return error; | 345 | return error; |
346 | } | 346 | } |
347 | 347 | ||
348 | static int __devexit tps6507x_ts_remove(struct platform_device *pdev) | 348 | static int tps6507x_ts_remove(struct platform_device *pdev) |
349 | { | 349 | { |
350 | struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev); | 350 | struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev); |
351 | struct tps6507x_ts *tsc = tps6507x_dev->ts; | 351 | struct tps6507x_ts *tsc = tps6507x_dev->ts; |
@@ -367,7 +367,7 @@ static struct platform_driver tps6507x_ts_driver = { | |||
367 | .owner = THIS_MODULE, | 367 | .owner = THIS_MODULE, |
368 | }, | 368 | }, |
369 | .probe = tps6507x_ts_probe, | 369 | .probe = tps6507x_ts_probe, |
370 | .remove = __devexit_p(tps6507x_ts_remove), | 370 | .remove = tps6507x_ts_remove, |
371 | }; | 371 | }; |
372 | module_platform_driver(tps6507x_ts_driver); | 372 | module_platform_driver(tps6507x_ts_driver); |
373 | 373 | ||
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index 5ce3fa8ce646..9c0cdc7ea449 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c | |||
@@ -555,7 +555,7 @@ static void tsc2005_close(struct input_dev *input) | |||
555 | mutex_unlock(&ts->mutex); | 555 | mutex_unlock(&ts->mutex); |
556 | } | 556 | } |
557 | 557 | ||
558 | static void __devinit tsc2005_setup_spi_xfer(struct tsc2005 *ts) | 558 | static void tsc2005_setup_spi_xfer(struct tsc2005 *ts) |
559 | { | 559 | { |
560 | tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, false); | 560 | tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, false); |
561 | tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, false); | 561 | tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, false); |
@@ -569,7 +569,7 @@ static void __devinit tsc2005_setup_spi_xfer(struct tsc2005 *ts) | |||
569 | spi_message_add_tail(&ts->spi_z2.spi_xfer, &ts->spi_read_msg); | 569 | spi_message_add_tail(&ts->spi_z2.spi_xfer, &ts->spi_read_msg); |
570 | } | 570 | } |
571 | 571 | ||
572 | static int __devinit tsc2005_probe(struct spi_device *spi) | 572 | static int tsc2005_probe(struct spi_device *spi) |
573 | { | 573 | { |
574 | const struct tsc2005_platform_data *pdata = spi->dev.platform_data; | 574 | const struct tsc2005_platform_data *pdata = spi->dev.platform_data; |
575 | struct tsc2005 *ts; | 575 | struct tsc2005 *ts; |
@@ -686,7 +686,7 @@ err_free_mem: | |||
686 | return error; | 686 | return error; |
687 | } | 687 | } |
688 | 688 | ||
689 | static int __devexit tsc2005_remove(struct spi_device *spi) | 689 | static int tsc2005_remove(struct spi_device *spi) |
690 | { | 690 | { |
691 | struct tsc2005 *ts = spi_get_drvdata(spi); | 691 | struct tsc2005 *ts = spi_get_drvdata(spi); |
692 | 692 | ||
@@ -745,7 +745,7 @@ static struct spi_driver tsc2005_driver = { | |||
745 | .pm = &tsc2005_pm_ops, | 745 | .pm = &tsc2005_pm_ops, |
746 | }, | 746 | }, |
747 | .probe = tsc2005_probe, | 747 | .probe = tsc2005_probe, |
748 | .remove = __devexit_p(tsc2005_remove), | 748 | .remove = tsc2005_remove, |
749 | }; | 749 | }; |
750 | 750 | ||
751 | module_spi_driver(tsc2005_driver); | 751 | module_spi_driver(tsc2005_driver); |
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 1473d2382afd..0b67ba476b4c 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
@@ -273,7 +273,7 @@ static void tsc2007_close(struct input_dev *input_dev) | |||
273 | tsc2007_stop(ts); | 273 | tsc2007_stop(ts); |
274 | } | 274 | } |
275 | 275 | ||
276 | static int __devinit tsc2007_probe(struct i2c_client *client, | 276 | static int tsc2007_probe(struct i2c_client *client, |
277 | const struct i2c_device_id *id) | 277 | const struct i2c_device_id *id) |
278 | { | 278 | { |
279 | struct tsc2007 *ts; | 279 | struct tsc2007 *ts; |
@@ -366,7 +366,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client, | |||
366 | return err; | 366 | return err; |
367 | } | 367 | } |
368 | 368 | ||
369 | static int __devexit tsc2007_remove(struct i2c_client *client) | 369 | static int tsc2007_remove(struct i2c_client *client) |
370 | { | 370 | { |
371 | struct tsc2007 *ts = i2c_get_clientdata(client); | 371 | struct tsc2007 *ts = i2c_get_clientdata(client); |
372 | struct tsc2007_platform_data *pdata = client->dev.platform_data; | 372 | struct tsc2007_platform_data *pdata = client->dev.platform_data; |
@@ -396,7 +396,7 @@ static struct i2c_driver tsc2007_driver = { | |||
396 | }, | 396 | }, |
397 | .id_table = tsc2007_idtable, | 397 | .id_table = tsc2007_idtable, |
398 | .probe = tsc2007_probe, | 398 | .probe = tsc2007_probe, |
399 | .remove = __devexit_p(tsc2007_remove), | 399 | .remove = tsc2007_remove, |
400 | }; | 400 | }; |
401 | 401 | ||
402 | module_i2c_driver(tsc2007_driver); | 402 | module_i2c_driver(tsc2007_driver); |
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 46e83ad53f43..1271f97b4079 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c | |||
@@ -274,7 +274,7 @@ static void ucb1400_ts_close(struct input_dev *idev) | |||
274 | * Try to probe our interrupt, rather than relying on lots of | 274 | * Try to probe our interrupt, rather than relying on lots of |
275 | * hard-coded machine dependencies. | 275 | * hard-coded machine dependencies. |
276 | */ | 276 | */ |
277 | static int __devinit ucb1400_ts_detect_irq(struct ucb1400_ts *ucb, | 277 | static int ucb1400_ts_detect_irq(struct ucb1400_ts *ucb, |
278 | struct platform_device *pdev) | 278 | struct platform_device *pdev) |
279 | { | 279 | { |
280 | unsigned long mask, timeout; | 280 | unsigned long mask, timeout; |
@@ -318,7 +318,7 @@ static int __devinit ucb1400_ts_detect_irq(struct ucb1400_ts *ucb, | |||
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
321 | static int __devinit ucb1400_ts_probe(struct platform_device *pdev) | 321 | static int ucb1400_ts_probe(struct platform_device *pdev) |
322 | { | 322 | { |
323 | struct ucb1400_ts *ucb = pdev->dev.platform_data; | 323 | struct ucb1400_ts *ucb = pdev->dev.platform_data; |
324 | int error, x_res, y_res; | 324 | int error, x_res, y_res; |
@@ -397,7 +397,7 @@ err: | |||
397 | return error; | 397 | return error; |
398 | } | 398 | } |
399 | 399 | ||
400 | static int __devexit ucb1400_ts_remove(struct platform_device *pdev) | 400 | static int ucb1400_ts_remove(struct platform_device *pdev) |
401 | { | 401 | { |
402 | struct ucb1400_ts *ucb = pdev->dev.platform_data; | 402 | struct ucb1400_ts *ucb = pdev->dev.platform_data; |
403 | 403 | ||
@@ -442,7 +442,7 @@ static SIMPLE_DEV_PM_OPS(ucb1400_ts_pm_ops, | |||
442 | 442 | ||
443 | static struct platform_driver ucb1400_ts_driver = { | 443 | static struct platform_driver ucb1400_ts_driver = { |
444 | .probe = ucb1400_ts_probe, | 444 | .probe = ucb1400_ts_probe, |
445 | .remove = __devexit_p(ucb1400_ts_remove), | 445 | .remove = ucb1400_ts_remove, |
446 | .driver = { | 446 | .driver = { |
447 | .name = "ucb1400_ts", | 447 | .name = "ucb1400_ts", |
448 | .owner = THIS_MODULE, | 448 | .owner = THIS_MODULE, |
diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c index 9396b21d0e8f..d2ef8f05c66e 100644 --- a/drivers/input/touchscreen/w90p910_ts.c +++ b/drivers/input/touchscreen/w90p910_ts.c | |||
@@ -215,7 +215,7 @@ static void w90p910_close(struct input_dev *dev) | |||
215 | clk_disable(w90p910_ts->clk); | 215 | clk_disable(w90p910_ts->clk); |
216 | } | 216 | } |
217 | 217 | ||
218 | static int __devinit w90x900ts_probe(struct platform_device *pdev) | 218 | static int w90x900ts_probe(struct platform_device *pdev) |
219 | { | 219 | { |
220 | struct w90p910_ts *w90p910_ts; | 220 | struct w90p910_ts *w90p910_ts; |
221 | struct input_dev *input_dev; | 221 | struct input_dev *input_dev; |
@@ -301,7 +301,7 @@ fail1: input_free_device(input_dev); | |||
301 | return err; | 301 | return err; |
302 | } | 302 | } |
303 | 303 | ||
304 | static int __devexit w90x900ts_remove(struct platform_device *pdev) | 304 | static int w90x900ts_remove(struct platform_device *pdev) |
305 | { | 305 | { |
306 | struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev); | 306 | struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev); |
307 | struct resource *res; | 307 | struct resource *res; |
@@ -325,7 +325,7 @@ static int __devexit w90x900ts_remove(struct platform_device *pdev) | |||
325 | 325 | ||
326 | static struct platform_driver w90x900ts_driver = { | 326 | static struct platform_driver w90x900ts_driver = { |
327 | .probe = w90x900ts_probe, | 327 | .probe = w90x900ts_probe, |
328 | .remove = __devexit_p(w90x900ts_remove), | 328 | .remove = w90x900ts_remove, |
329 | .driver = { | 329 | .driver = { |
330 | .name = "nuc900-ts", | 330 | .name = "nuc900-ts", |
331 | .owner = THIS_MODULE, | 331 | .owner = THIS_MODULE, |
diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 0c01657132fd..bf0d07620bac 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c | |||
@@ -144,7 +144,7 @@ static void wacom_i2c_close(struct input_dev *dev) | |||
144 | disable_irq(client->irq); | 144 | disable_irq(client->irq); |
145 | } | 145 | } |
146 | 146 | ||
147 | static int __devinit wacom_i2c_probe(struct i2c_client *client, | 147 | static int wacom_i2c_probe(struct i2c_client *client, |
148 | const struct i2c_device_id *id) | 148 | const struct i2c_device_id *id) |
149 | { | 149 | { |
150 | struct wacom_i2c *wac_i2c; | 150 | struct wacom_i2c *wac_i2c; |
@@ -225,7 +225,7 @@ err_free_mem: | |||
225 | return error; | 225 | return error; |
226 | } | 226 | } |
227 | 227 | ||
228 | static int __devexit wacom_i2c_remove(struct i2c_client *client) | 228 | static int wacom_i2c_remove(struct i2c_client *client) |
229 | { | 229 | { |
230 | struct wacom_i2c *wac_i2c = i2c_get_clientdata(client); | 230 | struct wacom_i2c *wac_i2c = i2c_get_clientdata(client); |
231 | 231 | ||
@@ -272,7 +272,7 @@ static struct i2c_driver wacom_i2c_driver = { | |||
272 | }, | 272 | }, |
273 | 273 | ||
274 | .probe = wacom_i2c_probe, | 274 | .probe = wacom_i2c_probe, |
275 | .remove = __devexit_p(wacom_i2c_remove), | 275 | .remove = wacom_i2c_remove, |
276 | .id_table = wacom_i2c_id, | 276 | .id_table = wacom_i2c_id, |
277 | }; | 277 | }; |
278 | module_i2c_driver(wacom_i2c_driver); | 278 | module_i2c_driver(wacom_i2c_driver); |
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index 52abb98a8ae5..f88fab56178c 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c | |||
@@ -233,7 +233,7 @@ static void wm831x_ts_input_close(struct input_dev *idev) | |||
233 | } | 233 | } |
234 | } | 234 | } |
235 | 235 | ||
236 | static __devinit int wm831x_ts_probe(struct platform_device *pdev) | 236 | static int wm831x_ts_probe(struct platform_device *pdev) |
237 | { | 237 | { |
238 | struct wm831x_ts *wm831x_ts; | 238 | struct wm831x_ts *wm831x_ts; |
239 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 239 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
@@ -245,7 +245,8 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
245 | if (core_pdata) | 245 | if (core_pdata) |
246 | pdata = core_pdata->touch; | 246 | pdata = core_pdata->touch; |
247 | 247 | ||
248 | wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL); | 248 | wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts), |
249 | GFP_KERNEL); | ||
249 | input_dev = input_allocate_device(); | 250 | input_dev = input_allocate_device(); |
250 | if (!wm831x_ts || !input_dev) { | 251 | if (!wm831x_ts || !input_dev) { |
251 | error = -ENOMEM; | 252 | error = -ENOMEM; |
@@ -376,21 +377,18 @@ err_data_irq: | |||
376 | free_irq(wm831x_ts->data_irq, wm831x_ts); | 377 | free_irq(wm831x_ts->data_irq, wm831x_ts); |
377 | err_alloc: | 378 | err_alloc: |
378 | input_free_device(input_dev); | 379 | input_free_device(input_dev); |
379 | kfree(wm831x_ts); | ||
380 | 380 | ||
381 | return error; | 381 | return error; |
382 | } | 382 | } |
383 | 383 | ||
384 | static __devexit int wm831x_ts_remove(struct platform_device *pdev) | 384 | static int wm831x_ts_remove(struct platform_device *pdev) |
385 | { | 385 | { |
386 | struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); | 386 | struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); |
387 | 387 | ||
388 | free_irq(wm831x_ts->pd_irq, wm831x_ts); | 388 | free_irq(wm831x_ts->pd_irq, wm831x_ts); |
389 | free_irq(wm831x_ts->data_irq, wm831x_ts); | 389 | free_irq(wm831x_ts->data_irq, wm831x_ts); |
390 | input_unregister_device(wm831x_ts->input_dev); | 390 | input_unregister_device(wm831x_ts->input_dev); |
391 | kfree(wm831x_ts); | ||
392 | 391 | ||
393 | platform_set_drvdata(pdev, NULL); | ||
394 | return 0; | 392 | return 0; |
395 | } | 393 | } |
396 | 394 | ||
@@ -400,7 +398,7 @@ static struct platform_driver wm831x_ts_driver = { | |||
400 | .owner = THIS_MODULE, | 398 | .owner = THIS_MODULE, |
401 | }, | 399 | }, |
402 | .probe = wm831x_ts_probe, | 400 | .probe = wm831x_ts_probe, |
403 | .remove = __devexit_p(wm831x_ts_remove), | 401 | .remove = wm831x_ts_remove, |
404 | }; | 402 | }; |
405 | module_platform_driver(wm831x_ts_driver); | 403 | module_platform_driver(wm831x_ts_driver); |
406 | 404 | ||