Skip to content

Commit 70f62e5

Browse files
Junjie650dtor
authored andcommitted
Input: ti_am335x_tsc - clamp coordinate_readouts to DT maximum (6)
DT binding (ti,am3359-tsc.yaml) sets ti,coordinate-readouts to a maximum of 6. The MFD parent also enforces that (readouts * 2 + 2) + adc_channels <= 16 and fails probe if this is violated, so the touchscreen subdriver will not even probe in those cases. Clamp coordinate_readouts > 6 to 6 in the subdriver to align with the binding and keep behavior sane if invalid platform data bypasses schema checks. Keep the existing default to 5 for non-positive values. No functional change with valid DT. Signed-off-by: Junjie Cao <junjie.cao@intel.com> Link: https://patch.msgid.link/20251117032358.891822-1-junjie.cao@intel.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent a311c77 commit 70f62e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/input/touchscreen/ti_am335x_tsc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ static int titsc_parse_dt(struct platform_device *pdev,
389389
dev_warn(&pdev->dev,
390390
"invalid co-ordinate readouts, resetting it to 5\n");
391391
ts_dev->coordinate_readouts = 5;
392+
} else if (ts_dev->coordinate_readouts > 6) {
393+
dev_warn(&pdev->dev,
394+
"co-ordinate readouts too large, limiting to 6\n");
395+
ts_dev->coordinate_readouts = 6;
392396
}
393397

394398
err = of_property_read_u32(node, "ti,charge-delay",

0 commit comments

Comments
 (0)