]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: ti_am335x_tsc - clamp coordinate_readouts to DT maximum (6)
authorJunjie Cao <junjie.cao@intel.com>
Mon, 17 Nov 2025 03:23:58 +0000 (11:23 +0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 18 Nov 2025 19:19:38 +0000 (11:19 -0800)
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>
drivers/input/touchscreen/ti_am335x_tsc.c

index 93d659ff90aa94ecbd7000fe05e0eef8ab3546ba..d6edfab167704046cac132ccc6cbbd767cf9a8c4 100644 (file)
@@ -389,6 +389,10 @@ static int titsc_parse_dt(struct platform_device *pdev,
                dev_warn(&pdev->dev,
                         "invalid co-ordinate readouts, resetting it to 5\n");
                ts_dev->coordinate_readouts = 5;
+       } else if (ts_dev->coordinate_readouts > 6) {
+               dev_warn(&pdev->dev,
+                        "co-ordinate readouts too large, limiting to 6\n");
+               ts_dev->coordinate_readouts = 6;
        }
 
        err = of_property_read_u32(node, "ti,charge-delay",