aboutsummaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorMichael Roth <mroth@nessie.de>2009-05-18 16:04:44 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-19 19:24:54 -0700
commit86579a4cccf18a2ddbf7de8fc5a0f5d9b94ed76d (patch)
treeb41377e0d2802dcf58f0ced3e895532fc01a7cca /drivers/input
parent225c9886b9f873b219d1109148661b38da99a1ee (diff)
Input: ads7846 - support swapping x and y axes
Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ads7846.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 2b01e56568f..b5ad252f5cf 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -97,6 +97,8 @@ struct ads7846 {
u16 x_plate_ohms;
u16 pressure_max;
+ bool swap_xy;
+
struct ads7846_packet *packet;
struct spi_transfer xfer[18];
@@ -599,6 +601,10 @@ static void ads7846_rx(void *ads)
dev_dbg(&ts->spi->dev, "DOWN\n");
#endif
}
+
+ if (ts->swap_xy)
+ swap(x, y);
+
input_report_abs(input, ABS_X, x);
input_report_abs(input, ABS_Y, y);
input_report_abs(input, ABS_PRESSURE, Rt);
@@ -917,6 +923,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
ts->spi = spi;
ts->input = input_dev;
ts->vref_mv = pdata->vref_mv;
+ ts->swap_xy = pdata->swap_xy;
hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ts->timer.function = ads7846_timer;