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=1796195762; b=VjfrU/uiUkyRkGNF9R8LULFCysvMCnedVEdi1kQhxx75SHPu0q789FNfil07OddXlWrq nehLAVhPJlJ7ly7+QdfCZQEiZSSYEMcawcvBxrJCS6T4TZiMOU+hoBZEPjeSrxnBJVhyP 5BUVy143dXhGfIr6ePDftMt59C8qbwqFlEab2rqRyZ4/B9TPghzR6W6fdGRiQNXEvzApJ 7Z3aYtBexxim3jOhwIKpqhlRJvvHSloYpwJ7ZmPuM2UbvBRJxPuTZc2IvpJG/9vYgc9eO 2egy1fZYV8oGPTXjSaS24dGCX8BTF6HmB9vnR+WCLMeegzCljfP1ym2gBD6cF6wpgSA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796195762; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=s9hqUk3uwFIZh5vig8LJ2ocQ+0sV4DQ1qAjFxEUXHyk=; b=tJX4DrS6If8FX6y2i6zvUIo6HBJscijxxeZ3YgQE1HpAIdiwX6OHOMIJY8MN7560etbb 0xyqTmbw1+YExbY1CEoVT/QbspSyMhk3ZjMby/o8vT/KXXu1JAWFeUb1rYgSFs1NKPfZ8 /mOPKzZCqzMrG8BaFIGWlnNv6TNSNRWL168QhAHPM5U+YEi4daVaQyImzrc7hhJj05GgT Sje8WGIfJQhXhNWvMAmK9wX1DhXoMLzrBuBFEfcYi3JV7Z9hRa9clKb+n3QV9uA3lyEVS rIzGiwKPpQPHC6TjifEa7fkLfCKALTMV0FxbhUh1I7bdZOMpk8otCTqobBVLURUGLqw== 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=TawOVGjh; 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 1773B606A333 for ; Wed, 2 Dec 2026 07:16:01 +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=TawOVGjh Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80AC11F00896; Wed, 2 Dec 2026 07:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796195761; bh=s9hqUk3uwFIZh5vig8LJ2ocQ+0sV4DQ1qAjFxEUXHyk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TawOVGjhmXQWOZUeetEVh97ZtkkQ7zJkLp6eHOBMMY/j+KqfANVvKMrXXm8G/GdCl eTinpXSBtma6NYVTGMlZVMF9Z9J5cHAl8CZaxtZkmoyraz4r2zEPyS1VXOl4leO9Vl njemlKjuaGesGJUfiew+LCPKeo2jSSinJs9DjW3sw/t0LUcaM+/eaV88zbHjRVzQeQ LkrXeESWcwxy6brAY03jxOeICllJhWe4OzP5bwo2kfTtEULHF6T81dVIMhpKBrRdjV 6a4earH7GyhPkOPxfx/2b9c4nyq/YpBZSyFtekzeUEQSFiQ4oWVWx1eJY0Q1mr7IIy HdV83yE3L3eJw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 08/18] iio: adc: at91-sama5d2_adc: adapt the driver for sama7d65 Reply-To: sashiko-reviews@lists.linux.dev To: "Varshini Rajendran" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261202070458.87970-9-varshini.rajendran@microchip.com> References: <20261202070458.87970-1-varshini.rajendran@microchip.com> <20261202070458.87970-9-varshini.rajendran@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 07:16:01 +0000 X-Mailing-List: devicetree@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 2 potential issues to consider: - [High] iio: adc: at91-sama5d2_adc: channel 0 misclassified as touchscreen on sama7d65 - [High] iio: adc: at91-sama5d2_adc: temp channel scan_index exceeds max_index -- commit cbf4642d17b27b4bed86ec8eb7a607a2edb01be3 Author: Varshini Rajendran iio: adc: at91-sama5d2_adc: adapt the driver for sama7d65 This commit adds platform configuration, temperature sensor calibration layout, and a device tree match entry for the SAMA7D65 ADC. > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sa= ma5d2_adc.c > index 604434fec2ba9..7403d62e8120b 100644 > --- a/drivers/iio/adc/at91-sama5d2_adc.c > +++ b/drivers/iio/adc/at91-sama5d2_adc.c [ ... ] > @@ -766,6 +775,23 @@ static const struct at91_adc_platform sama7g5_platfo= rm =3D { > .temp_calib_layout =3D &sama7g5_temp_calib, > }; > =20 > +static const struct at91_adc_platform sama7d65_platform =3D { > + .layout =3D &sama7g5_layout, > + .adc_channels =3D &at91_sama7g5_adc_channels, [Severity: High] Does leaving touch_chan_x, touch_chan_y, and touch_chan_p zero-initialized = in sama7d65_platform cause single-ended voltage channel 0 (scan_index 0) to be treated as a touchscreen channel? In at91_adc_probe(), bitmap_set() unconditionally sets those indices in st->touch_st.channels_bitmask, marking bit 0 as a touchscreen channel. Enabling channel 0 together with any other channel then fails with -EINVAL = in at91_adc_update_scan_mode(), while enabling buffered capture on channel 0 alone causes at91_adc_current_chan_is_touch() to return true and call at91_adc_configure_touch(), writing touchscreen settings to layout->TSMR (offset 0x00 in sama7g5_layout, which aliases the CR control register). > + .nr_channels =3D AT91_SAMA7G5_SINGLE_CHAN_CNT + > + AT91_SAMA7G5_DIFF_CHAN_CNT + > + AT91_SAMA7G5_TEMP_CHAN_CNT, > + .max_channels =3D ARRAY_SIZE(at91_sama7g5_adc_channels), > + .max_index =3D AT91_SAMA7G5_MAX_CHAN_IDX, [Severity: High] Does setting max_index to AT91_SAMA7G5_MAX_CHAN_IDX (25) leave out the temperature channel in at91_sama7g5_adc_channels, which has scan_index 31 (AT91_SAMA7G5_ADC_TEMP_CHANNEL)? at91_adc_update_scan_mode() and at91_adc_current_chan_is_touch() pass max_index + 1 (26) to bitmap_subset(). When userspace enables buffered capture with in_temp_en and in_timestamp_en, only bit 31 is set in active_scan_mask, so the lower 26 bits are all zero and bitmap_subset() treats the active scan mask as a subset of st->touch_st.channels_bitmask. at91_adc_buffer_prepare() and at91_adc_buffer_postdisable() then take the touchscreen path and call at91_adc_configure_touch(), writing to offset 0x00 (CR). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202070458.8797= 0-1-varshini.rajendran@microchip.com?part=3D8