aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-16 05:04:49 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-16 05:04:49 -0500
commit348324c5b10bcba8d9daabdfb85a6927311be34f (patch)
treed06ca3a264407a14a1f36c1b798d6dc0dc1582d8 /drivers/input/touchscreen
parent1e63bd9cc43db5400a1423a7ec8266b4e7c54bd0 (diff)
parent319e2e3f63c348a9b66db4667efa73178e18b17d (diff)
Merge tag 'v3.13-rc4' into next
Synchronize with mainline to bring in the new keycode definitions and new hwmon API.
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/cyttsp_core.c2
-rw-r--r--drivers/input/touchscreen/sur40.c4
-rw-r--r--drivers/input/touchscreen/ti_am335x_tsc.c12
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c26
4 files changed, 31 insertions, 13 deletions
diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 56088eceacdc..eee656f77a2e 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -242,7 +242,7 @@ static int cyttsp_soft_reset(struct cyttsp *ts)
242 int retval; 242 int retval;
243 243
244 /* wait for interrupt to set ready completion */ 244 /* wait for interrupt to set ready completion */
245 INIT_COMPLETION(ts->bl_ready); 245 reinit_completion(&ts->bl_ready);
246 ts->state = CY_BL_STATE; 246 ts->state = CY_BL_STATE;
247 247
248 enable_irq(ts->irq); 248 enable_irq(ts->irq);
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index cfd1b7e8c001..f1cb05148b46 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -251,7 +251,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
251 struct sur40_state *sur40 = polldev->private; 251 struct sur40_state *sur40 = polldev->private;
252 struct input_dev *input = polldev->input; 252 struct input_dev *input = polldev->input;
253 int result, bulk_read, need_blobs, packet_blobs, i; 253 int result, bulk_read, need_blobs, packet_blobs, i;
254 u32 packet_id; 254 u32 uninitialized_var(packet_id);
255 255
256 struct sur40_header *header = &sur40->bulk_in_buffer->header; 256 struct sur40_header *header = &sur40->bulk_in_buffer->header;
257 struct sur40_blob *inblob = &sur40->bulk_in_buffer->blobs[0]; 257 struct sur40_blob *inblob = &sur40->bulk_in_buffer->blobs[0];
@@ -286,7 +286,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
286 if (need_blobs == -1) { 286 if (need_blobs == -1) {
287 need_blobs = le16_to_cpu(header->count); 287 need_blobs = le16_to_cpu(header->count);
288 dev_dbg(sur40->dev, "need %d blobs\n", need_blobs); 288 dev_dbg(sur40->dev, "need %d blobs\n", need_blobs);
289 packet_id = header->packet_id; 289 packet_id = le32_to_cpu(header->packet_id);
290 } 290 }
291 291
292 /* 292 /*
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index ad7564296ddf..68beadaabceb 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -52,6 +52,7 @@ struct titsc {
52 u32 config_inp[4]; 52 u32 config_inp[4];
53 u32 bit_xp, bit_xn, bit_yp, bit_yn; 53 u32 bit_xp, bit_xn, bit_yp, bit_yn;
54 u32 inp_xp, inp_xn, inp_yp, inp_yn; 54 u32 inp_xp, inp_xn, inp_yp, inp_yn;
55 u32 step_mask;
55}; 56};
56 57
57static unsigned int titsc_readl(struct titsc *ts, unsigned int reg) 58static unsigned int titsc_readl(struct titsc *ts, unsigned int reg)
@@ -196,7 +197,8 @@ static void titsc_step_config(struct titsc *ts_dev)
196 197
197 /* The steps1 … end and bit 0 for TS_Charge */ 198 /* The steps1 … end and bit 0 for TS_Charge */
198 stepenable = (1 << (end_step + 2)) - 1; 199 stepenable = (1 << (end_step + 2)) - 1;
199 am335x_tsc_se_set(ts_dev->mfd_tscadc, stepenable); 200 ts_dev->step_mask = stepenable;
201 am335x_tsc_se_set(ts_dev->mfd_tscadc, ts_dev->step_mask);
200} 202}
201 203
202static void titsc_read_coordinates(struct titsc *ts_dev, 204static void titsc_read_coordinates(struct titsc *ts_dev,
@@ -260,6 +262,10 @@ static irqreturn_t titsc_irq(int irq, void *dev)
260 unsigned int fsm; 262 unsigned int fsm;
261 263
262 status = titsc_readl(ts_dev, REG_IRQSTATUS); 264 status = titsc_readl(ts_dev, REG_IRQSTATUS);
265 /*
266 * ADC and touchscreen share the IRQ line.
267 * FIFO1 interrupts are used by ADC. Handle FIFO0 IRQs here only
268 */
263 if (status & IRQENB_FIFO0THRES) { 269 if (status & IRQENB_FIFO0THRES) {
264 270
265 titsc_read_coordinates(ts_dev, &x, &y, &z1, &z2); 271 titsc_read_coordinates(ts_dev, &x, &y, &z1, &z2);
@@ -316,7 +322,7 @@ static irqreturn_t titsc_irq(int irq, void *dev)
316 322
317 if (irqclr) { 323 if (irqclr) {
318 titsc_writel(ts_dev, REG_IRQSTATUS, irqclr); 324 titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
319 am335x_tsc_se_update(ts_dev->mfd_tscadc); 325 am335x_tsc_se_set(ts_dev->mfd_tscadc, ts_dev->step_mask);
320 return IRQ_HANDLED; 326 return IRQ_HANDLED;
321 } 327 }
322 return IRQ_NONE; 328 return IRQ_NONE;
@@ -396,7 +402,7 @@ static int titsc_probe(struct platform_device *pdev)
396 } 402 }
397 403
398 err = request_irq(ts_dev->irq, titsc_irq, 404 err = request_irq(ts_dev->irq, titsc_irq,
399 0, pdev->dev.driver->name, ts_dev); 405 IRQF_SHARED, pdev->dev.driver->name, ts_dev);
400 if (err) { 406 if (err) {
401 dev_err(&pdev->dev, "failed to allocate irq.\n"); 407 dev_err(&pdev->dev, "failed to allocate irq.\n");
402 goto err_free_mem; 408 goto err_free_mem;
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 721fdb3597ca..5f87bed05467 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -106,6 +106,7 @@ struct usbtouch_device_info {
106struct usbtouch_usb { 106struct usbtouch_usb {
107 unsigned char *data; 107 unsigned char *data;
108 dma_addr_t data_dma; 108 dma_addr_t data_dma;
109 int data_size;
109 unsigned char *buffer; 110 unsigned char *buffer;
110 int buf_len; 111 int buf_len;
111 struct urb *irq; 112 struct urb *irq;
@@ -146,12 +147,10 @@ enum {
146 147
147#define USB_DEVICE_HID_CLASS(vend, prod) \ 148#define USB_DEVICE_HID_CLASS(vend, prod) \
148 .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ 149 .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \
149 | USB_DEVICE_ID_MATCH_INT_PROTOCOL \
150 | USB_DEVICE_ID_MATCH_DEVICE, \ 150 | USB_DEVICE_ID_MATCH_DEVICE, \
151 .idVendor = (vend), \ 151 .idVendor = (vend), \
152 .idProduct = (prod), \ 152 .idProduct = (prod), \
153 .bInterfaceClass = USB_INTERFACE_CLASS_HID, \ 153 .bInterfaceClass = USB_INTERFACE_CLASS_HID
154 .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_MOUSE
155 154
156static const struct usb_device_id usbtouch_devices[] = { 155static const struct usb_device_id usbtouch_devices[] = {
157#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX 156#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
@@ -1523,7 +1522,7 @@ static int usbtouch_reset_resume(struct usb_interface *intf)
1523static void usbtouch_free_buffers(struct usb_device *udev, 1522static void usbtouch_free_buffers(struct usb_device *udev,
1524 struct usbtouch_usb *usbtouch) 1523 struct usbtouch_usb *usbtouch)
1525{ 1524{
1526 usb_free_coherent(udev, usbtouch->type->rept_size, 1525 usb_free_coherent(udev, usbtouch->data_size,
1527 usbtouch->data, usbtouch->data_dma); 1526 usbtouch->data, usbtouch->data_dma);
1528 kfree(usbtouch->buffer); 1527 kfree(usbtouch->buffer);
1529} 1528}
@@ -1568,7 +1567,20 @@ static int usbtouch_probe(struct usb_interface *intf,
1568 if (!type->process_pkt) 1567 if (!type->process_pkt)
1569 type->process_pkt = usbtouch_process_pkt; 1568 type->process_pkt = usbtouch_process_pkt;
1570 1569
1571 usbtouch->data = usb_alloc_coherent(udev, type->rept_size, 1570 usbtouch->data_size = type->rept_size;
1571 if (type->get_pkt_len) {
1572 /*
1573 * When dealing with variable-length packets we should
1574 * not request more than wMaxPacketSize bytes at once
1575 * as we do not know if there is more data coming or
1576 * we filled exactly wMaxPacketSize bytes and there is
1577 * nothing else.
1578 */
1579 usbtouch->data_size = min(usbtouch->data_size,
1580 usb_endpoint_maxp(endpoint));
1581 }
1582
1583 usbtouch->data = usb_alloc_coherent(udev, usbtouch->data_size,
1572 GFP_KERNEL, &usbtouch->data_dma); 1584 GFP_KERNEL, &usbtouch->data_dma);
1573 if (!usbtouch->data) 1585 if (!usbtouch->data)
1574 goto out_free; 1586 goto out_free;
@@ -1628,12 +1640,12 @@ static int usbtouch_probe(struct usb_interface *intf,
1628 if (usb_endpoint_type(endpoint) == USB_ENDPOINT_XFER_INT) 1640 if (usb_endpoint_type(endpoint) == USB_ENDPOINT_XFER_INT)
1629 usb_fill_int_urb(usbtouch->irq, udev, 1641 usb_fill_int_urb(usbtouch->irq, udev,
1630 usb_rcvintpipe(udev, endpoint->bEndpointAddress), 1642 usb_rcvintpipe(udev, endpoint->bEndpointAddress),
1631 usbtouch->data, type->rept_size, 1643 usbtouch->data, usbtouch->data_size,
1632 usbtouch_irq, usbtouch, endpoint->bInterval); 1644 usbtouch_irq, usbtouch, endpoint->bInterval);
1633 else 1645 else
1634 usb_fill_bulk_urb(usbtouch->irq, udev, 1646 usb_fill_bulk_urb(usbtouch->irq, udev,
1635 usb_rcvbulkpipe(udev, endpoint->bEndpointAddress), 1647 usb_rcvbulkpipe(udev, endpoint->bEndpointAddress),
1636 usbtouch->data, type->rept_size, 1648 usbtouch->data, usbtouch->data_size,
1637 usbtouch_irq, usbtouch); 1649 usbtouch_irq, usbtouch);
1638 1650
1639 usbtouch->irq->dev = udev; 1651 usbtouch->irq->dev = udev;