Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible
@ 2026-07-14 19:16 Simon Glass
  2026-07-15  4:52 ` Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Simon Glass @ 2026-07-14 19:16 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Heiko Stuebner, Andy Shevchenko, David Lechner, linux-iio,
	devicetree, Conor Dooley, linux-rockchip, Krzysztof Kozlowski,
	Nuno Sá, Rob Herring, Simon Glass, Jonas Karlman,
	Krzysztof Kozlowski, linux-arm-kernel, linux-kernel

Add the compatible for the SARADC of the Rockchip RV1106, which is
compatible with the RK3588 variant.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Fold the compatible into an enum together with rk3576-saradc, since
  both fall back to rk3588-saradc

 .../devicetree/bindings/iio/adc/rockchip-saradc.yaml          | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml
index 6769d679c907..f0551d665916 100644
--- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml
@@ -22,7 +22,9 @@ properties:
       - const: rockchip,rk3562-saradc
       - const: rockchip,rk3588-saradc
       - items:
-          - const: rockchip,rk3576-saradc
+          - enum:
+              - rockchip,rk3576-saradc
+              - rockchip,rv1106-saradc
           - const: rockchip,rk3588-saradc
       - items:
           - enum:
---
base-commit: 3b029c035b34bbc693405ddf759f0e9b920c27f1
branch: rv1106e2

-- 
2.43.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible
  2026-07-14 19:16 [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible Simon Glass
@ 2026-07-15  4:52 ` Krzysztof Kozlowski
  2026-07-15 19:21 ` Heiko Stuebner
  2026-08-10  9:08 ` [PATCH] iio: adc: rockchip_saradc: Add support for RV1106 Vladislav Leonov
  2 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-15  4:52 UTC (permalink / raw)
  To: Simon Glass, Jonathan Cameron
  Cc: Heiko Stuebner, Andy Shevchenko, David Lechner, linux-iio,
	devicetree, Conor Dooley, linux-rockchip, Nuno Sá,
	Rob Herring, Jonas Karlman, Krzysztof Kozlowski, linux-arm-kernel,
	linux-kernel

On 14/07/2026 21:16, Simon Glass wrote:
> Add the compatible for the SARADC of the Rockchip RV1106, which is
> compatible with the RK3588 variant.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v2:
> - Fold the compatible into an enum together with rk3576-saradc, since
>   both fall back to rk3588-saradc
> 

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible
  2026-07-14 19:16 [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible Simon Glass
  2026-07-15  4:52 ` Krzysztof Kozlowski
@ 2026-07-15 19:21 ` Heiko Stuebner
  2026-07-20  1:39   ` Jonathan Cameron
  2026-08-10  9:08 ` [PATCH] iio: adc: rockchip_saradc: Add support for RV1106 Vladislav Leonov
  2 siblings, 1 reply; 6+ messages in thread
From: Heiko Stuebner @ 2026-07-15 19:21 UTC (permalink / raw)
  To: Jonathan Cameron, Simon Glass
  Cc: Andy Shevchenko, David Lechner, linux-iio, devicetree,
	Conor Dooley, linux-rockchip, Krzysztof Kozlowski, Nuno Sá,
	Rob Herring, Simon Glass, Jonas Karlman, Krzysztof Kozlowski,
	linux-arm-kernel, linux-kernel

Am Dienstag, 14. Juli 2026, 21:16:32 Mitteleuropäische Sommerzeit schrieb Simon Glass:
> Add the compatible for the SARADC of the Rockchip RV1106, which is
> compatible with the RK3588 variant.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible
  2026-07-15 19:21 ` Heiko Stuebner
@ 2026-07-20  1:39   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2026-07-20  1:39 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Simon Glass, Andy Shevchenko, David Lechner, linux-iio,
	devicetree, Conor Dooley, linux-rockchip, Krzysztof Kozlowski,
	Nuno Sá, Rob Herring, Jonas Karlman, Krzysztof Kozlowski,
	linux-arm-kernel, linux-kernel

On Wed, 15 Jul 2026 21:21:17 +0200
Heiko Stuebner <heiko@sntech.de> wrote:

> Am Dienstag, 14. Juli 2026, 21:16:32 Mitteleuropäische Sommerzeit schrieb Simon Glass:
> > Add the compatible for the SARADC of the Rockchip RV1106, which is
> > compatible with the RK3588 variant.
> > 
> > Signed-off-by: Simon Glass <sjg@chromium.org>  
> 
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> 
> 
Applied to the testing branch of iio.git. Thanks,

J
> 
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] iio: adc: rockchip_saradc: Add support for RV1106
  2026-07-14 19:16 [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible Simon Glass
  2026-07-15  4:52 ` Krzysztof Kozlowski
  2026-07-15 19:21 ` Heiko Stuebner
@ 2026-08-10  9:08 ` Vladislav Leonov
  2026-08-15  1:20   ` Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Vladislav Leonov @ 2026-08-10  9:08 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Heiko Stuebner,
	Simon Glass, linux-iio, linux-arm-kernel, linux-rockchip,
	linux-kernel, Vladislav Leonov

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 <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_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,
 	},
 	{ }
 };
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iio: adc: rockchip_saradc: Add support for RV1106
  2026-08-10  9:08 ` [PATCH] iio: adc: rockchip_saradc: Add support for RV1106 Vladislav Leonov
@ 2026-08-15  1:20   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2026-08-15  1:20 UTC (permalink / raw)
  To: Vladislav Leonov
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Heiko Stuebner,
	Simon Glass, linux-iio, linux-arm-kernel, linux-rockchip,
	linux-kernel

On Mon, 10 Aug 2026 12:08:26 +0300
Vladislav Leonov <vlad@zlab.su> 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 <vlad@zlab.su>

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,
>  	},
>  	{ }
>  };



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-15  1:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 19:16 [PATCH v2] dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible Simon Glass
2026-07-15  4:52 ` Krzysztof Kozlowski
2026-07-15 19:21 ` Heiko Stuebner
2026-07-20  1:39   ` Jonathan Cameron
2026-08-10  9:08 ` [PATCH] iio: adc: rockchip_saradc: Add support for RV1106 Vladislav Leonov
2026-08-15  1:20   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox