From nobody Mon Sep 28 10:43:33 2026 Received: from mail.zlab.su (mail.zlab.su [109.73.193.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44F9C3B27E3; Sun, 23 Aug 2026 12:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.73.193.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787488606; cv=none; b=LeGiX9t+Vup9/DLSOMtmcb/SSmZARJExfnNwLgNp+E91FGcvdxlv+3HcR5Kop+O4FX2ma/LESsf7z38Y4+bMdVDyfnHqi8EmeYLf7Vwl1AOR2a6+Mhi7eQ9UsccPvT0vswdEhFzXV3HT740i+F6A4dGUZVene3VtpN6+YqHpRno= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787488606; c=relaxed/simple; bh=nGm5Xuxn5GpFz+y6WM5ZYEyHp3PUioUEI0sqYUwy75w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U71XJw6PQ0dtV4ejifViMIAybgUboatl5g9o7mEwqa3N+ZoWny6+JIS4GX1bfwpG3UPw4XkEny4KIIs420b6iAE06lC/9QGHuZuEPlzjymbpkBi4QddcJrOOBLlm7MBzbNaWdaW3rrrMwIWqhhVEGdPI5gwPpT+wkYFXGfniddo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zlab.su; spf=pass smtp.mailfrom=zlab.su; dkim=pass (2048-bit key) header.d=zlab.su header.i=@zlab.su header.b=Bj62Z5LJ; arc=none smtp.client-ip=109.73.193.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zlab.su Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zlab.su Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zlab.su header.i=@zlab.su header.b="Bj62Z5LJ" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CA884BFB0E; Sun, 23 Aug 2026 15:21:23 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zlab.su; s=dkim; t=1787487698; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=Ak38qDD4gXhLwI3K5lsvDYopaUPFcUHfgh4biboOh5s=; b=Bj62Z5LJRCVVNmcn8bayhs7BANpOy8wygEPOVHBmivDJBmayy7z76Hnq+Jy1W4dQKXYVyM OdxBPcDEaZV6WIIQCEpsNCEteMpVaWAVcN7o5xX4Fo4sWPwlPT7sHP0KvV8ji5KKHC4cWk nyioYmqn6N5MzpHR0mEuMGxIoGZP1XMkKxhsbiteiypkwWCrkvGjwv9qQM8qWnPJELEouE 1LYlHaIvhZV4/4W4OQ00sevBTWYw/McYS2neXgxZ+dzj5W0z/lX1jwaX6kdXY9/97ocGQE rDMhLkECq8GDMGUmRPZF/BjaYEiw8xLU1bFRHTdSR9G2HFFFR+6YK7x2/RuCqg== From: Vladislav Leonov To: Jonathan Cameron Cc: Vladislav Leonov , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , 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: [PATCH v2 1/3] iio: adc: rockchip_saradc: Add support for RV1106 Date: Sun, 23 Aug 2026 15:20:32 +0300 Message-ID: <20260823122039.20831-2-vlad@zlab.su> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260823122039.20831-1-vlad@zlab.su> References: <20260823122039.20831-1-vlad@zlab.su> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" 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 =3D <&vcc_saradc>; /* 1.8V fixed regulator */ status =3D "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.0b846080833e4b836793c= 43fc26d1c6d817cf9b4@changeid/ Signed-off-by: Vladislav Leonov --- No changes in v2. v1 https://lore.kernel.org/all/20260810090826.146758-1-vlad@zlab.su 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_s= aradc.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 =3D { .read =3D rockchip_saradc_read_v2, }; =20 +static const struct iio_chan_spec rockchip_rv1106_saradc_iio_channels[] = =3D { + SARADC_CHANNEL(0, "adc0", 10), + SARADC_CHANNEL(1, "adc1", 10), +}; + +static const struct rockchip_saradc_data rv1106_saradc_data =3D { + .channels =3D rockchip_rv1106_saradc_iio_channels, + .num_channels =3D ARRAY_SIZE(rockchip_rv1106_saradc_iio_channels), + .clk_rate =3D 1000000, + .start =3D rockchip_saradc_start_v2, + .read =3D rockchip_saradc_read_v2, +}; + static const struct of_device_id rockchip_saradc_match[] =3D { { .compatible =3D "rockchip,saradc", @@ -370,6 +383,9 @@ static const struct of_device_id rockchip_saradc_match[= ] =3D { }, { .compatible =3D "rockchip,rk3588-saradc", .data =3D &rk3588_saradc_data, + }, { + .compatible =3D "rockchip,rv1106-saradc", + .data =3D &rv1106_saradc_data, }, { } }; --=20 2.47.3 From nobody Mon Sep 28 10:43:33 2026 Received: from mail.zlab.su (mail.zlab.su [109.73.193.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 450CF3CB559; Sun, 23 Aug 2026 12:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.73.193.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787488606; cv=none; b=qg/QeRpmnSHyt9ZDTkcmAIEmd4UbnrY7Sin4758uJpszpphkmVA8/5q9LDMctixzLpfMaYP4JMmupn896X3u2/EwpyyFusD77SK7K6uVqpxN/4uOpW1eBA6qaM7ziyT/5mMhBGCRlN2E6ML1YYtMPXLJIfemBFfRVv1RT1h4rAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787488606; c=relaxed/simple; bh=nb21CGdTcvNZIWFfrkpjg3HoqUk7MmJQ7vhcZAoQmIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g9d0DMU19oXCv5dqiM6tsNAK5ZAnSmzEafBG5swIiIr6lGutCzVhtT792My5uU6aOqdmt/eX1WHjTMFL6bsriBa+GNNSsYtg0/PwW0t7W0lYTiaIow+sZHiKAvMlFgKL1/FrjF0HhFq8z4uu0W0izwLk0odeC0S0vctnIA+QTHg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zlab.su; spf=pass smtp.mailfrom=zlab.su; dkim=pass (2048-bit key) header.d=zlab.su header.i=@zlab.su header.b=TF49ASep; arc=none smtp.client-ip=109.73.193.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zlab.su Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zlab.su Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zlab.su header.i=@zlab.su header.b="TF49ASep" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 35A7DBFD8D; Sun, 23 Aug 2026 15:21:39 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zlab.su; s=dkim; t=1787487701; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=Xyd94O5ucYyASZOwn/menIsiXveXzi9oR7nKej3n2Ig=; b=TF49ASepgpcLcF9HdLr1/hObVNd/CtTttC1CbR4Sk/Q4M0bOqdD61PbIXhaa2IfXAIKuj4 ITz3UtbRnnpe7ZbAkshx7ULIl7DUqiUqslvox8r8zjDMRcn8gKq/fVwOIqGGUSjebVwM20 AWkAiaqQjOprwJodnjMTJTNl8DyAtlq8NnESWhZAjVdS4fs0GJHVQxxW3f1Xzoc/bbSt9i 1CAC42+NcMBtv85IWZ0PKD8VR+1TFS5ypyoOEPULDRAcSM6oEklSiOiiVXXI8nmCjdxDRa AOqvMMbPAvq1pO8trRogTO7v3KaHnRwHpR7xRujziFnzr/di7Wsa0Wt/+G+cDA== From: Vladislav Leonov To: Jonathan Cameron Cc: Vladislav Leonov , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Joshua Crofts , Simon Glass , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v2 2/3] dt-bindings: iio: adc: rockchip-saradc: Group single-entries into an enum list Date: Sun, 23 Aug 2026 15:20:33 +0300 Message-ID: <20260823122039.20831-3-vlad@zlab.su> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260823122039.20831-1-vlad@zlab.su> References: <20260823122039.20831-1-vlad@zlab.su> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" Group single-entries into an enum list Suggested-by: Krzysztof Kozlowski Signed-off-by: Vladislav Leonov Acked-by: Conor Dooley --- Changes in v2: - Patch introduced in v2. .../bindings/iio/adc/rockchip-saradc.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml= b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml index f0551d665916..78ec9a33da24 100644 --- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml @@ -12,15 +12,16 @@ maintainers: properties: compatible: oneOf: - - const: rockchip,saradc - - const: rockchip,rk3066-tsadc - - const: rockchip,rk3399-saradc - - const: rockchip,rk3528-saradc + - enum: + - rockchip,saradc + - rockchip,rk3066-tsadc + - rockchip,rk3399-saradc + - rockchip,rk3528-saradc + - rockchip,rk3562-saradc + - rockchip,rk3588-saradc - items: - const: rockchip,rk3506-saradc - const: rockchip,rk3528-saradc - - const: rockchip,rk3562-saradc - - const: rockchip,rk3588-saradc - items: - enum: - rockchip,rk3576-saradc --=20 2.47.3 From nobody Mon Sep 28 10:43:33 2026 Received: from mail.zlab.su (mail.zlab.su [109.73.193.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6407F2472A2; Sun, 23 Aug 2026 12:21:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.73.193.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787487719; cv=none; b=T9Nx0+KLYPT/aV3NkC+cpg8QOIVOveq4SBJwmA31B9YksxrPVcaifxDsPGp81TKd7wwmtY9lp0kwAR3c0wWRfRSb5HbRoRvlJwRXwH+i/BCKjfnAAhtY/wKW480UdIxne2Cwmk7ik0ePu6b59k9b3EfmhyT2zvuVW2GMo9X04I8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787487719; c=relaxed/simple; bh=CGVjFSZjECENaRMH8vjXWbfjgckvQdvYCCyXd/jRunE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mq4ndLurog62HC4j0zycU5HX71VPfYz9ygLf/6NJnyKkeCkZOEUbVTmKKbRdSA+bfDnu/InW5i9R9WHFK9hwduesD9l0kARKezXHjt66i32itQY9bxywSRJCGrwRFCMChUG5TETWHDkWWL8PoOJN5KCLnrIfRZZZacUI67XjAd4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zlab.su; spf=pass smtp.mailfrom=zlab.su; dkim=pass (2048-bit key) header.d=zlab.su header.i=@zlab.su header.b=HzVv47cg; arc=none smtp.client-ip=109.73.193.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zlab.su Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zlab.su Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zlab.su header.i=@zlab.su header.b="HzVv47cg" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id BC426BFD8E; Sun, 23 Aug 2026 15:21:41 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zlab.su; s=dkim; t=1787487703; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=BGaX7DZeXOQA0/nBLDUvFWM17WVGbg1iQdf4XKAR9lI=; b=HzVv47cgeugUidKyCTu5cleDaVdH5DNGhT0d/6KuKoYsyLq+yb24QZbCvm2lX5wWVpGNic BIWSrFvMC1iIuUj+cIWrsXvAZkM7YwDMOEsyhR0gekuk629/kNg/YaSEBb83YblvasoNjO pi9bCU0EhqxXXfbvxzUP37kRD82Q2kQm3lVV2d+sSLiRUch3nKvMNjWAHYcNU1GQcz7Am6 kisLY0sSWUf9Pi4IODyjw4RDemKH4RFWbIxneURpLBFcbTZyg7VuDtREpyVfLY0vT0pUmy 6xg6WqV5LIg80lG8cZv8qNrLt+eGA0HDPySIhS3jfd8rQVRVQP+lee6jk670AQ== From: Vladislav Leonov To: Jonathan Cameron Cc: Vladislav Leonov , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Joshua Crofts , Simon Glass , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] dt-bindings: iio: adc: rockchip-saradc: Fix RV1106 compatible Date: Sun, 23 Aug 2026 15:20:34 +0300 Message-ID: <20260823122039.20831-4-vlad@zlab.su> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260823122039.20831-1-vlad@zlab.su> References: <20260823122039.20831-1-vlad@zlab.su> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" rockchip,rv1106-saradc was folded into the fallback enum together with rockchip,rk3576-saradc, falling back to rockchip,rk3588-saradc. 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. Documenting it as falling back to rk3588-saradc allows device trees that would bind against the wrong channel table and report an incorrect voltage scale. Remove rockchip,rv1106-saradc from the RK3588 fallback enum and give it its own standalone compatible entry, matching the dedicated match table entry added by the driver patch. Fixes: bdba14f6122c ("dt-bindings: iio: adc: rockchip-saradc: Add RV1106 co= mpatible") Suggested-by: Jonathan Cameron Signed-off-by: Vladislav Leonov Acked-by: Conor Dooley --- Changes in v2: - Added missing Suggested-by tag. - rockchip,rv1106-saradc compatible moved from the single-entry to enum lis= t. v1 https://lore.kernel.org/all/20260816113636.33635-1-vlad@zlab.su .../devicetree/bindings/iio/adc/rockchip-saradc.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml= b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml index 78ec9a33da24..0cce357cb01d 100644 --- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml @@ -19,13 +19,12 @@ properties: - rockchip,rk3528-saradc - rockchip,rk3562-saradc - rockchip,rk3588-saradc + - rockchip,rv1106-saradc - items: - const: rockchip,rk3506-saradc - const: rockchip,rk3528-saradc - items: - - enum: - - rockchip,rk3576-saradc - - rockchip,rv1106-saradc + - const: rockchip,rk3576-saradc - const: rockchip,rk3588-saradc - items: - enum: --=20 2.47.3