Skip to content

Commit 23dee6c

Browse files
passgatdtor
authored andcommitted
Input: ti_am335x_tsc - lower the X and Y sampling time
The open delay time has to be applied only on the first sample of the X/Y coordinates because on the following samples the ADC channel is not changed. Removing this time from the samples after the first one, "ti,coordinate-readouts" greater than 1, decreases the total acquisition time, allowing to increase the number of acquired coordinates in the time unit. Signed-off-by: Dario Binacchi <dariobin@libero.it> Link: https://lore.kernel.org/r/20211212125358.14416-4-dariobin@libero.it Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 6bfeb6c commit 23dee6c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/input/touchscreen/ti_am335x_tsc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int titsc_config_wires(struct titsc *ts_dev)
126126
static void titsc_step_config(struct titsc *ts_dev)
127127
{
128128
unsigned int config;
129-
int i;
129+
int i, n;
130130
int end_step, first_step, tsc_steps;
131131
u32 stepenable;
132132

@@ -151,9 +151,11 @@ static void titsc_step_config(struct titsc *ts_dev)
151151
first_step = TOTAL_STEPS - tsc_steps;
152152
/* Steps 16 to 16-coordinate_readouts is for X */
153153
end_step = first_step + tsc_steps;
154+
n = 0;
154155
for (i = end_step - ts_dev->coordinate_readouts; i < end_step; i++) {
155156
titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
156-
titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
157+
titsc_writel(ts_dev, REG_STEPDELAY(i),
158+
n++ == 0 ? STEPCONFIG_OPENDLY : 0);
157159
}
158160

159161
config = 0;
@@ -175,9 +177,11 @@ static void titsc_step_config(struct titsc *ts_dev)
175177

176178
/* 1 ... coordinate_readouts is for Y */
177179
end_step = first_step + ts_dev->coordinate_readouts;
180+
n = 0;
178181
for (i = first_step; i < end_step; i++) {
179182
titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
180-
titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
183+
titsc_writel(ts_dev, REG_STEPDELAY(i),
184+
n++ == 0 ? STEPCONFIG_OPENDLY : 0);
181185
}
182186

183187
/* Make CHARGECONFIG same as IDLECONFIG */

0 commit comments

Comments
 (0)