diff options
author | David Brown <davidb@codeaurora.org> | 2011-03-17 01:13:16 -0400 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2011-03-17 01:13:16 -0400 |
commit | 92c260f755c42337c550d8ac1f8ccd1b32bffb20 (patch) | |
tree | 6d04fefc1adeecabfb2b00c201e0db78fa2b5529 /drivers/input/touchscreen | |
parent | 8e76a80960bf06c245160a484d5a363ca6b520bb (diff) | |
parent | 05e34754518b6a90d5c392790c032575fab12d66 (diff) |
Merge remote branch 'rmk/for-linus' into for-linus
* rmk/for-linus: (1557 commits)
ARM: 6806/1: irq: introduce entry and exit functions for chained handlers
ARM: 6781/1: Thumb-2: Work around buggy Thumb-2 short branch relocations in gas
ARM: 6747/1: P2V: Thumb2 support
ARM: 6798/1: aout-core: zero thread debug registers in a.out core dump
ARM: 6796/1: Footbridge: Fix I/O mappings for NOMMU mode
ARM: 6784/1: errata: no automatic Store Buffer drain on Cortex-A9
ARM: 6772/1: errata: possible fault MMU translations following an ASID switch
ARM: 6776/1: mach-ux500: activate fix for errata 753970
ARM: 6794/1: SPEAr: Append UL to device address macros.
ARM: 6793/1: SPEAr: Remove unused *_SIZE macros from spear*.h files
ARM: 6792/1: SPEAr: Replace SIZE macro's with SZ_4K macros
ARM: 6791/1: SPEAr3xx: Declare device structures after shirq code
ARM: 6790/1: SPEAr: Clock Framework: Rename usbd clock and align apb_clk entry
ARM: 6789/1: SPEAr3xx: Rename sdio to sdhci
ARM: 6788/1: SPEAr: Include mach/hardware.h instead of mach/spear.h
ARM: 6787/1: SPEAr: Reorder #includes in .h & .c files.
ARM: 6681/1: SPEAr: add debugfs support to clk API
ARM: 6703/1: SPEAr: update clk API support
ARM: 6679/1: SPEAr: make clk API functions more generic
ARM: 6737/1: SPEAr: formalized timer support
...
Conflicts:
arch/arm/mach-msm/board-msm7x27.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-msm/board-sapphire.c
arch/arm/mach-msm/include/mach/memory.h
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 38 | ||||
-rw-r--r-- | drivers/input/touchscreen/bu21013_ts.c | 39 | ||||
-rw-r--r-- | drivers/input/touchscreen/tnetv107x-ts.c | 5 | ||||
-rw-r--r-- | drivers/input/touchscreen/wacom_w8001.c | 13 |
4 files changed, 72 insertions, 23 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 14ea54b78e46..4bf2316e3284 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -941,28 +941,29 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784 | |||
941 | struct ads7846_platform_data *pdata = spi->dev.platform_data; | 941 | struct ads7846_platform_data *pdata = spi->dev.platform_data; |
942 | int err; | 942 | int err; |
943 | 943 | ||
944 | /* REVISIT when the irq can be triggered active-low, or if for some | 944 | /* |
945 | * REVISIT when the irq can be triggered active-low, or if for some | ||
945 | * reason the touchscreen isn't hooked up, we don't need to access | 946 | * reason the touchscreen isn't hooked up, we don't need to access |
946 | * the pendown state. | 947 | * the pendown state. |
947 | */ | 948 | */ |
948 | if (!pdata->get_pendown_state && !gpio_is_valid(pdata->gpio_pendown)) { | ||
949 | dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); | ||
950 | return -EINVAL; | ||
951 | } | ||
952 | 949 | ||
953 | if (pdata->get_pendown_state) { | 950 | if (pdata->get_pendown_state) { |
954 | ts->get_pendown_state = pdata->get_pendown_state; | 951 | ts->get_pendown_state = pdata->get_pendown_state; |
955 | return 0; | 952 | } else if (gpio_is_valid(pdata->gpio_pendown)) { |
956 | } | ||
957 | 953 | ||
958 | err = gpio_request(pdata->gpio_pendown, "ads7846_pendown"); | 954 | err = gpio_request(pdata->gpio_pendown, "ads7846_pendown"); |
959 | if (err) { | 955 | if (err) { |
960 | dev_err(&spi->dev, "failed to request pendown GPIO%d\n", | 956 | dev_err(&spi->dev, "failed to request pendown GPIO%d\n", |
961 | pdata->gpio_pendown); | 957 | pdata->gpio_pendown); |
962 | return err; | 958 | return err; |
963 | } | 959 | } |
964 | 960 | ||
965 | ts->gpio_pendown = pdata->gpio_pendown; | 961 | ts->gpio_pendown = pdata->gpio_pendown; |
962 | |||
963 | } else { | ||
964 | dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); | ||
965 | return -EINVAL; | ||
966 | } | ||
966 | 967 | ||
967 | return 0; | 968 | return 0; |
968 | } | 969 | } |
@@ -1353,7 +1354,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
1353 | err_put_regulator: | 1354 | err_put_regulator: |
1354 | regulator_put(ts->reg); | 1355 | regulator_put(ts->reg); |
1355 | err_free_gpio: | 1356 | err_free_gpio: |
1356 | if (ts->gpio_pendown != -1) | 1357 | if (!ts->get_pendown_state) |
1357 | gpio_free(ts->gpio_pendown); | 1358 | gpio_free(ts->gpio_pendown); |
1358 | err_cleanup_filter: | 1359 | err_cleanup_filter: |
1359 | if (ts->filter_cleanup) | 1360 | if (ts->filter_cleanup) |
@@ -1383,8 +1384,13 @@ static int __devexit ads7846_remove(struct spi_device *spi) | |||
1383 | regulator_disable(ts->reg); | 1384 | regulator_disable(ts->reg); |
1384 | regulator_put(ts->reg); | 1385 | regulator_put(ts->reg); |
1385 | 1386 | ||
1386 | if (ts->gpio_pendown != -1) | 1387 | if (!ts->get_pendown_state) { |
1388 | /* | ||
1389 | * If we are not using specialized pendown method we must | ||
1390 | * have been relying on gpio we set up ourselves. | ||
1391 | */ | ||
1387 | gpio_free(ts->gpio_pendown); | 1392 | gpio_free(ts->gpio_pendown); |
1393 | } | ||
1388 | 1394 | ||
1389 | if (ts->filter_cleanup) | 1395 | if (ts->filter_cleanup) |
1390 | ts->filter_cleanup(ts->filter_data); | 1396 | ts->filter_cleanup(ts->filter_data); |
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index f7fa9ef4cd65..1507ce108d5b 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
13 | #include <linux/input/bu21013.h> | 13 | #include <linux/input/bu21013.h> |
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/regulator/consumer.h> | ||
15 | 16 | ||
16 | #define PEN_DOWN_INTR 0 | 17 | #define PEN_DOWN_INTR 0 |
17 | #define MAX_FINGERS 2 | 18 | #define MAX_FINGERS 2 |
@@ -139,6 +140,7 @@ | |||
139 | * @chip: pointer to the touch panel controller | 140 | * @chip: pointer to the touch panel controller |
140 | * @in_dev: pointer to the input device structure | 141 | * @in_dev: pointer to the input device structure |
141 | * @intr_pin: interrupt pin value | 142 | * @intr_pin: interrupt pin value |
143 | * @regulator: pointer to the Regulator used for touch screen | ||
142 | * | 144 | * |
143 | * Touch panel device data structure | 145 | * Touch panel device data structure |
144 | */ | 146 | */ |
@@ -149,6 +151,7 @@ struct bu21013_ts_data { | |||
149 | const struct bu21013_platform_device *chip; | 151 | const struct bu21013_platform_device *chip; |
150 | struct input_dev *in_dev; | 152 | struct input_dev *in_dev; |
151 | unsigned int intr_pin; | 153 | unsigned int intr_pin; |
154 | struct regulator *regulator; | ||
152 | }; | 155 | }; |
153 | 156 | ||
154 | /** | 157 | /** |
@@ -456,6 +459,20 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
456 | bu21013_data->in_dev = in_dev; | 459 | bu21013_data->in_dev = in_dev; |
457 | bu21013_data->chip = pdata; | 460 | bu21013_data->chip = pdata; |
458 | bu21013_data->client = client; | 461 | bu21013_data->client = client; |
462 | |||
463 | bu21013_data->regulator = regulator_get(&client->dev, "V-TOUCH"); | ||
464 | if (IS_ERR(bu21013_data->regulator)) { | ||
465 | dev_err(&client->dev, "regulator_get failed\n"); | ||
466 | error = PTR_ERR(bu21013_data->regulator); | ||
467 | goto err_free_mem; | ||
468 | } | ||
469 | |||
470 | error = regulator_enable(bu21013_data->regulator); | ||
471 | if (error < 0) { | ||
472 | dev_err(&client->dev, "regulator enable failed\n"); | ||
473 | goto err_put_regulator; | ||
474 | } | ||
475 | |||
459 | bu21013_data->touch_stopped = false; | 476 | bu21013_data->touch_stopped = false; |
460 | init_waitqueue_head(&bu21013_data->wait); | 477 | init_waitqueue_head(&bu21013_data->wait); |
461 | 478 | ||
@@ -464,7 +481,7 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
464 | error = pdata->cs_en(pdata->cs_pin); | 481 | error = pdata->cs_en(pdata->cs_pin); |
465 | if (error < 0) { | 482 | if (error < 0) { |
466 | dev_err(&client->dev, "chip init failed\n"); | 483 | dev_err(&client->dev, "chip init failed\n"); |
467 | goto err_free_mem; | 484 | goto err_disable_regulator; |
468 | } | 485 | } |
469 | } | 486 | } |
470 | 487 | ||
@@ -485,9 +502,9 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
485 | __set_bit(EV_ABS, in_dev->evbit); | 502 | __set_bit(EV_ABS, in_dev->evbit); |
486 | 503 | ||
487 | input_set_abs_params(in_dev, ABS_MT_POSITION_X, 0, | 504 | input_set_abs_params(in_dev, ABS_MT_POSITION_X, 0, |
488 | pdata->x_max_res, 0, 0); | 505 | pdata->touch_x_max, 0, 0); |
489 | input_set_abs_params(in_dev, ABS_MT_POSITION_Y, 0, | 506 | input_set_abs_params(in_dev, ABS_MT_POSITION_Y, 0, |
490 | pdata->y_max_res, 0, 0); | 507 | pdata->touch_y_max, 0, 0); |
491 | input_set_drvdata(in_dev, bu21013_data); | 508 | input_set_drvdata(in_dev, bu21013_data); |
492 | 509 | ||
493 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, | 510 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, |
@@ -513,6 +530,10 @@ err_free_irq: | |||
513 | bu21013_free_irq(bu21013_data); | 530 | bu21013_free_irq(bu21013_data); |
514 | err_cs_disable: | 531 | err_cs_disable: |
515 | pdata->cs_dis(pdata->cs_pin); | 532 | pdata->cs_dis(pdata->cs_pin); |
533 | err_disable_regulator: | ||
534 | regulator_disable(bu21013_data->regulator); | ||
535 | err_put_regulator: | ||
536 | regulator_put(bu21013_data->regulator); | ||
516 | err_free_mem: | 537 | err_free_mem: |
517 | input_free_device(in_dev); | 538 | input_free_device(in_dev); |
518 | kfree(bu21013_data); | 539 | kfree(bu21013_data); |
@@ -535,6 +556,10 @@ static int __devexit bu21013_remove(struct i2c_client *client) | |||
535 | bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin); | 556 | bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin); |
536 | 557 | ||
537 | input_unregister_device(bu21013_data->in_dev); | 558 | input_unregister_device(bu21013_data->in_dev); |
559 | |||
560 | regulator_disable(bu21013_data->regulator); | ||
561 | regulator_put(bu21013_data->regulator); | ||
562 | |||
538 | kfree(bu21013_data); | 563 | kfree(bu21013_data); |
539 | 564 | ||
540 | device_init_wakeup(&client->dev, false); | 565 | device_init_wakeup(&client->dev, false); |
@@ -561,6 +586,8 @@ static int bu21013_suspend(struct device *dev) | |||
561 | else | 586 | else |
562 | disable_irq(bu21013_data->chip->irq); | 587 | disable_irq(bu21013_data->chip->irq); |
563 | 588 | ||
589 | regulator_disable(bu21013_data->regulator); | ||
590 | |||
564 | return 0; | 591 | return 0; |
565 | } | 592 | } |
566 | 593 | ||
@@ -577,6 +604,12 @@ static int bu21013_resume(struct device *dev) | |||
577 | struct i2c_client *client = bu21013_data->client; | 604 | struct i2c_client *client = bu21013_data->client; |
578 | int retval; | 605 | int retval; |
579 | 606 | ||
607 | retval = regulator_enable(bu21013_data->regulator); | ||
608 | if (retval < 0) { | ||
609 | dev_err(&client->dev, "bu21013 regulator enable failed\n"); | ||
610 | return retval; | ||
611 | } | ||
612 | |||
580 | retval = bu21013_init_chip(bu21013_data); | 613 | retval = bu21013_init_chip(bu21013_data); |
581 | if (retval < 0) { | 614 | if (retval < 0) { |
582 | dev_err(&client->dev, "bu21013 controller config failed\n"); | 615 | dev_err(&client->dev, "bu21013 controller config failed\n"); |
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c index cf1dba2e267c..22a3411e93c5 100644 --- a/drivers/input/touchscreen/tnetv107x-ts.c +++ b/drivers/input/touchscreen/tnetv107x-ts.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/err.h> | ||
17 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
18 | #include <linux/input.h> | 19 | #include <linux/input.h> |
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
@@ -289,9 +290,9 @@ static int __devinit tsc_probe(struct platform_device *pdev) | |||
289 | } | 290 | } |
290 | 291 | ||
291 | ts->clk = clk_get(dev, NULL); | 292 | ts->clk = clk_get(dev, NULL); |
292 | if (!ts->clk) { | 293 | if (IS_ERR(ts->clk)) { |
293 | dev_err(dev, "cannot claim device clock\n"); | 294 | dev_err(dev, "cannot claim device clock\n"); |
294 | error = -EINVAL; | 295 | error = PTR_ERR(ts->clk); |
295 | goto error_clk; | 296 | goto error_clk; |
296 | } | 297 | } |
297 | 298 | ||
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 5cb8449c909d..c14412ef4648 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c | |||
@@ -51,6 +51,10 @@ MODULE_LICENSE("GPL"); | |||
51 | #define W8001_PKTLEN_TPCCTL 11 /* control packet */ | 51 | #define W8001_PKTLEN_TPCCTL 11 /* control packet */ |
52 | #define W8001_PKTLEN_TOUCH2FG 13 | 52 | #define W8001_PKTLEN_TOUCH2FG 13 |
53 | 53 | ||
54 | /* resolution in points/mm */ | ||
55 | #define W8001_PEN_RESOLUTION 100 | ||
56 | #define W8001_TOUCH_RESOLUTION 10 | ||
57 | |||
54 | struct w8001_coord { | 58 | struct w8001_coord { |
55 | u8 rdy; | 59 | u8 rdy; |
56 | u8 tsw; | 60 | u8 tsw; |
@@ -198,7 +202,7 @@ static void parse_touchquery(u8 *data, struct w8001_touch_query *query) | |||
198 | query->y = 1024; | 202 | query->y = 1024; |
199 | if (query->panel_res) | 203 | if (query->panel_res) |
200 | query->x = query->y = (1 << query->panel_res); | 204 | query->x = query->y = (1 << query->panel_res); |
201 | query->panel_res = 10; | 205 | query->panel_res = W8001_TOUCH_RESOLUTION; |
202 | } | 206 | } |
203 | } | 207 | } |
204 | 208 | ||
@@ -394,6 +398,8 @@ static int w8001_setup(struct w8001 *w8001) | |||
394 | 398 | ||
395 | input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0); | 399 | input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0); |
396 | input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0); | 400 | input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0); |
401 | input_abs_set_res(dev, ABS_X, W8001_PEN_RESOLUTION); | ||
402 | input_abs_set_res(dev, ABS_Y, W8001_PEN_RESOLUTION); | ||
397 | input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0); | 403 | input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0); |
398 | if (coord.tilt_x && coord.tilt_y) { | 404 | if (coord.tilt_x && coord.tilt_y) { |
399 | input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0); | 405 | input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0); |
@@ -418,14 +424,17 @@ static int w8001_setup(struct w8001 *w8001) | |||
418 | w8001->max_touch_x = touch.x; | 424 | w8001->max_touch_x = touch.x; |
419 | w8001->max_touch_y = touch.y; | 425 | w8001->max_touch_y = touch.y; |
420 | 426 | ||
421 | /* scale to pen maximum */ | ||
422 | if (w8001->max_pen_x && w8001->max_pen_y) { | 427 | if (w8001->max_pen_x && w8001->max_pen_y) { |
428 | /* if pen is supported scale to pen maximum */ | ||
423 | touch.x = w8001->max_pen_x; | 429 | touch.x = w8001->max_pen_x; |
424 | touch.y = w8001->max_pen_y; | 430 | touch.y = w8001->max_pen_y; |
431 | touch.panel_res = W8001_PEN_RESOLUTION; | ||
425 | } | 432 | } |
426 | 433 | ||
427 | input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0); | 434 | input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0); |
428 | input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0); | 435 | input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0); |
436 | input_abs_set_res(dev, ABS_X, touch.panel_res); | ||
437 | input_abs_set_res(dev, ABS_Y, touch.panel_res); | ||
429 | 438 | ||
430 | switch (touch.sensor_id) { | 439 | switch (touch.sensor_id) { |
431 | case 0: | 440 | case 0: |