diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-01-15 15:23:05 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-01-15 15:41:00 -0800 |
commit | 630a7fa0480bec63e0a300b8485642630340efcf (patch) | |
tree | 8173958ed106d86938cfbe84aed43b367c64fe83 /drivers/input/rmi4 | |
parent | 3a11c0e1f1394e9d871dd8e68f9ce01d7c96e28d (diff) | |
download | linux-630a7fa0480bec63e0a300b8485642630340efcf.tar.gz linux-630a7fa0480bec63e0a300b8485642630340efcf.tar.bz2 linux-630a7fa0480bec63e0a300b8485642630340efcf.zip |
Input: synaptics-rmi4 - correctly swap clip values if axes are swapped
The clip values need the same swapping as the maximum values if the
sensor axes are swapped.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/rmi4')
-rw-r--r-- | drivers/input/rmi4/rmi_2d_sensor.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c index 07007ff8e29f..8bb866c7b985 100644 --- a/drivers/input/rmi4/rmi_2d_sensor.c +++ b/drivers/input/rmi4/rmi_2d_sensor.c @@ -144,8 +144,13 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) int input_flags = 0; if (sensor->report_abs) { - if (sensor->axis_align.swap_axes) + if (sensor->axis_align.swap_axes) { swap(sensor->max_x, sensor->max_y); + swap(sensor->axis_align.clip_x_low, + sensor->axis_align.clip_y_low); + swap(sensor->axis_align.clip_x_high, + sensor->axis_align.clip_y_high); + } sensor->min_x = sensor->axis_align.clip_x_low; if (sensor->axis_align.clip_x_high) |