aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/Kconfig4
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c40
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c8
3 files changed, 23 insertions, 29 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index cc471983ac0..b9f58ca82fd 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -154,8 +154,8 @@ config TOUCHSCREEN_FUJITSU
154 module will be called fujitsu-ts. 154 module will be called fujitsu-ts.
155 155
156config TOUCHSCREEN_S3C2410 156config TOUCHSCREEN_S3C2410
157 tristate "Samsung S3C2410 touchscreen input driver" 157 tristate "Samsung S3C2410/generic touchscreen input driver"
158 depends on ARCH_S3C2410 158 depends on ARCH_S3C2410 || SAMSUNG_DEV_TS
159 select S3C24XX_ADC 159 select S3C24XX_ADC
160 help 160 help
161 Say Y here if you have the s3c2410 touchscreen. 161 Say Y here if you have the s3c2410 touchscreen.
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 98a7d127948..ac5d0f9b0cb 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -37,9 +37,7 @@
37 37
38#include <plat/adc.h> 38#include <plat/adc.h>
39#include <plat/regs-adc.h> 39#include <plat/regs-adc.h>
40 40#include <plat/ts.h>
41#include <mach/regs-gpio.h>
42#include <mach/ts.h>
43 41
44#define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0)) 42#define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
45 43
@@ -57,6 +55,8 @@
57 S3C2410_ADCTSC_AUTO_PST | \ 55 S3C2410_ADCTSC_AUTO_PST | \
58 S3C2410_ADCTSC_XY_PST(0)) 56 S3C2410_ADCTSC_XY_PST(0))
59 57
58#define FEAT_PEN_IRQ (1 << 0) /* HAS ADCCLRINTPNDNUP */
59
60/* Per-touchscreen data. */ 60/* Per-touchscreen data. */
61 61
62/** 62/**
@@ -71,6 +71,7 @@
71 * @irq_tc: The interrupt number for pen up/down interrupt 71 * @irq_tc: The interrupt number for pen up/down interrupt
72 * @count: The number of samples collected. 72 * @count: The number of samples collected.
73 * @shift: The log2 of the maximum count to read in one go. 73 * @shift: The log2 of the maximum count to read in one go.
74 * @features: The features supported by the TSADC MOdule.
74 */ 75 */
75struct s3c2410ts { 76struct s3c2410ts {
76 struct s3c_adc_client *client; 77 struct s3c_adc_client *client;
@@ -83,26 +84,12 @@ struct s3c2410ts {
83 int irq_tc; 84 int irq_tc;
84 int count; 85 int count;
85 int shift; 86 int shift;
87 int features;
86}; 88};
87 89
88static struct s3c2410ts ts; 90static struct s3c2410ts ts;
89 91
90/** 92/**
91 * s3c2410_ts_connect - configure gpio for s3c2410 systems
92 *
93 * Configure the GPIO for the S3C2410 system, where we have external FETs
94 * connected to the device (later systems such as the S3C2440 integrate
95 * these into the device).
96*/
97static inline void s3c2410_ts_connect(void)
98{
99 s3c2410_gpio_cfgpin(S3C2410_GPG(12), S3C2410_GPG12_XMON);
100 s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPG13_nXPON);
101 s3c2410_gpio_cfgpin(S3C2410_GPG(14), S3C2410_GPG14_YMON);
102 s3c2410_gpio_cfgpin(S3C2410_GPG(15), S3C2410_GPG15_nYPON);
103}
104
105/**
106 * get_down - return the down state of the pen 93 * get_down - return the down state of the pen
107 * @data0: The data read from ADCDAT0 register. 94 * @data0: The data read from ADCDAT0 register.
108 * @data1: The data read from ADCDAT1 register. 95 * @data1: The data read from ADCDAT1 register.
@@ -188,6 +175,11 @@ static irqreturn_t stylus_irq(int irq, void *dev_id)
188 else 175 else
189 dev_info(ts.dev, "%s: count=%d\n", __func__, ts.count); 176 dev_info(ts.dev, "%s: count=%d\n", __func__, ts.count);
190 177
178 if (ts.features & FEAT_PEN_IRQ) {
179 /* Clear pen down/up interrupt */
180 writel(0x0, ts.io + S3C64XX_ADCCLRINTPNDNUP);
181 }
182
191 return IRQ_HANDLED; 183 return IRQ_HANDLED;
192} 184}
193 185
@@ -296,9 +288,9 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
296 goto err_clk; 288 goto err_clk;
297 } 289 }
298 290
299 /* Configure the touchscreen external FETs on the S3C2410 */ 291 /* inititalise the gpio */
300 if (!platform_get_device_id(pdev)->driver_data) 292 if (info->cfg_gpio)
301 s3c2410_ts_connect(); 293 info->cfg_gpio(to_platform_device(ts.dev));
302 294
303 ts.client = s3c_adc_register(pdev, s3c24xx_ts_select, 295 ts.client = s3c_adc_register(pdev, s3c24xx_ts_select,
304 s3c24xx_ts_conversion, 1); 296 s3c24xx_ts_conversion, 1);
@@ -334,6 +326,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
334 ts.input->id.version = 0x0102; 326 ts.input->id.version = 0x0102;
335 327
336 ts.shift = info->oversampling_shift; 328 ts.shift = info->oversampling_shift;
329 ts.features = platform_get_device_id(pdev)->driver_data;
337 330
338 ret = request_irq(ts.irq_tc, stylus_irq, IRQF_DISABLED, 331 ret = request_irq(ts.irq_tc, stylus_irq, IRQF_DISABLED,
339 "s3c2410_ts_pen", ts.input); 332 "s3c2410_ts_pen", ts.input);
@@ -421,14 +414,15 @@ static struct dev_pm_ops s3c_ts_pmops = {
421 414
422static struct platform_device_id s3cts_driver_ids[] = { 415static struct platform_device_id s3cts_driver_ids[] = {
423 { "s3c2410-ts", 0 }, 416 { "s3c2410-ts", 0 },
424 { "s3c2440-ts", 1 }, 417 { "s3c2440-ts", 0 },
418 { "s3c64xx-ts", FEAT_PEN_IRQ },
425 { } 419 { }
426}; 420};
427MODULE_DEVICE_TABLE(platform, s3cts_driver_ids); 421MODULE_DEVICE_TABLE(platform, s3cts_driver_ids);
428 422
429static struct platform_driver s3c_ts_driver = { 423static struct platform_driver s3c_ts_driver = {
430 .driver = { 424 .driver = {
431 .name = "s3c24xx-ts", 425 .name = "samsung-ts",
432 .owner = THIS_MODULE, 426 .owner = THIS_MODULE,
433#ifdef CONFIG_PM 427#ifdef CONFIG_PM
434 .pm = &s3c_ts_pmops, 428 .pm = &s3c_ts_pmops,
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 82227b00d4b..567d57215c2 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1295,8 +1295,8 @@ static void usbtouch_close(struct input_dev *input)
1295static void usbtouch_free_buffers(struct usb_device *udev, 1295static void usbtouch_free_buffers(struct usb_device *udev,
1296 struct usbtouch_usb *usbtouch) 1296 struct usbtouch_usb *usbtouch)
1297{ 1297{
1298 usb_buffer_free(udev, usbtouch->type->rept_size, 1298 usb_free_coherent(udev, usbtouch->type->rept_size,
1299 usbtouch->data, usbtouch->data_dma); 1299 usbtouch->data, usbtouch->data_dma);
1300 kfree(usbtouch->buffer); 1300 kfree(usbtouch->buffer);
1301} 1301}
1302 1302
@@ -1340,8 +1340,8 @@ static int usbtouch_probe(struct usb_interface *intf,
1340 if (!type->process_pkt) 1340 if (!type->process_pkt)
1341 type->process_pkt = usbtouch_process_pkt; 1341 type->process_pkt = usbtouch_process_pkt;
1342 1342
1343 usbtouch->data = usb_buffer_alloc(udev, type->rept_size, 1343 usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
1344 GFP_KERNEL, &usbtouch->data_dma); 1344 GFP_KERNEL, &usbtouch->data_dma);
1345 if (!usbtouch->data) 1345 if (!usbtouch->data)
1346 goto out_free; 1346 goto out_free;
1347 1347