summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2013-10-24 14:58:29 -0700
committerEric Nelson <eric.nelson@boundarydevices.com>2013-10-24 15:08:24 -0700
commitab2dc36ae395a374f62278f4c51bf36671b73add (patch)
tree5401d7863f97880bbbab7d7ea103a6305558f42d /drivers
parent424b30d3417bc8b82eb2e94f3c134292229837aa (diff)
ft5x06: Add screenres parameter, use it to publish ranges
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/ft5x06_ts.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/ft5x06_ts.c b/drivers/input/touchscreen/ft5x06_ts.c
index 5168739ec3a1..f52b36bf7392 100644
--- a/drivers/input/touchscreen/ft5x06_ts.c
+++ b/drivers/input/touchscreen/ft5x06_ts.c
@@ -36,9 +36,16 @@
#define USE_ABS_MT
#endif
-static int calibration[7];
+static int calibration[7] = {
+ 65536,0,0,
+ 0,65536,0,
+ 65536
+};
module_param_array(calibration, int, NULL, S_IRUGO | S_IWUSR);
+static int screenres[2] = {1024, 600};
+module_param_array(screenres, int, NULL, S_IRUGO | S_IWUSR);
+
static void translate(int *px, int *py)
{
int x, y, x1, y1;
@@ -162,13 +169,15 @@ static inline int ts_register(struct ft5x06_ts *ts)
__set_bit(BTN_TOUCH, idev->keybit);
#ifdef USE_ABS_MT
- input_set_abs_params(idev, ABS_MT_POSITION_X, 0, 1023, 0, 0);
- input_set_abs_params(idev, ABS_MT_POSITION_Y, 0, 0x255, 0, 0);
+ input_set_abs_params(idev, ABS_MT_POSITION_X, 0, screenres[0]-1, 0, 0);
+ input_set_abs_params(idev, ABS_MT_POSITION_Y, 0, screenres[1]-1, 0, 0);
+ input_set_abs_params(idev, ABS_X, 0, screenres[0]-1, 0, 0);
+ input_set_abs_params(idev, ABS_Y, 0, screenres[1]-1, 0, 0);
input_set_abs_params(idev, ABS_MT_TOUCH_MAJOR, 0, 1, 0, 0);
#else
__set_bit(EV_SYN, idev->evbit);
- input_set_abs_params(idev, ABS_X, 0, 1023, 0, 0);
- input_set_abs_params(idev, ABS_Y, 0, 0x255, 0, 0);
+ input_set_abs_params(idev, ABS_X, 0, screenres[0]-1, 0, 0);
+ input_set_abs_params(idev, ABS_Y, 0, screenres[1]-1, 0, 0);
input_set_abs_params(idev, ABS_PRESSURE, 0, 1, 0, 0);
#endif