From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E545C5B572 for ; Sat, 15 Aug 2026 01:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OJWj3PbnAabybLU7Y9JoioqHjCL4dKOjnmbQJlw34UI=; b=I3rpqz+bUa0lZP T6+BfWdpj3SrjqJt/Niv3KOQAn7f0OJXfcndh67VnsAKCQpFbQjPRpAM08daOsfED3fTjOllQgDrT zxaEDPpv4T0qPXhXaaN2F/WEpq+SSnkdq05iIDyIynjwWsWeNMfWIvLyLMJvBKkUU2i3SaC1P7cD8 lK3/jHv10qwdnJ3Q8tZx3WegBEe0Toy3Gk7kMQrw0MngZIXpPEioAA2BjNXLWniz1zF6aJacK/pjf CfZnRrGcIHpswPe8iw0ZwC874P6ItTajXWkHiLrVB4Szyna7GMAS5YjLKE9OnNIIei005Is++lqkb PgzrCdoREX7bnkNbntFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wv34o-00000003Mfo-2j0d; Sat, 15 Aug 2026 01:20:46 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wv34n-00000003Mfb-3XRV; Sat, 15 Aug 2026 01:20:45 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 2B6C542AE7; Sat, 15 Aug 2026 01:20:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB7FA1F000E9; Sat, 15 Aug 2026 01:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786756845; bh=e1GbwJutY4GdWm624xBCw3VzOLuvHYbs0MQRC3ke+iI=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=O2+Kfnd97Q/YA1Em578zO+4kBFdO/77iJ2SeVvuaxxOSzFIACMcDaloxuvktQITr8 1e2nAq0RFNaiWgjlPsmAVeAAJJPBCUDrC134SZ0q46jzS/MfmWy2QgMZyf4VjfEZcG HWVOaNS9J04tpNMgxRiNdCscPqJKxF/wgGDvs2oqUwwAMk2znlVluIzU2od9jC/0Z0 Fkzgcg+Amk7f+ABEdv8mrDYnCkhjWJ1RymAdIM0pT4QRnebe0W25xN9EOpcmRfya4p g2c51qwMQLRgMmlThdm6rsk9FMygyh3F7D4kH3XACnpU6c49fJP2soPl2CVkxBbQRH +2G6rnQowHWLQ== Date: Sat, 15 Aug 2026 02:20:36 +0100 From: Jonathan Cameron To: Vladislav Leonov Cc: David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Heiko Stuebner , Simon Glass , linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: rockchip_saradc: Add support for RV1106 Message-ID: <20260815022036.7c47585e@jic23-huawei> In-Reply-To: <20260810090826.146758-1-vlad@zlab.su> References: <20260714131631.v2.1.0b846080833e4b836793c43fc26d1c6d817cf9b4@changeid> <20260810090826.146758-1-vlad@zlab.su> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Mon, 10 Aug 2026 12:08:26 +0300 Vladislav Leonov wrote: > The Successive Approximation ADC (SARADC) in RV1106 uses the v2 > controller and supports: > - 10-bit resolution > - Up to 1MS/s sampling rate > - 2 single-ended input channels > > "dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible" > documents "rockchip,rv1106-saradc" as falling back to > "rockchip,rk3588-saradc" (see Link below). The two IP blocks are not > equivalent, though: per the RV1106 TRM v0.3, chapter 20 (SAR-ADC), > RV1106 only has 2 channels at 10-bit resolution, versus 8 channels > at 12-bit on RK3588. Without a dedicated match entry, the driver > binds via the fallback compatible and uses the RK3588 channel table, > which reports 8 channels instead of 2, and an in_voltage_scale that > is off by exactly 4x (4096 vs 1024 full-scale). > > Add a dedicated compatible/data pair for RV1106 with the correct > 2-channel, 10-bit layout. > > Tested on a custom RV1106-based board, with: > > &saradc { > vref-supply = <&vcc_saradc>; /* 1.8V fixed regulator */ > status = "okay"; > }; > > Before this patch: > # ls /sys/bus/iio/devices/iio:device0/in_voltage*_raw | wc -l > 8 > # cat /sys/bus/iio/devices/iio:device0/in_voltage_scale > 0.439453125 > > After this patch: > # ls /sys/bus/iio/devices/iio:device0/in_voltage*_raw | wc -l > 2 > # cat /sys/bus/iio/devices/iio:device0/in_voltage_scale > 1.757812500 > > Link: https://lore.kernel.org/all/20260714131631.v2.1.0b846080833e4b836793c43fc26d1c6d817cf9b4@changeid/ > Signed-off-by: Vladislav Leonov Hi Vladislav, Could you also send a fix for the dt-binding as it clearly shouldn't claim the fallback compatible! Whilst I can see why you did here, in general don't reply to an existing series when sending a new one. Your link tag is sufficient to associate the two. I'll give this a little longer on list to let other comment, but looks good to me. Thanks, Jonathan > --- > drivers/iio/adc/rockchip_saradc.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c > index 0f0bf2906af0..5c45fae11890 100644 > --- a/drivers/iio/adc/rockchip_saradc.c > +++ b/drivers/iio/adc/rockchip_saradc.c > @@ -348,6 +348,19 @@ static const struct rockchip_saradc_data rk3588_saradc_data = { > .read = rockchip_saradc_read_v2, > }; > > +static const struct iio_chan_spec rockchip_rv1106_saradc_iio_channels[] = { > + SARADC_CHANNEL(0, "adc0", 10), > + SARADC_CHANNEL(1, "adc1", 10), > +}; > + > +static const struct rockchip_saradc_data rv1106_saradc_data = { > + .channels = rockchip_rv1106_saradc_iio_channels, > + .num_channels = ARRAY_SIZE(rockchip_rv1106_saradc_iio_channels), > + .clk_rate = 1000000, > + .start = rockchip_saradc_start_v2, > + .read = rockchip_saradc_read_v2, > +}; > + > static const struct of_device_id rockchip_saradc_match[] = { > { > .compatible = "rockchip,saradc", > @@ -370,6 +383,9 @@ static const struct of_device_id rockchip_saradc_match[] = { > }, { > .compatible = "rockchip,rk3588-saradc", > .data = &rk3588_saradc_data, > + }, { > + .compatible = "rockchip,rv1106-saradc", > + .data = &rv1106_saradc_data, > }, > { } > }; _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip