aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--drivers/input/touchscreen/cyttsp_spi.c1
-rw-r--r--drivers/input/touchscreen/mms114.c54
-rw-r--r--drivers/input/touchscreen/stmpe-ts.c2
-rw-r--r--drivers/input/touchscreen/tsc2005.c1
-rw-r--r--drivers/input/touchscreen/wm831x-ts.c4
6 files changed, 21 insertions, 43 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index b93b5988ace8..9a647ee1136a 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -359,7 +359,7 @@ config TOUCHSCREEN_MCS5000
359 359
360config TOUCHSCREEN_MMS114 360config TOUCHSCREEN_MMS114
361 tristate "MELFAS MMS114 touchscreen" 361 tristate "MELFAS MMS114 touchscreen"
362 depends on I2C 362 depends on I2C && GENERIC_HARDIRQS
363 help 363 help
364 Say Y here if you have the MELFAS MMS114 touchscreen controller 364 Say Y here if you have the MELFAS MMS114 touchscreen controller
365 chip in your system. 365 chip in your system.
diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c
index 638e20310f12..861b7f77605b 100644
--- a/drivers/input/touchscreen/cyttsp_spi.c
+++ b/drivers/input/touchscreen/cyttsp_spi.c
@@ -193,7 +193,6 @@ static struct spi_driver cyttsp_spi_driver = {
193 193
194module_spi_driver(cyttsp_spi_driver); 194module_spi_driver(cyttsp_spi_driver);
195 195
196MODULE_ALIAS("spi:cyttsp");
197MODULE_LICENSE("GPL"); 196MODULE_LICENSE("GPL");
198MODULE_DESCRIPTION("Cypress TrueTouch(R) Standard Product (TTSP) SPI driver"); 197MODULE_DESCRIPTION("Cypress TrueTouch(R) Standard Product (TTSP) SPI driver");
199MODULE_AUTHOR("Cypress"); 198MODULE_AUTHOR("Cypress");
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 98841d8aa635..4a29ddf6bf1e 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -429,12 +429,12 @@ static int mms114_probe(struct i2c_client *client,
429 return -ENODEV; 429 return -ENODEV;
430 } 430 }
431 431
432 data = kzalloc(sizeof(struct mms114_data), GFP_KERNEL); 432 data = devm_kzalloc(&client->dev, sizeof(struct mms114_data),
433 input_dev = input_allocate_device(); 433 GFP_KERNEL);
434 input_dev = devm_input_allocate_device(&client->dev);
434 if (!data || !input_dev) { 435 if (!data || !input_dev) {
435 dev_err(&client->dev, "Failed to allocate memory\n"); 436 dev_err(&client->dev, "Failed to allocate memory\n");
436 error = -ENOMEM; 437 return -ENOMEM;
437 goto err_free_mem;
438 } 438 }
439 439
440 data->client = client; 440 data->client = client;
@@ -466,57 +466,36 @@ static int mms114_probe(struct i2c_client *client,
466 input_set_drvdata(input_dev, data); 466 input_set_drvdata(input_dev, data);
467 i2c_set_clientdata(client, data); 467 i2c_set_clientdata(client, data);
468 468
469 data->core_reg = regulator_get(&client->dev, "avdd"); 469 data->core_reg = devm_regulator_get(&client->dev, "avdd");
470 if (IS_ERR(data->core_reg)) { 470 if (IS_ERR(data->core_reg)) {
471 error = PTR_ERR(data->core_reg); 471 error = PTR_ERR(data->core_reg);
472 dev_err(&client->dev, 472 dev_err(&client->dev,
473 "Unable to get the Core regulator (%d)\n", error); 473 "Unable to get the Core regulator (%d)\n", error);
474 goto err_free_mem; 474 return error;
475 } 475 }
476 476
477 data->io_reg = regulator_get(&client->dev, "vdd"); 477 data->io_reg = devm_regulator_get(&client->dev, "vdd");
478 if (IS_ERR(data->io_reg)) { 478 if (IS_ERR(data->io_reg)) {
479 error = PTR_ERR(data->io_reg); 479 error = PTR_ERR(data->io_reg);
480 dev_err(&client->dev, 480 dev_err(&client->dev,
481 "Unable to get the IO regulator (%d)\n", error); 481 "Unable to get the IO regulator (%d)\n", error);
482 goto err_core_reg; 482 return error;
483 } 483 }
484 484
485 error = request_threaded_irq(client->irq, NULL, mms114_interrupt, 485 error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
486 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "mms114", data); 486 mms114_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
487 dev_name(&client->dev), data);
487 if (error) { 488 if (error) {
488 dev_err(&client->dev, "Failed to register interrupt\n"); 489 dev_err(&client->dev, "Failed to register interrupt\n");
489 goto err_io_reg; 490 return error;
490 } 491 }
491 disable_irq(client->irq); 492 disable_irq(client->irq);
492 493
493 error = input_register_device(data->input_dev); 494 error = input_register_device(data->input_dev);
494 if (error) 495 if (error) {
495 goto err_free_irq; 496 dev_err(&client->dev, "Failed to register input device\n");
496 497 return error;
497 return 0; 498 }
498
499err_free_irq:
500 free_irq(client->irq, data);
501err_io_reg:
502 regulator_put(data->io_reg);
503err_core_reg:
504 regulator_put(data->core_reg);
505err_free_mem:
506 input_free_device(input_dev);
507 kfree(data);
508 return error;
509}
510
511static int mms114_remove(struct i2c_client *client)
512{
513 struct mms114_data *data = i2c_get_clientdata(client);
514
515 free_irq(client->irq, data);
516 regulator_put(data->io_reg);
517 regulator_put(data->core_reg);
518 input_unregister_device(data->input_dev);
519 kfree(data);
520 499
521 return 0; 500 return 0;
522} 501}
@@ -590,7 +569,6 @@ static struct i2c_driver mms114_driver = {
590 .of_match_table = of_match_ptr(mms114_dt_match), 569 .of_match_table = of_match_ptr(mms114_dt_match),
591 }, 570 },
592 .probe = mms114_probe, 571 .probe = mms114_probe,
593 .remove = mms114_remove,
594 .id_table = mms114_id, 572 .id_table = mms114_id,
595}; 573};
596 574
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index 84d884b4ec3e..59e81b00f244 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -120,6 +120,7 @@ static void stmpe_work(struct work_struct *work)
120 __stmpe_reset_fifo(ts->stmpe); 120 __stmpe_reset_fifo(ts->stmpe);
121 121
122 input_report_abs(ts->idev, ABS_PRESSURE, 0); 122 input_report_abs(ts->idev, ABS_PRESSURE, 0);
123 input_report_key(ts->idev, BTN_TOUCH, 0);
123 input_sync(ts->idev); 124 input_sync(ts->idev);
124} 125}
125 126
@@ -153,6 +154,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data)
153 input_report_abs(ts->idev, ABS_X, x); 154 input_report_abs(ts->idev, ABS_X, x);
154 input_report_abs(ts->idev, ABS_Y, y); 155 input_report_abs(ts->idev, ABS_Y, y);
155 input_report_abs(ts->idev, ABS_PRESSURE, z); 156 input_report_abs(ts->idev, ABS_PRESSURE, z);
157 input_report_key(ts->idev, BTN_TOUCH, 1);
156 input_sync(ts->idev); 158 input_sync(ts->idev);
157 159
158 /* flush the FIFO after we have read out our values. */ 160 /* flush the FIFO after we have read out our values. */
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 9c0cdc7ea449..7213e8b07e79 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -753,3 +753,4 @@ module_spi_driver(tsc2005_driver);
753MODULE_AUTHOR("Lauri Leukkunen <lauri.leukkunen@nokia.com>"); 753MODULE_AUTHOR("Lauri Leukkunen <lauri.leukkunen@nokia.com>");
754MODULE_DESCRIPTION("TSC2005 Touchscreen Driver"); 754MODULE_DESCRIPTION("TSC2005 Touchscreen Driver");
755MODULE_LICENSE("GPL"); 755MODULE_LICENSE("GPL");
756MODULE_ALIAS("spi:tsc2005");
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
index f88fab56178c..6be2eb6a153a 100644
--- a/drivers/input/touchscreen/wm831x-ts.c
+++ b/drivers/input/touchscreen/wm831x-ts.c
@@ -247,7 +247,7 @@ static int wm831x_ts_probe(struct platform_device *pdev)
247 247
248 wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts), 248 wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts),
249 GFP_KERNEL); 249 GFP_KERNEL);
250 input_dev = input_allocate_device(); 250 input_dev = devm_input_allocate_device(&pdev->dev);
251 if (!wm831x_ts || !input_dev) { 251 if (!wm831x_ts || !input_dev) {
252 error = -ENOMEM; 252 error = -ENOMEM;
253 goto err_alloc; 253 goto err_alloc;
@@ -376,7 +376,6 @@ err_pd_irq:
376err_data_irq: 376err_data_irq:
377 free_irq(wm831x_ts->data_irq, wm831x_ts); 377 free_irq(wm831x_ts->data_irq, wm831x_ts);
378err_alloc: 378err_alloc:
379 input_free_device(input_dev);
380 379
381 return error; 380 return error;
382} 381}
@@ -387,7 +386,6 @@ static int wm831x_ts_remove(struct platform_device *pdev)
387 386
388 free_irq(wm831x_ts->pd_irq, wm831x_ts); 387 free_irq(wm831x_ts->pd_irq, wm831x_ts);
389 free_irq(wm831x_ts->data_irq, wm831x_ts); 388 free_irq(wm831x_ts->data_irq, wm831x_ts);
390 input_unregister_device(wm831x_ts->input_dev);
391 389
392 return 0; 390 return 0;
393} 391}