summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorPhilip Rakity <prakity@marvell.com>2011-10-11 20:54:55 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-10-11 20:56:41 -0700
commit341deefe8f4584b09564193cb46d8cf386f491a5 (patch)
tree6610d3c3c0306e3b1a8e82552f5e426818ff5a57 /drivers/input
parent550eca7cafa1c6e2c077afb2211a364a982d8645 (diff)
downloadlinux-341deefe8f4584b09564193cb46d8cf386f491a5.tar.bz2
Input: tsc2007 - make sure that X plate resistance is specified
Abort driver initialization if X plate resistance was not specified in platform data as it will cause pressure to be always calculated as 0, and making userspace ignore touch coordinates. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/tsc2007.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 0acca68cc52b..1f674cb6c55b 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -310,6 +310,12 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
ts->get_pendown_state = pdata->get_pendown_state;
ts->clear_penirq = pdata->clear_penirq;
+ if (pdata->x_plate_ohms == 0) {
+ dev_err(&client->dev, "x_plate_ohms is not set up in platform data");
+ err = -EINVAL;
+ goto err_free_mem;
+ }
+
snprintf(ts->phys, sizeof(ts->phys),
"%s/input0", dev_name(&client->dev));