From: Lucas Stach Date: Sun, 15 Jan 2017 23:23:05 +0000 (-0800) Subject: Input: synaptics-rmi4 - correctly swap clip values if axes are swapped X-Git-Tag: pci-v4.11-fixes-1~26^2^2~13^2~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=630a7fa0480bec63e0a300b8485642630340efcf;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c index 07007ff8e29ff..8bb866c7b9855 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)