summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/input/touchscreen
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/input/touchscreen')
-rw-r--r--kernel/drivers/input/touchscreen/elants_i2c.c4
-rw-r--r--kernel/drivers/input/touchscreen/sur40.c5
-rw-r--r--kernel/drivers/input/touchscreen/tsc2004.c7
-rw-r--r--kernel/drivers/input/touchscreen/tsc2005.c7
-rw-r--r--kernel/drivers/input/touchscreen/tsc200x-core.c15
-rw-r--r--kernel/drivers/input/touchscreen/tsc200x-core.h2
-rw-r--r--kernel/drivers/input/touchscreen/wacom_w8001.c2
-rw-r--r--kernel/drivers/input/touchscreen/zforce_ts.c4
8 files changed, 33 insertions, 13 deletions
diff --git a/kernel/drivers/input/touchscreen/elants_i2c.c b/kernel/drivers/input/touchscreen/elants_i2c.c
index ac09855fa..486f8fe24 100644
--- a/kernel/drivers/input/touchscreen/elants_i2c.c
+++ b/kernel/drivers/input/touchscreen/elants_i2c.c
@@ -905,9 +905,9 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev)
case QUEUE_HEADER_NORMAL:
report_count = ts->buf[FW_HDR_COUNT];
- if (report_count > 3) {
+ if (report_count == 0 || report_count > 3) {
dev_err(&client->dev,
- "too large report count: %*ph\n",
+ "bad report count: %*ph\n",
HEADER_SIZE, ts->buf);
break;
}
diff --git a/kernel/drivers/input/touchscreen/sur40.c b/kernel/drivers/input/touchscreen/sur40.c
index d214f22ed..45b466e3b 100644
--- a/kernel/drivers/input/touchscreen/sur40.c
+++ b/kernel/drivers/input/touchscreen/sur40.c
@@ -126,7 +126,7 @@ struct sur40_image_header {
#define VIDEO_PACKET_SIZE 16384
/* polling interval (ms) */
-#define POLL_INTERVAL 4
+#define POLL_INTERVAL 1
/* maximum number of contacts FIXME: this is a guess? */
#define MAX_CONTACTS 64
@@ -441,7 +441,7 @@ static void sur40_process_video(struct sur40_state *sur40)
/* return error if streaming was stopped in the meantime */
if (sur40->sequence == -1)
- goto err_poll;
+ return;
/* mark as finished */
v4l2_get_timestamp(&new_buf->vb.timestamp);
@@ -730,6 +730,7 @@ static int sur40_start_streaming(struct vb2_queue *vq, unsigned int count)
static void sur40_stop_streaming(struct vb2_queue *vq)
{
struct sur40_state *sur40 = vb2_get_drv_priv(vq);
+ vb2_wait_for_all_buffers(vq);
sur40->sequence = -1;
/* Release all active buffers */
diff --git a/kernel/drivers/input/touchscreen/tsc2004.c b/kernel/drivers/input/touchscreen/tsc2004.c
index 7295c198a..6fe55d598 100644
--- a/kernel/drivers/input/touchscreen/tsc2004.c
+++ b/kernel/drivers/input/touchscreen/tsc2004.c
@@ -22,6 +22,11 @@
#include <linux/regmap.h>
#include "tsc200x-core.h"
+static const struct input_id tsc2004_input_id = {
+ .bustype = BUS_I2C,
+ .product = 2004,
+};
+
static int tsc2004_cmd(struct device *dev, u8 cmd)
{
u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd;
@@ -42,7 +47,7 @@ static int tsc2004_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
- return tsc200x_probe(&i2c->dev, i2c->irq, BUS_I2C,
+ return tsc200x_probe(&i2c->dev, i2c->irq, &tsc2004_input_id,
devm_regmap_init_i2c(i2c, &tsc200x_regmap_config),
tsc2004_cmd);
}
diff --git a/kernel/drivers/input/touchscreen/tsc2005.c b/kernel/drivers/input/touchscreen/tsc2005.c
index b9f593dfd..f2c5f0e47 100644
--- a/kernel/drivers/input/touchscreen/tsc2005.c
+++ b/kernel/drivers/input/touchscreen/tsc2005.c
@@ -24,6 +24,11 @@
#include <linux/regmap.h>
#include "tsc200x-core.h"
+static const struct input_id tsc2005_input_id = {
+ .bustype = BUS_SPI,
+ .product = 2005,
+};
+
static int tsc2005_cmd(struct device *dev, u8 cmd)
{
u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd;
@@ -62,7 +67,7 @@ static int tsc2005_probe(struct spi_device *spi)
if (error)
return error;
- return tsc200x_probe(&spi->dev, spi->irq, BUS_SPI,
+ return tsc200x_probe(&spi->dev, spi->irq, &tsc2005_input_id,
devm_regmap_init_spi(spi, &tsc200x_regmap_config),
tsc2005_cmd);
}
diff --git a/kernel/drivers/input/touchscreen/tsc200x-core.c b/kernel/drivers/input/touchscreen/tsc200x-core.c
index 15240c1ee..dfa7f1c4f 100644
--- a/kernel/drivers/input/touchscreen/tsc200x-core.c
+++ b/kernel/drivers/input/touchscreen/tsc200x-core.c
@@ -450,7 +450,7 @@ static void tsc200x_close(struct input_dev *input)
mutex_unlock(&ts->mutex);
}
-int tsc200x_probe(struct device *dev, int irq, __u16 bustype,
+int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
struct regmap *regmap,
int (*tsc200x_cmd)(struct device *dev, u8 cmd))
{
@@ -547,9 +547,18 @@ int tsc200x_probe(struct device *dev, int irq, __u16 bustype,
snprintf(ts->phys, sizeof(ts->phys),
"%s/input-ts", dev_name(dev));
- input_dev->name = "TSC200X touchscreen";
+ if (tsc_id->product == 2004) {
+ input_dev->name = "TSC200X touchscreen";
+ } else {
+ input_dev->name = devm_kasprintf(dev, GFP_KERNEL,
+ "TSC%04d touchscreen",
+ tsc_id->product);
+ if (!input_dev->name)
+ return -ENOMEM;
+ }
+
input_dev->phys = ts->phys;
- input_dev->id.bustype = bustype;
+ input_dev->id = *tsc_id;
input_dev->dev.parent = dev;
input_dev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY);
input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
diff --git a/kernel/drivers/input/touchscreen/tsc200x-core.h b/kernel/drivers/input/touchscreen/tsc200x-core.h
index 7a482d102..49a63a3c6 100644
--- a/kernel/drivers/input/touchscreen/tsc200x-core.h
+++ b/kernel/drivers/input/touchscreen/tsc200x-core.h
@@ -70,7 +70,7 @@
extern const struct regmap_config tsc200x_regmap_config;
extern const struct dev_pm_ops tsc200x_pm_ops;
-int tsc200x_probe(struct device *dev, int irq, __u16 bustype,
+int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
struct regmap *regmap,
int (*tsc200x_cmd)(struct device *dev, u8 cmd));
int tsc200x_remove(struct device *dev);
diff --git a/kernel/drivers/input/touchscreen/wacom_w8001.c b/kernel/drivers/input/touchscreen/wacom_w8001.c
index 2792ca397..3ed0ce1e4 100644
--- a/kernel/drivers/input/touchscreen/wacom_w8001.c
+++ b/kernel/drivers/input/touchscreen/wacom_w8001.c
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Jaya Kumar <jayakumar.lkml@gmail.com>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
-#define W8001_MAX_LENGTH 11
+#define W8001_MAX_LENGTH 13
#define W8001_LEAD_MASK 0x80
#define W8001_LEAD_BYTE 0x80
#define W8001_TAB_MASK 0x40
diff --git a/kernel/drivers/input/touchscreen/zforce_ts.c b/kernel/drivers/input/touchscreen/zforce_ts.c
index 9bbadaaf6..7b3845aa5 100644
--- a/kernel/drivers/input/touchscreen/zforce_ts.c
+++ b/kernel/drivers/input/touchscreen/zforce_ts.c
@@ -370,8 +370,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
point.coord_x = point.coord_y = 0;
}
- point.state = payload[9 * i + 5] & 0x03;
- point.id = (payload[9 * i + 5] & 0xfc) >> 2;
+ point.state = payload[9 * i + 5] & 0x0f;
+ point.id = (payload[9 * i + 5] & 0xf0) >> 4;
/* determine touch major, minor and orientation */
point.area_major = max(payload[9 * i + 6],