Re: [PATCH RFC 4/6] Input: add polled SiRF AT550 resistive touch support

From
sashiko-bot@kernel.org
Date
2026-11-17 13:38:49
Also in
linux-devicetree
Reply to
yy-Local-LLM via B4 Relay, 2026-11-17
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] Input: at550-ts: non-human handle in Signed-off-by and commit
  author
- [Medium] Input: at550-ts: unsafe register restore and IRQ clear order
  in at550_ts_close()
- [Low] Input: at550-ts: violation of Input subsystem error-handling and
  style rules
--

commit cf7c284aeaacb1e8a41814f52eee2edf5d3fbc10
Author: yy-Local-LLM [off-list ref]
Input: add polled SiRF AT550 resistive touch support

Report raw ABS_X/ABS_Y and BTN_TOUCH using the input polling framework.
Preserve the firmware settling settings and reject streaming/AUX
ownership. Use standard touchscreen axis properties; keep affine
calibration in userspace. Polling is the initial supported acquisition
mode.

Signed-off-by: yy-Local-LLM <redacted>
[Severity: High]
Documentation/process/submitting-patches.rst requires a real human name (known
identity) in the Author header and Signed-off-by trailer rather than a handle
or bot identifier such as yy-Local-LLM.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/touchscreen/at550-ts.c b/drivers/input/touchscreen/at550-ts.c
new file mode 100644
index 0000000000000..0a208f4a92f55
--- /dev/null
+++ b/drivers/input/touchscreen/at550-ts.c
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* SiRF AT550 coordinate acquisition. Layout cross-checked with AT551 draft. */
+#include <linux/bitfield.h>
+#include <linux/input.h>
+#include <linux/input/touchscreen.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
[ ... ]
quoted hunk ↗ jump to hunk
+static int at550_ts_open(struct input_dev *input)
+{
+	struct at550_ts *ts = input_get_drvdata(input);
+
+	/* Polling keeps the interrupt sources disabled. Preserve CE settling. */
+	writel(3, ts->base + AT550_INTR);
+	writel(ts->ctrl2 | GENMASK(15, 14), ts->base + AT550_CTRL2);
+	writel((ts->ctrl1 & GENMASK(7, 4)) | BIT(11) | BIT(10),
+	       ts->base + AT550_CTRL1);
+	return 0;
+}
+static void at550_ts_close(struct input_dev *input)
+{
+	struct at550_ts *ts = input_get_drvdata(input);
+
+	writel(3, ts->base + AT550_INTR);
+	writel(ts->ctrl1, ts->base + AT550_CTRL1);
+	writel(ts->ctrl2, ts->base + AT550_CTRL2);
+}
[Severity: Medium]
Can at550_ts_close() leave pending interrupt status latched or re-enable
coordinate acquisition and hardware interrupts?

Clearing AT550_INTR before writing AT550_CTRL1 and AT550_CTRL2 allows an
in-flight conversion to complete and reassert interrupt status before the
controller stops.  In addition, at550_ts_probe() accepts any boot-time bits
within 0xffff in ts->ctrl1 and 0xc2ff in ts->ctrl2, so restoring the unmasked
values on close (unlike at550_ts_open(), which masks ts->ctrl1 to
GENMASK(7, 4)) can re-enable acquisition or interrupt generation if firmware
or a bootloader left those bits set.
quoted hunk ↗ jump to hunk
+static int at550_ts_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct at550_ts *ts;
+	struct input_dev *input;
+	int ret;
[ ... ]
quoted hunk ↗ jump to hunk
+	ret = input_setup_polling(input, at550_ts_poll);
+	if (ret)
+		return ret;
+	input_set_poll_interval(input, 10);
+	return input_register_device(input);
+}
[Severity: Low]
This isn't a bug, but Input subsystem convention is to name the error variable
error or err, check the result of input_register_device(input), and explicitly
return 0 on success:

	error = input_register_device(input);
	if (error)
		return error;

	return 0;

Also, linux/bitfield.h is unused here while linux/bits.h (for BIT and GENMASK)
and linux/mod_devicetable.h (for struct of_device_id) should be included
directly, and blank lines should separate top-level definitions and functions.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117-at550-rfc-v1-v1-0-5879573cb825@gmail.com?part=4
Thread (18 messages) 18 messages, 6 authors, last reply 10d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help