]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Input: synaptics-rmi4 - set reduced reporting mode only when requested
authorAndrew Duggan <aduggan@synaptics.com>
Tue, 24 Mar 2020 22:38:51 +0000 (15:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 24 Mar 2020 22:45:18 +0000 (15:45 -0700)
The previous patch "e81fc4b45519 (Input: synaptics-rmi4 - switch to
reduced reporting mode)" enabled reduced reporting mode unintentionally
on some devices, if the firmware was configured with default Delta X/Y
threshold values. The result unintentionally degrade the performance of
some touchpads.

This patch checks to see that the driver is modifying the delta X/Y
thresholds before modifying the reporting mode.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Fixes: e81fc4b45519 ("Input: synaptics-rmi4 - switch to reduced reporting mode")
Link: https://lore.kernel.org/r/20200312005549.29922-1-aduggan@synaptics.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/rmi4/rmi_f11.c

index 6adea8a3e8fb776fccc68a490f99e8bc8d0654ff..ffa39ab153f2a3ab870ecc65158af64caa5189c7 100644 (file)
@@ -1203,8 +1203,8 @@ static int rmi_f11_initialize(struct rmi_function *fn)
         * If distance threshold values are set, switch to reduced reporting
         * mode so they actually get used by the controller.
         */
-       if (ctrl->ctrl0_11[RMI_F11_DELTA_X_THRESHOLD] ||
-           ctrl->ctrl0_11[RMI_F11_DELTA_Y_THRESHOLD]) {
+       if (sensor->axis_align.delta_x_threshold ||
+           sensor->axis_align.delta_y_threshold) {
                ctrl->ctrl0_11[0] &= ~RMI_F11_REPORT_MODE_MASK;
                ctrl->ctrl0_11[0] |= RMI_F11_REPORT_MODE_REDUCED;
        }