Skip to content

Commit c5ccf2a

Browse files
lynxeye-devdtor
authored andcommitted
Input: synaptics-rmi4 - switch to reduced reporting mode
When the distance thresholds are set the controller must be in reduced reporting mode for them to have any effect on the interrupt generation. This has a potentially large impact on the number of events the host needs to process. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Andrew Duggan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent f61023d commit c5ccf2a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/input/rmi4/rmi_f11.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,10 @@ struct f11_2d_sensor_queries {
412412

413413
/* Defs for Ctrl0. */
414414
#define RMI_F11_REPORT_MODE_MASK 0x07
415+
#define RMI_F11_REPORT_MODE_CONTINUOUS (0 << 0)
416+
#define RMI_F11_REPORT_MODE_REDUCED (1 << 0)
417+
#define RMI_F11_REPORT_MODE_FS_CHANGE (2 << 0)
418+
#define RMI_F11_REPORT_MODE_FP_CHANGE (3 << 0)
415419
#define RMI_F11_ABS_POS_FILT (1 << 3)
416420
#define RMI_F11_REL_POS_FILT (1 << 4)
417421
#define RMI_F11_REL_BALLISTICS (1 << 5)
@@ -1195,6 +1199,16 @@ static int rmi_f11_initialize(struct rmi_function *fn)
11951199
ctrl->ctrl0_11[RMI_F11_DELTA_Y_THRESHOLD] =
11961200
sensor->axis_align.delta_y_threshold;
11971201

1202+
/*
1203+
* If distance threshold values are set, switch to reduced reporting
1204+
* mode so they actually get used by the controller.
1205+
*/
1206+
if (ctrl->ctrl0_11[RMI_F11_DELTA_X_THRESHOLD] ||
1207+
ctrl->ctrl0_11[RMI_F11_DELTA_Y_THRESHOLD]) {
1208+
ctrl->ctrl0_11[0] &= ~RMI_F11_REPORT_MODE_MASK;
1209+
ctrl->ctrl0_11[0] |= RMI_F11_REPORT_MODE_REDUCED;
1210+
}
1211+
11981212
if (f11->sens_query.has_dribble) {
11991213
switch (sensor->dribble) {
12001214
case RMI_REG_STATE_OFF:

0 commit comments

Comments
 (0)