Takashi Iwai a29470
From 73cca71a903202cddc8279fc76b2da4995da5bea Mon Sep 17 00:00:00 2001
Takashi Iwai a29470
From: Dario Binacchi <dariobin@libero.it>
Takashi Iwai a29470
Date: Sun, 12 Dec 2021 21:14:35 -0800
Takashi Iwai a29470
Subject: [PATCH] Input: ti_am335x_tsc - set ADCREFM for X configuration
Takashi Iwai a29470
Git-commit: 73cca71a903202cddc8279fc76b2da4995da5bea
Takashi Iwai a29470
Patch-mainline: v5.17-rc1
Takashi Iwai a29470
References: git-fixes
Takashi Iwai a29470
Takashi Iwai a29470
As reported by the STEPCONFIG[1-16] registered field descriptions of the
Takashi Iwai a29470
TI reference manual, for the ADC "in single ended, SEL_INM_SWC_3_0 must
Takashi Iwai a29470
be 1xxx".
Takashi Iwai a29470
Takashi Iwai a29470
Unlike the Y and Z coordinates, this bit has not been set for the step
Takashi Iwai a29470
configuration registers used to sample the X coordinate.
Takashi Iwai a29470
Takashi Iwai a29470
Fixes: 1b8be32e6914 ("Input: add support for TI Touchscreen controller")
Takashi Iwai a29470
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Takashi Iwai a29470
Link: https://lore.kernel.org/r/20211212125358.14416-2-dariobin@libero.it
Takashi Iwai a29470
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Takashi Iwai a29470
Acked-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai a29470
Takashi Iwai a29470
---
Takashi Iwai a29470
 drivers/input/touchscreen/ti_am335x_tsc.c | 3 ++-
Takashi Iwai a29470
 1 file changed, 2 insertions(+), 1 deletion(-)
Takashi Iwai a29470
Takashi Iwai a29470
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
Takashi Iwai a29470
index 83e685557a19..fd3ffdd23470 100644
Takashi Iwai a29470
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
Takashi Iwai a29470
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
Takashi Iwai a29470
@@ -131,7 +131,8 @@ static void titsc_step_config(struct titsc *ts_dev)
Takashi Iwai a29470
 	u32 stepenable;
Takashi Iwai a29470
 
Takashi Iwai a29470
 	config = STEPCONFIG_MODE_HWSYNC |
Takashi Iwai a29470
-			STEPCONFIG_AVG_16 | ts_dev->bit_xp;
Takashi Iwai a29470
+			STEPCONFIG_AVG_16 | ts_dev->bit_xp |
Takashi Iwai a29470
+			STEPCONFIG_INM_ADCREFM;
Takashi Iwai a29470
 	switch (ts_dev->wires) {
Takashi Iwai a29470
 	case 4:
Takashi Iwai a29470
 		config |= STEPCONFIG_INP(ts_dev->inp_yp) | ts_dev->bit_xn;
Takashi Iwai a29470
-- 
Takashi Iwai a29470
2.31.1
Takashi Iwai a29470