aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-24 13:45:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-24 13:45:29 -0500
commit76ae076f99a6f4538f8d6f06be9b87ecafc00a97 (patch)
treeda40601977dacba29f3fcbd87425f0c5c759906b /drivers/input/touchscreen
parent4c1cc40a2d49500d84038ff751bc6cd183e729b5 (diff)
parent5cf0eb9875cb26ebdc60d08444272b2ea219386e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "A new driver for Surface 2.0/Pixelsense touchscreen and a couple of driver fixups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: MAINTAINERS - add keyboard driver to Hyper-V file list Input: atmel-wm97xx - fix compile error Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer() Input: cyttsp4 - remove unnecessary work pending test Input: add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/Kconfig11
-rw-r--r--drivers/input/touchscreen/Makefile1
-rw-r--r--drivers/input/touchscreen/atmel-wm97xx.c2
-rw-r--r--drivers/input/touchscreen/cyttsp4_core.c3
-rw-r--r--drivers/input/touchscreen/sur40.c466
5 files changed, 480 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 00d1e547b211..961d58d32647 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -906,6 +906,17 @@ config TOUCHSCREEN_STMPE
906 To compile this driver as a module, choose M here: the 906 To compile this driver as a module, choose M here: the
907 module will be called stmpe-ts. 907 module will be called stmpe-ts.
908 908
909config TOUCHSCREEN_SUR40
910 tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen"
911 depends on USB
912 select INPUT_POLLDEV
913 help
914 Say Y here if you want support for the Samsung SUR40 touchscreen
915 (also known as Microsoft Surface 2.0 or Microsoft PixelSense).
916
917 To compile this driver as a module, choose M here: the
918 module will be called sur40.
919
909config TOUCHSCREEN_TPS6507X 920config TOUCHSCREEN_TPS6507X
910 tristate "TPS6507x based touchscreens" 921 tristate "TPS6507x based touchscreens"
911 depends on I2C 922 depends on I2C
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 7587883b8d38..62801f213346 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -54,6 +54,7 @@ obj-$(CONFIG_TOUCHSCREEN_PIXCIR) += pixcir_i2c_ts.o
54obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o 54obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
55obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o 55obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o
56obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o 56obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o
57obj-$(CONFIG_TOUCHSCREEN_SUR40) += sur40.o
57obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o 58obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o
58obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o 59obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o
59obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o 60obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o
diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c
index 268a35e55d7f..279c0e42b8a7 100644
--- a/drivers/input/touchscreen/atmel-wm97xx.c
+++ b/drivers/input/touchscreen/atmel-wm97xx.c
@@ -391,7 +391,7 @@ static int __exit atmel_wm97xx_remove(struct platform_device *pdev)
391} 391}
392 392
393#ifdef CONFIG_PM_SLEEP 393#ifdef CONFIG_PM_SLEEP
394static int atmel_wm97xx_suspend(struct *dev) 394static int atmel_wm97xx_suspend(struct device *dev)
395{ 395{
396 struct platform_device *pdev = to_platform_device(dev); 396 struct platform_device *pdev = to_platform_device(dev);
397 struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev); 397 struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev);
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index 42d830efa316..a035a390f8e2 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -1246,8 +1246,7 @@ static void cyttsp4_watchdog_timer(unsigned long handle)
1246 1246
1247 dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__); 1247 dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__);
1248 1248
1249 if (!work_pending(&cd->watchdog_work)) 1249 schedule_work(&cd->watchdog_work);
1250 schedule_work(&cd->watchdog_work);
1251 1250
1252 return; 1251 return;
1253} 1252}
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
new file mode 100644
index 000000000000..cfd1b7e8c001
--- /dev/null
+++ b/drivers/input/touchscreen/sur40.c
@@ -0,0 +1,466 @@
1/*
2 * Surface2.0/SUR40/PixelSense input driver
3 *
4 * Copyright (c) 2013 by Florian 'floe' Echtler <floe@butterbrot.org>
5 *
6 * Derived from the USB Skeleton driver 1.1,
7 * Copyright (c) 2003 Greg Kroah-Hartman (greg@kroah.com)
8 *
9 * and from the Apple USB BCM5974 multitouch driver,
10 * Copyright (c) 2008 Henrik Rydberg (rydberg@euromail.se)
11 *
12 * and from the generic hid-multitouch driver,
13 * Copyright (c) 2010-2012 Stephane Chatty <chatty@enac.fr>
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 */
20
21#include <linux/kernel.h>
22#include <linux/errno.h>
23#include <linux/delay.h>
24#include <linux/init.h>
25#include <linux/slab.h>
26#include <linux/module.h>
27#include <linux/completion.h>
28#include <linux/uaccess.h>
29#include <linux/usb.h>
30#include <linux/printk.h>
31#include <linux/input-polldev.h>
32#include <linux/input/mt.h>
33#include <linux/usb/input.h>
34
35/* read 512 bytes from endpoint 0x86 -> get header + blobs */
36struct sur40_header {
37
38 __le16 type; /* always 0x0001 */
39 __le16 count; /* count of blobs (if 0: continue prev. packet) */
40
41 __le32 packet_id; /* unique ID for all packets in one frame */
42
43 __le32 timestamp; /* milliseconds (inc. by 16 or 17 each frame) */
44 __le32 unknown; /* "epoch?" always 02/03 00 00 00 */
45
46} __packed;
47
48struct sur40_blob {
49
50 __le16 blob_id;
51
52 u8 action; /* 0x02 = enter/exit, 0x03 = update (?) */
53 u8 unknown; /* always 0x01 or 0x02 (no idea what this is?) */
54
55 __le16 bb_pos_x; /* upper left corner of bounding box */
56 __le16 bb_pos_y;
57
58 __le16 bb_size_x; /* size of bounding box */
59 __le16 bb_size_y;
60
61 __le16 pos_x; /* finger tip position */
62 __le16 pos_y;
63
64 __le16 ctr_x; /* centroid position */
65 __le16 ctr_y;
66
67 __le16 axis_x; /* somehow related to major/minor axis, mostly: */
68 __le16 axis_y; /* axis_x == bb_size_y && axis_y == bb_size_x */
69
70 __le32 angle; /* orientation in radians relative to x axis -
71 actually an IEEE754 float, don't use in kernel */
72
73 __le32 area; /* size in pixels/pressure (?) */
74
75 u8 padding[32];
76
77} __packed;
78
79/* combined header/blob data */
80struct sur40_data {
81 struct sur40_header header;
82 struct sur40_blob blobs[];
83} __packed;
84
85
86/* version information */
87#define DRIVER_SHORT "sur40"
88#define DRIVER_AUTHOR "Florian 'floe' Echtler <floe@butterbrot.org>"
89#define DRIVER_DESC "Surface2.0/SUR40/PixelSense input driver"
90
91/* vendor and device IDs */
92#define ID_MICROSOFT 0x045e
93#define ID_SUR40 0x0775
94
95/* sensor resolution */
96#define SENSOR_RES_X 1920
97#define SENSOR_RES_Y 1080
98
99/* touch data endpoint */
100#define TOUCH_ENDPOINT 0x86
101
102/* polling interval (ms) */
103#define POLL_INTERVAL 10
104
105/* maximum number of contacts FIXME: this is a guess? */
106#define MAX_CONTACTS 64
107
108/* control commands */
109#define SUR40_GET_VERSION 0xb0 /* 12 bytes string */
110#define SUR40_UNKNOWN1 0xb3 /* 5 bytes */
111#define SUR40_UNKNOWN2 0xc1 /* 24 bytes */
112
113#define SUR40_GET_STATE 0xc5 /* 4 bytes state (?) */
114#define SUR40_GET_SENSORS 0xb1 /* 8 bytes sensors */
115