public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4] iio: adc: meson-saradc: add support for Meson S4
@ 2026-02-28  6:58 Nick Xie
  2026-02-28  6:58 ` [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible Nick Xie
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Nick Xie @ 2026-02-28  6:58 UTC (permalink / raw)
  To: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy
  Cc: linux-iio, robh, conor+dt, linux-amlogic, linux-arm-kernel,
	devicetree, linux-kernel, xieqinick, Nick Xie

This series adds support for the SARADC IP block found in the Amlogic
Meson S4 (S905Y4) SoC and enables it for the Khadas VIM1S board to
support the onboard ADC 'Function' key.

Following discussions in a previous board-enablement thread [1], a
dedicated compatible string ("amlogic,meson-s4-saradc") is introduced.
While the hardware currently operates perfectly using the G12A parameter
set, defining an S4-specific string ensures forward compatibility should
any S4-specific quirks or BL30 integration differences be discovered in
the future.

[1] https://lore.kernel.org/linux-amlogic/20260123022258.136448-1-nick@khadas.com/

Nick Xie (4):
  dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  iio: adc: meson-saradc: add support for Meson S4
  arm64: dts: amlogic: meson-s4: add internal SARADC controller
  arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key
    support

 .../iio/adc/amlogic,meson-saradc.yaml         |  1 +
 .../amlogic/meson-s4-s905y4-khadas-vim1s.dts  | 19 +++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi     | 14 ++++++++++++++
 drivers/iio/adc/meson_saradc.c                |  8 ++++++++
 4 files changed, 42 insertions(+)

-- 
2.34.1



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

* [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-02-28  6:58 [PATCH v1 0/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
@ 2026-02-28  6:58 ` Nick Xie
  2026-02-28 11:18   ` Krzysztof Kozlowski
  2026-02-28  6:58 ` [PATCH v1 2/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Nick Xie @ 2026-02-28  6:58 UTC (permalink / raw)
  To: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy
  Cc: linux-iio, robh, conor+dt, linux-amlogic, linux-arm-kernel,
	devicetree, linux-kernel, xieqinick, Nick Xie

Add the compatible string for the SARADC (Successive Approximation
Register ADC) IP block found in the Amlogic Meson S4 SoC.

Signed-off-by: Nick Xie <nick@khadas.com>
---
 .../devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
index bb9825e7346dd..5496a0dc714aa 100644
--- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
@@ -27,6 +27,7 @@ properties:
               - amlogic,meson-gxm-saradc
               - amlogic,meson-axg-saradc
               - amlogic,meson-g12a-saradc
+              - amlogic,meson-s4-saradc
           - const: amlogic,meson-saradc
 
   reg:
-- 
2.34.1



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

* [PATCH v1 2/4] iio: adc: meson-saradc: add support for Meson S4
  2026-02-28  6:58 [PATCH v1 0/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
  2026-02-28  6:58 ` [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible Nick Xie
@ 2026-02-28  6:58 ` Nick Xie
  2026-03-02 11:50   ` Martin Blumenstingl
  2026-02-28  6:58 ` [PATCH v1 3/4] arm64: dts: amlogic: meson-s4: add internal SARADC controller Nick Xie
  2026-02-28  6:58 ` [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support Nick Xie
  3 siblings, 1 reply; 15+ messages in thread
From: Nick Xie @ 2026-02-28  6:58 UTC (permalink / raw)
  To: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy
  Cc: linux-iio, robh, conor+dt, linux-amlogic, linux-arm-kernel,
	devicetree, linux-kernel, xieqinick, Nick Xie

Add support for the SARADC found on the Amlogic Meson S4 SoC.
According to the documentation and current testing, it is fully
compatible with the G12A parameter set, so we reuse
`meson_sar_adc_g12a_data` for this new compatible string.

Signed-off-by: Nick Xie <nick@khadas.com>
---
 drivers/iio/adc/meson_saradc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index 47cd350498a0d..3ac48b7842c4f 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -1313,6 +1313,11 @@ static const struct meson_sar_adc_data meson_sar_adc_g12a_data = {
 	.name = "meson-g12a-saradc",
 };
 
+static const struct meson_sar_adc_data meson_sar_adc_s4_data = {
+	.param = &meson_sar_adc_g12a_param,
+	.name = "meson-s4-saradc",
+};
+
 static const struct of_device_id meson_sar_adc_of_match[] = {
 	{
 		.compatible = "amlogic,meson8-saradc",
@@ -1341,6 +1346,9 @@ static const struct of_device_id meson_sar_adc_of_match[] = {
 	}, {
 		.compatible = "amlogic,meson-g12a-saradc",
 		.data = &meson_sar_adc_g12a_data,
+	}, {
+		.compatible = "amlogic,meson-s4-saradc",
+		.data = &meson_sar_adc_s4_data,
 	},
 	{ }
 };
-- 
2.34.1



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

* [PATCH v1 3/4] arm64: dts: amlogic: meson-s4: add internal SARADC controller
  2026-02-28  6:58 [PATCH v1 0/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
  2026-02-28  6:58 ` [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible Nick Xie
  2026-02-28  6:58 ` [PATCH v1 2/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
@ 2026-02-28  6:58 ` Nick Xie
  2026-03-02 11:50   ` Martin Blumenstingl
  2026-02-28  6:58 ` [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support Nick Xie
  3 siblings, 1 reply; 15+ messages in thread
From: Nick Xie @ 2026-02-28  6:58 UTC (permalink / raw)
  To: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy
  Cc: linux-iio, robh, conor+dt, linux-amlogic, linux-arm-kernel,
	devicetree, linux-kernel, xieqinick, Nick Xie

Add the SARADC controller node to the Meson S4 SoC dtsi.
Uses the newly introduced S4-specific compatible string.

Signed-off-by: Nick Xie <nick@khadas.com>
---
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 4a3e9ad82d280..a1c0ef91d7cfb 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -77,6 +77,20 @@ pwrc: power-controller {
 		};
 	};
 
+	saradc: adc@fe026000 {
+		compatible = "amlogic,meson-s4-saradc",
+			     "amlogic,meson-saradc";
+		reg = <0x0 0xfe026000 0x0 0x48>;
+		#io-channel-cells = <1>;
+		interrupts = <GIC_SPI 181 IRQ_TYPE_EDGE_RISING>;
+		clocks = <&xtal>,
+			 <&clkc_periphs CLKID_SAR_ADC>,
+			 <&clkc_periphs CLKID_SARADC>,
+			 <&clkc_periphs CLKID_SARADC_SEL>;
+		clock-names = "clkin", "core", "adc_clk", "adc_sel";
+		status = "disabled";
+	};
+
 	soc {
 		compatible = "simple-bus";
 		#address-cells = <2>;
-- 
2.34.1



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

* [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support
  2026-02-28  6:58 [PATCH v1 0/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
                   ` (2 preceding siblings ...)
  2026-02-28  6:58 ` [PATCH v1 3/4] arm64: dts: amlogic: meson-s4: add internal SARADC controller Nick Xie
@ 2026-02-28  6:58 ` Nick Xie
  2026-02-28 16:14   ` kernel test robot
  3 siblings, 1 reply; 15+ messages in thread
From: Nick Xie @ 2026-02-28  6:58 UTC (permalink / raw)
  To: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy
  Cc: linux-iio, robh, conor+dt, linux-amlogic, linux-arm-kernel,
	devicetree, linux-kernel, xieqinick, Nick Xie

Enable the SARADC controller and add the adc-keys node to support
the Function key found on the Khadas VIM1S board.

Signed-off-by: Nick Xie <nick@khadas.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 .../amlogic/meson-s4-s905y4-khadas-vim1s.dts  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts
index 664d64a267f2d..792ab45c4c944 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts
@@ -40,6 +40,20 @@ secmon_reserved: secmon@5000000 {
 		};
 	};
 
+	adc-keys {
+		compatible = "adc-keys";
+		io-channels = <&saradc 0>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <1710000>;
+		poll-interval = <100>;
+
+		button-function {
+			label = "Function";
+			linux,code = <KEY_FN>;
+			press-threshold-microvolt = <10000>;
+		};
+	};
+
 	emmc_pwrseq: emmc-pwrseq {
 		compatible = "mmc-pwrseq-emmc";
 		reset-gpios = <&gpio GPIOB_9 GPIO_ACTIVE_LOW>;
@@ -278,6 +292,11 @@ brcmf: wifi@1 {
 	};
 };
 
+&saradc {
+	status = "okay";
+	vref-supply = <&vddio_ao1v8>;
+};
+
 &spicc0 {
 	status = "okay";
 	pinctrl-names = "default";
-- 
2.34.1



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

* Re: [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-02-28  6:58 ` [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible Nick Xie
@ 2026-02-28 11:18   ` Krzysztof Kozlowski
  2026-02-28 11:20     ` Krzysztof Kozlowski
  2026-03-02 11:58     ` Martin Blumenstingl
  0 siblings, 2 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-28 11:18 UTC (permalink / raw)
  To: Nick Xie
  Cc: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy, linux-iio, robh, conor+dt,
	linux-amlogic, linux-arm-kernel, devicetree, linux-kernel,
	xieqinick

On Sat, Feb 28, 2026 at 02:58:37PM +0800, Nick Xie wrote:
> Add the compatible string for the SARADC (Successive Approximation
> Register ADC) IP block found in the Amlogic Meson S4 SoC.

... which is fully compatible with g12a?

Write proper explanations.

> 
> Signed-off-by: Nick Xie <nick@khadas.com>
> ---
>  .../devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml        | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> index bb9825e7346dd..5496a0dc714aa 100644
> --- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> @@ -27,6 +27,7 @@ properties:
>                - amlogic,meson-gxm-saradc
>                - amlogic,meson-axg-saradc
>                - amlogic,meson-g12a-saradc
> +              - amlogic,meson-s4-saradc

If this is compatible with other device, you need proper fallback.

>            - const: amlogic,meson-saradc

And this one is now kind of fake - how does this device use it?

Best regards,
Krzysztof



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

* Re: [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-02-28 11:18   ` Krzysztof Kozlowski
@ 2026-02-28 11:20     ` Krzysztof Kozlowski
  2026-03-02 11:58     ` Martin Blumenstingl
  1 sibling, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-28 11:20 UTC (permalink / raw)
  To: Nick Xie
  Cc: neil.armstrong, khilman, martin.blumenstingl, jbrunet, krzk+dt,
	jic23, dlechner, nuno.sa, andy, linux-iio, robh, conor+dt,
	linux-amlogic, linux-arm-kernel, devicetree, linux-kernel,
	xieqinick

On 28/02/2026 12:18, Krzysztof Kozlowski wrote:
> On Sat, Feb 28, 2026 at 02:58:37PM +0800, Nick Xie wrote:
>> Add the compatible string for the SARADC (Successive Approximation
>> Register ADC) IP block found in the Amlogic Meson S4 SoC.
> 
> ... which is fully compatible with g12a?
> 
> Write proper explanations.
> 
>>
>> Signed-off-by: Nick Xie <nick@khadas.com>
>> ---
>>  .../devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml        | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
>> index bb9825e7346dd..5496a0dc714aa 100644
>> --- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
>> +++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
>> @@ -27,6 +27,7 @@ properties:
>>                - amlogic,meson-gxm-saradc
>>                - amlogic,meson-axg-saradc
>>                - amlogic,meson-g12a-saradc
>> +              - amlogic,meson-s4-saradc
> 
> If this is compatible with other device, you need proper fallback.
> 
>>            - const: amlogic,meson-saradc
> 
> And this one is now kind of fake - how does this device use it?

I checked now - NOTHING uses it. This is completely useless fallback,
don't write such schema. Add a comment that usage of this fallback is
not allowed for new devices and instead create proper compatibility
(look at your driver code).

Best regards,
Krzysztof


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

* Re: [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support
  2026-02-28  6:58 ` [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support Nick Xie
@ 2026-02-28 16:14   ` kernel test robot
  2026-03-02 12:00     ` Martin Blumenstingl
  0 siblings, 1 reply; 15+ messages in thread
From: kernel test robot @ 2026-02-28 16:14 UTC (permalink / raw)
  To: Nick Xie, neil.armstrong, khilman, martin.blumenstingl, jbrunet,
	krzk+dt, jic23, dlechner, nuno.sa, andy
  Cc: llvm, oe-kbuild-all, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick, Nick Xie

Hi Nick,

kernel test robot noticed the following build errors:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on robh/for-next linus/master v7.0-rc1 next-20260227]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Nick-Xie/dt-bindings-iio-adc-amlogic-meson-saradc-add-S4-compatible/20260228-150346
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20260228065840.702651-5-nick%40khadas.com
patch subject: [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support
config: arm64-randconfig-001-20260228 (https://download.01.org/0day-ci/archive/20260301/202603010009.VfPuPoeI-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9a109fbb6e184ec9bcce10615949f598f4c974a9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260301/202603010009.VfPuPoeI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603010009.VfPuPoeI-lkp@intel.com/

All errors (new ones prefixed by >>):

   Lexical error: arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts:50.18-24 Unexpected 'KEY_FN'
>> FATAL ERROR: Syntax error parsing input tree

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [PATCH v1 2/4] iio: adc: meson-saradc: add support for Meson S4
  2026-02-28  6:58 ` [PATCH v1 2/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
@ 2026-03-02 11:50   ` Martin Blumenstingl
  0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-03-02 11:50 UTC (permalink / raw)
  To: Nick Xie
  Cc: neil.armstrong, khilman, jbrunet, krzk+dt, jic23, dlechner,
	nuno.sa, andy, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick

On Sat, Feb 28, 2026 at 7:59 AM Nick Xie <nick@khadas.com> wrote:
>
> Add support for the SARADC found on the Amlogic Meson S4 SoC.
> According to the documentation and current testing, it is fully
> compatible with the G12A parameter set, so we reuse
> `meson_sar_adc_g12a_data` for this new compatible string.
>
> Signed-off-by: Nick Xie <nick@khadas.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>


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

* Re: [PATCH v1 3/4] arm64: dts: amlogic: meson-s4: add internal SARADC controller
  2026-02-28  6:58 ` [PATCH v1 3/4] arm64: dts: amlogic: meson-s4: add internal SARADC controller Nick Xie
@ 2026-03-02 11:50   ` Martin Blumenstingl
  0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-03-02 11:50 UTC (permalink / raw)
  To: Nick Xie
  Cc: neil.armstrong, khilman, jbrunet, krzk+dt, jic23, dlechner,
	nuno.sa, andy, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick

On Sat, Feb 28, 2026 at 7:59 AM Nick Xie <nick@khadas.com> wrote:
>
> Add the SARADC controller node to the Meson S4 SoC dtsi.
> Uses the newly introduced S4-specific compatible string.
>
> Signed-off-by: Nick Xie <nick@khadas.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>


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

* Re: [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-02-28 11:18   ` Krzysztof Kozlowski
  2026-02-28 11:20     ` Krzysztof Kozlowski
@ 2026-03-02 11:58     ` Martin Blumenstingl
  2026-03-02 13:59       ` Krzysztof Kozlowski
  1 sibling, 1 reply; 15+ messages in thread
From: Martin Blumenstingl @ 2026-03-02 11:58 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Nick Xie, neil.armstrong, khilman, jbrunet, krzk+dt, jic23,
	dlechner, nuno.sa, andy, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick

Hi Krzysztof,

On Sat, Feb 28, 2026 at 12:18 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Sat, Feb 28, 2026 at 02:58:37PM +0800, Nick Xie wrote:
> > Add the compatible string for the SARADC (Successive Approximation
> > Register ADC) IP block found in the Amlogic Meson S4 SoC.
>
> ... which is fully compatible with g12a?
>
> Write proper explanations.
Would you be fine with:
"There are no known differences between the SARADC on S4 and the one
on G12A. In the past differences between SARADC on the different SoCs
generations have been uncovered late, meaning that a dedicated
compatible string has proven to be useful."

Do you also require Nick to add amlogic,meson-g12a-saradc as fallback
compatible string for amlogic,meson-s4-saradc?

> >
> > Signed-off-by: Nick Xie <nick@khadas.com>
> > ---
> >  .../devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml        | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> > index bb9825e7346dd..5496a0dc714aa 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> > +++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> > @@ -27,6 +27,7 @@ properties:
> >                - amlogic,meson-gxm-saradc
> >                - amlogic,meson-axg-saradc
> >                - amlogic,meson-g12a-saradc
> > +              - amlogic,meson-s4-saradc
>
> If this is compatible with other device, you need proper fallback.
>
> >            - const: amlogic,meson-saradc
>
> And this one is now kind of fake - how does this device use it?
As you have noticed later, it is currently not used.
Can you please confirm that my understanding of the next steps is correct:
- you're expecting Nick to omit the amlogic,meson-saradc fallback
compatible string for amlogic,meson-s4-saradc
- and you would like to see amlogic,meson-saradc removed (from the
bindings and .dts files that are already upstream) - I will take care
of this once S4 support lands upstream


Best regards,
Martin


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

* Re: [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support
  2026-02-28 16:14   ` kernel test robot
@ 2026-03-02 12:00     ` Martin Blumenstingl
  0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-03-02 12:00 UTC (permalink / raw)
  To: kernel test robot
  Cc: Nick Xie, neil.armstrong, khilman, jbrunet, krzk+dt, jic23,
	dlechner, nuno.sa, andy, llvm, oe-kbuild-all, linux-iio, robh,
	conor+dt, linux-amlogic, linux-arm-kernel, devicetree,
	linux-kernel, xieqinick

On Sat, Feb 28, 2026 at 5:16 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Nick,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on jic23-iio/togreg]
> [also build test ERROR on robh/for-next linus/master v7.0-rc1 next-20260227]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Nick-Xie/dt-bindings-iio-adc-amlogic-meson-saradc-add-S4-compatible/20260228-150346
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
> patch link:    https://lore.kernel.org/r/20260228065840.702651-5-nick%40khadas.com
> patch subject: [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support
> config: arm64-randconfig-001-20260228 (https://download.01.org/0day-ci/archive/20260301/202603010009.VfPuPoeI-lkp@intel.com/config)
> compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9a109fbb6e184ec9bcce10615949f598f4c974a9)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260301/202603010009.VfPuPoeI-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202603010009.VfPuPoeI-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>    Lexical error: arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts:50.18-24 Unexpected 'KEY_FN'
> >> FATAL ERROR: Syntax error parsing input tree
It turns out that this series is supposed to be applied on top of
"arm64: dts: amlogic: meson-s4-khadas-vim1s: enable LEDs, Keys and
Bluetooth" [0]
When applying this series on top of the other then there's no more build error.


[0] https://lore.kernel.org/linux-amlogic/20260228063750.701887-1-nick@khadas.com/T/#m2f4d30878fc8252f853bdb3005042c3aad97961e


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

* Re: [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-03-02 11:58     ` Martin Blumenstingl
@ 2026-03-02 13:59       ` Krzysztof Kozlowski
  2026-03-02 21:03         ` Martin Blumenstingl
  0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-02 13:59 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Nick Xie, neil.armstrong, khilman, jbrunet, krzk+dt, jic23,
	dlechner, nuno.sa, andy, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick

On 02/03/2026 12:58, Martin Blumenstingl wrote:
> Hi Krzysztof,
> 
> On Sat, Feb 28, 2026 at 12:18 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On Sat, Feb 28, 2026 at 02:58:37PM +0800, Nick Xie wrote:
>>> Add the compatible string for the SARADC (Successive Approximation
>>> Register ADC) IP block found in the Amlogic Meson S4 SoC.
>>
>> ... which is fully compatible with g12a?
>>
>> Write proper explanations.
> Would you be fine with:
> "There are no known differences between the SARADC on S4 and the one
> on G12A. In the past differences between SARADC on the different SoCs
> generations have been uncovered late, meaning that a dedicated
> compatible string has proven to be useful."

No, last sentence is redundant. You do not need to explain in the commit
msg rules of bindings, because they are obvious/known. You need to
explain the hardware, e.g. in this case the compatibility between devices.

> 
> Do you also require Nick to add amlogic,meson-g12a-saradc as fallback
> compatible string for amlogic,meson-s4-saradc?
> 
>>>
>>> Signed-off-by: Nick Xie <nick@khadas.com>
>>> ---
>>>  .../devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml        | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
>>> index bb9825e7346dd..5496a0dc714aa 100644
>>> --- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
>>> +++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
>>> @@ -27,6 +27,7 @@ properties:
>>>                - amlogic,meson-gxm-saradc
>>>                - amlogic,meson-axg-saradc
>>>                - amlogic,meson-g12a-saradc
>>> +              - amlogic,meson-s4-saradc
>>
>> If this is compatible with other device, you need proper fallback.
>>
>>>            - const: amlogic,meson-saradc
>>
>> And this one is now kind of fake - how does this device use it?
> As you have noticed later, it is currently not used.
> Can you please confirm that my understanding of the next steps is correct:
> - you're expecting Nick to omit the amlogic,meson-saradc fallback
> compatible string for amlogic,meson-s4-saradc

Not omit but replace with proper fallback to specific compatible.

> - and you would like to see amlogic,meson-saradc removed (from the
> bindings and .dts files that are already upstream) - I will take care
> of this once S4 support lands upstream

This no. It's an ABI, you cannot change it. Not worth it, either.

Best regards,
Krzysztof


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

* Re: [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-03-02 13:59       ` Krzysztof Kozlowski
@ 2026-03-02 21:03         ` Martin Blumenstingl
  2026-03-03  6:25           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Blumenstingl @ 2026-03-02 21:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Nick Xie, neil.armstrong, khilman, jbrunet, krzk+dt, jic23,
	dlechner, nuno.sa, andy, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick

Hi Krzysztof,

On Mon, Mar 2, 2026 at 2:59 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 02/03/2026 12:58, Martin Blumenstingl wrote:
> > Hi Krzysztof,
> >
> > On Sat, Feb 28, 2026 at 12:18 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >>
> >> On Sat, Feb 28, 2026 at 02:58:37PM +0800, Nick Xie wrote:
> >>> Add the compatible string for the SARADC (Successive Approximation
> >>> Register ADC) IP block found in the Amlogic Meson S4 SoC.
> >>
> >> ... which is fully compatible with g12a?
> >>
> >> Write proper explanations.
> > Would you be fine with:
> > "There are no known differences between the SARADC on S4 and the one
> > on G12A. In the past differences between SARADC on the different SoCs
> > generations have been uncovered late, meaning that a dedicated
> > compatible string has proven to be useful."
>
> No, last sentence is redundant. You do not need to explain in the commit
> msg rules of bindings, because they are obvious/known. You need to
> explain the hardware, e.g. in this case the compatibility between devices.
Understood, thanks.

> >
> > Do you also require Nick to add amlogic,meson-g12a-saradc as fallback
> > compatible string for amlogic,meson-s4-saradc?
> >
> >>>
> >>> Signed-off-by: Nick Xie <nick@khadas.com>
> >>> ---
> >>>  .../devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml        | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> >>> index bb9825e7346dd..5496a0dc714aa 100644
> >>> --- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> >>> +++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.yaml
> >>> @@ -27,6 +27,7 @@ properties:
> >>>                - amlogic,meson-gxm-saradc
> >>>                - amlogic,meson-axg-saradc
> >>>                - amlogic,meson-g12a-saradc
> >>> +              - amlogic,meson-s4-saradc
> >>
> >> If this is compatible with other device, you need proper fallback.
> >>
> >>>            - const: amlogic,meson-saradc
> >>
> >> And this one is now kind of fake - how does this device use it?
> > As you have noticed later, it is currently not used.
> > Can you please confirm that my understanding of the next steps is correct:
> > - you're expecting Nick to omit the amlogic,meson-saradc fallback
> > compatible string for amlogic,meson-s4-saradc
>
> Not omit but replace with proper fallback to specific compatible.
So in this case we need to end up with:
compatible = "amlogic,meson-s4-saradc", "amlogic,meson-g12a-saradc"
Stating that the S4 SARADC IP is compatible with the G12A SARADC IP.
Any S4 specific quirks that we need (in case we ever find something)
can then be managed in the driver.

> > - and you would like to see amlogic,meson-saradc removed (from the
> > bindings and .dts files that are already upstream) - I will take care
> > of this once S4 support lands upstream
>
> This no. It's an ABI, you cannot change it. Not worth it, either.
You suggested adding a comment stating that future bindings must not
use the "amlogic,meson-saradc" compatible string anymore.
Since it's part of ABI we need to keep it. So adding a comment is all I'll do.


Best regards,
Martin


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

* Re: [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
  2026-03-02 21:03         ` Martin Blumenstingl
@ 2026-03-03  6:25           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-03  6:25 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Nick Xie, neil.armstrong, khilman, jbrunet, krzk+dt, jic23,
	dlechner, nuno.sa, andy, linux-iio, robh, conor+dt, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel, xieqinick

On 02/03/2026 22:03, Martin Blumenstingl wrote:
>>> - and you would like to see amlogic,meson-saradc removed (from the
>>> bindings and .dts files that are already upstream) - I will take care
>>> of this once S4 support lands upstream
>>
>> This no. It's an ABI, you cannot change it. Not worth it, either.
> You suggested adding a comment stating that future bindings must not
> use the "amlogic,meson-saradc" compatible string anymore.
> Since it's part of ABI we need to keep it. So adding a comment is all I'll do.
> 


Yes, comment would be useful.

Best regards,
Krzysztof


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

end of thread, other threads:[~2026-03-03  6:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-28  6:58 [PATCH v1 0/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
2026-02-28  6:58 ` [PATCH v1 1/4] dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible Nick Xie
2026-02-28 11:18   ` Krzysztof Kozlowski
2026-02-28 11:20     ` Krzysztof Kozlowski
2026-03-02 11:58     ` Martin Blumenstingl
2026-03-02 13:59       ` Krzysztof Kozlowski
2026-03-02 21:03         ` Martin Blumenstingl
2026-03-03  6:25           ` Krzysztof Kozlowski
2026-02-28  6:58 ` [PATCH v1 2/4] iio: adc: meson-saradc: add support for Meson S4 Nick Xie
2026-03-02 11:50   ` Martin Blumenstingl
2026-02-28  6:58 ` [PATCH v1 3/4] arm64: dts: amlogic: meson-s4: add internal SARADC controller Nick Xie
2026-03-02 11:50   ` Martin Blumenstingl
2026-02-28  6:58 ` [PATCH v1 4/4] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support Nick Xie
2026-02-28 16:14   ` kernel test robot
2026-03-02 12:00     ` Martin Blumenstingl

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