From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796174135; b=SSrCvTn/sohh6v7oDDcRcYD3cHb0JMwGda7yWtOOfY3THDn7bP26oY+t0OvNjnse2Uj/ gV5BmVxESHUJrOmrcc1BAc2hTGebifoE5FxMSMsm0gAXhjv6ArOizrNzGCJ+5ZJ/Y9ppo CdNTgr15bDWv1WkYVGNPXzn59cLBrzVTz3hyie1v4iuaic69ZiTzauwT7iuPyc3uI8OwQ ciWGaDP9mCU1nWqIl3jGysAzVe5VquQLBUj3QqiXAQ+uyNGnniVP3484hnWH7WV9uBg6L Ep+hw7i3TRgdJKuwhu0ZkXfbTlYRznPYVPbaSOVEpZjo1A8CCfqWofUwRTRS6zA3C6A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796174135; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=YsUznmMr6U8m2su4gxzzTt7KUwdoyctTIT3s+LlPnG0=; b=E96Vvz6qpJCdnrVnHn+NMRIreAYAx/nY8JLz8kC2s/zCRyQPjKI7lVMO/r6lrGmoQaX0 D8bfX0T8BFLnedkH8jjUxUMbBvpy/P6QSnM6hObQ9dM/9xpwk1Ue+Cw01dBjRm+XQBtMO NmsTCrwSmPFSEsXaQsGSM2SRmn97nxlXyuqyu/FAYeBNmrIzoWSmIJ1Bid0XGLFIvrIRh xsHvmG3hx/u39cg7lmJ07QVzdcT8gVzwUw2c4KbffY1caG4vfS0ZmBjHaYvbm8MKIC2Sv Av+iGwzWM3zzxwvaMV+wIMykLkkebbwjPPenxvt68NOTTx+uv/W1abggD00gkK5Bnqg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nPQ8EJ+Y; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6512F606A327; Wed, 2 Dec 2026 01:15:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nPQ8EJ+Y Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB3E31F00919; Wed, 2 Dec 2026 01:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796174135; bh=YsUznmMr6U8m2su4gxzzTt7KUwdoyctTIT3s+LlPnG0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=nPQ8EJ+YNcybX6PFupWQWF9DsIjCcjbe9RUg7llYLbEzLxue1DB7qGSsQKN5cR/IY uP8Ty3p0FVyWSrxJD9OGwnohQribzOQh7cXBY/LmBDn5S/qb5dpQU7uPQgW/+Ms9j6 Gh8EUKfJDufHV0IHIHrIxi86waoQsUZHhcgpbMV4biOxbdUN1pvKUrATPZ9ECDaVDp I+IhDEs+gEjXylSVXwovmfG99lUFIeZ/LqE6PY0xHUUB4CvA2bzsnSeAFF5LZ2yzeS 69b7rFXHd4BRXe0JGk/5gmIkDmhZMXSQaNtwpm+HfsiBbLd4hHgXf936wbqHqVPxTc vUqKZiZV9aGog== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 6/7] dt-bindings: input: novatek,nvt-ts - add the NT36536 compatible Reply-To: sashiko-reviews@lists.linux.dev To: "Qianhui Xu" Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261202010542.2508257-6-xiaqinghuan@mail.ustc.edu.cn> References: <20261202010542.2508257-1-xiaqinghuan@mail.ustc.edu.cn> <20261202010542.2508257-6-xiaqinghuan@mail.ustc.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 01:15:34 +0000 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] Input: novatek-nvt-ts: broken DT axis setup in nvt_ts_probe() - [High] Input: novatek-nvt-ts: missing linux/bitfield.h include for FIELD_GET() - [Medium] Input: novatek-nvt-ts: unregistered ABS_MT_TOUCH_MAJOR in nvt_ts_probe() -- commit 2354ad35fa28bbbffb01b63befc83c37b13ef941 Author: Qianhui Xu Input: novatek-nvt-ts - add NT36536 packet decoding This commit adds packet decoding and SPI match entries for the NT36536 touchscreen controller, and makes the parameter block read in nvt_ts_probe() conditional on chip_id. > diff --git a/drivers/input/touchscreen/novatek-nvt-ts-core.c b/drivers/in= put/touchscreen/novatek-nvt-ts-core.c > index 747fa8bbe3157..f67170474c76e 100644 > --- a/drivers/input/touchscreen/novatek-nvt-ts-core.c > +++ b/drivers/input/touchscreen/novatek-nvt-ts-core.c [ ... ] > @@ -81,6 +85,76 @@ static irqreturn_t nvt_ts_irq(int irq, void *dev_id) > input_mt_sync_frame(data->input); > input_sync(data->input); > =20 > + return 0; > +} > + [ ... ] > +static int nvt_ts_report_nt36xxx(struct nvt_ts_data *data) > +{ > + struct device *dev =3D data->dev; > + int i, error; > + > + error =3D nvt_ts_read_data(data, NVT_TS_TOUCH_START, data->buf, > + NVT_TS_NT36XXX_PACKET_SIZE); > + if (error) > + return error; > + > + if (!nvt_ts_nt36xxx_checksum_ok(data->buf)) { > + dev_dbg(dev, "bad touch packet checksum\n"); > + return -EIO; > + } > + > + for (i =3D 0; i < data->max_touches; i++) { > + const u8 *touch =3D &data->buf[1 + i * NVT_TS_TOUCH_SIZE]; > + u8 state =3D FIELD_GET(NVT_TS_TOUCH_TYPE_MASK, touch[0]); [Severity: High] Does this need to include linux/bitfield.h for FIELD_GET()? On architectur= es such as x86 that do not pull it in transitively, the build fails with an implicit function declaration. > + unsigned int id =3D (touch[0] >> NVT_TS_TOUCH_SLOT_SHIFT) - 1; > + unsigned int x, y, width; > + > + if (state !=3D NVT_TS_TOUCH_NEW && state !=3D NVT_TS_TOUCH_UPDATE) > + continue; > + if (id >=3D data->max_touches) > + continue; > + > + x =3D get_unaligned_be16(&touch[1]); > + y =3D get_unaligned_be16(&touch[3]); > + width =3D touch[5] ?: 1; > + > + input_mt_slot(data->input, id); > + input_mt_report_slot_state(data->input, MT_TOOL_FINGER, true); > + touchscreen_report_pos(data->input, &data->prop, x, y, true); > + input_report_abs(data->input, ABS_MT_TOUCH_MAJOR, width); [Severity: Medium] Are these ABS_MT_TOUCH_MAJOR events dropped by the input core? nvt_ts_prob= e() only sets up ABS_MT_POSITION_X and ABS_MT_POSITION_Y via input_set_abs_params(), so ABS_MT_TOUCH_MAJOR is never set in input->absbit. [ ... ] > @@ -223,9 +318,17 @@ int nvt_ts_probe(struct device *dev, const struct nv= t_ts_bus_ops *bus_ops, > input->open =3D nvt_ts_start; > input->close =3D nvt_ts_stop; > =20 > - input_set_abs_params(input, ABS_MT_POSITION_X, 0, width - 1, 0, 0); > - input_set_abs_params(input, ABS_MT_POSITION_Y, 0, height - 1, 0, 0); > + if (width) > + input_set_abs_params(input, ABS_MT_POSITION_X, 0, width - 1, 0, 0); > + if (height) > + input_set_abs_params(input, ABS_MT_POSITION_Y, 0, height - 1, 0, 0); > touchscreen_parse_properties(input, true, &data->prop); > + if (!width) > + input_set_abs_params(input, ABS_MT_POSITION_X, 0, > + data->prop.max_x - 1, 0, 0); > + if (!height) > + input_set_abs_params(input, ABS_MT_POSITION_Y, 0, > + data->prop.max_y - 1, 0, 0); [Severity: High] Does touchscreen_parse_properties() fail to set up the X and Y axes when chip->chip_id is 0? When width and height are 0, skipping input_set_abs_params() before touchscreen_parse_properties() leaves ABS_MT_POSITION_X and ABS_MT_POSITION= _Y unset in input->absbit: drivers/input/touchscreen.c:touchscreen_set_params() { if (!test_bit(axis, dev->absbit)) { dev_warn(&dev->dev, "Parameters are specified but the axis %lu is not set up\n", axis); return; } ... } As a result, touchscreen_parse_properties() logs a warning for both axes, leaves data->prop.max_x and data->prop.max_y at 0, and the subsequent input_set_abs_params() calls configure both axis maximums to -1. Setting the capabilities with input_set_capability(input, EV_ABS, ABS_MT_POSITION_X) and ABS_MT_POSITION_Y before touchscreen_parse_propertie= s() lets touchscreen_parse_properties() configure the axes directly from device tree without calling input_set_abs_params() afterwards. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202010542.2508= 257-1-xiaqinghuan@mail.ustc.edu.cn?part=3D6