]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/input/rmi4/rmi_f11.c
Input: goldfish_events - replace zero-length array with flexible-array member
[linux.git] / drivers / input / rmi4 / rmi_f11.c
index bbf9ae9f3f0cbfa98144cbe6560db3fcbd425cf9..6adea8a3e8fb776fccc68a490f99e8bc8d0654ff 100644 (file)
@@ -412,6 +412,10 @@ struct f11_2d_sensor_queries {
 
 /* Defs for Ctrl0. */
 #define RMI_F11_REPORT_MODE_MASK        0x07
+#define RMI_F11_REPORT_MODE_CONTINUOUS  (0 << 0)
+#define RMI_F11_REPORT_MODE_REDUCED     (1 << 0)
+#define RMI_F11_REPORT_MODE_FS_CHANGE   (2 << 0)
+#define RMI_F11_REPORT_MODE_FP_CHANGE   (3 << 0)
 #define RMI_F11_ABS_POS_FILT            (1 << 3)
 #define RMI_F11_REL_POS_FILT            (1 << 4)
 #define RMI_F11_REL_BALLISTICS          (1 << 5)
@@ -1195,6 +1199,16 @@ static int rmi_f11_initialize(struct rmi_function *fn)
                ctrl->ctrl0_11[RMI_F11_DELTA_Y_THRESHOLD] =
                        sensor->axis_align.delta_y_threshold;
 
+       /*
+        * 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]) {
+               ctrl->ctrl0_11[0] &= ~RMI_F11_REPORT_MODE_MASK;
+               ctrl->ctrl0_11[0] |= RMI_F11_REPORT_MODE_REDUCED;
+       }
+
        if (f11->sens_query.has_dribble) {
                switch (sensor->dribble) {
                case RMI_REG_STATE_OFF: