Skip to contentSkip to conversation

Input: ti_am335x_tsc: clamp coordinate_readouts to DT maximum (6)

PATCH In review Junjie Cao 1 participant 2 messages Nov 17, 2025 – Dec 1, 2025

Subsystems (2)
lore
Share & tools
lore

Junjie Cao

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/input/touchscreen/ti_am335x_tsc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/input/touchscreen/ti_am335x_tsc.c +4 -0
index 73980142f492..0534b2ba650b 100644
@@ -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",
Signature · 1 line
2.43.0
author
#1 lore raw

Hi Dmitry,

Just a gentle ping on this patch as well.

Best regards,
Junjie