Skip to content

Commit

Permalink
Input: synaptics-rmi4 - switch to reduced reporting mode
Browse files Browse the repository at this point in the history
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 <l.stach@pengutronix.de>
Reviewed-by: Andrew Duggan <aduggan@synaptics.com>
Link: https://lore.kernel.org/r/20200120111628.18376-1-l.stach@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Lucas Stach authored and Dmitry Torokhov committed Feb 1, 2020
1 parent f61023d commit c5ccf2a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/input/rmi4/rmi_f11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c5ccf2a

Please sign in to comment.