Skip to content

Commit bd80ef5

Browse files
xdarklightkhilman
authored andcommitted
ARM64: dts: meson: meson-gx: add the SAR ADC
Add the SAR ADC to meson-gxbb.dtsi and meson-gxl.dtsi. GXBB provides a 10-bit ADC while GXL and GXM provide a 12-bit ADC. Some boards use resistor ladder buttons connected through one of the ADC channels. On newer devices (GXL and GXM) some boards use pull-ups/downs to change the resistance (and thus the ADC value) on one of the ADC channels to indicate the board revision. Signed-off-by: Martin Blumenstingl <[email protected]> Tested-by: Neil Armstrong <[email protected]> Reviewed-by: Andreas Färber <[email protected]> Signed-off-by: Kevin Hilman <[email protected]>
1 parent 249a224 commit bd80ef5

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

arch/arm64/boot/dts/amlogic/meson-gx.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@
237237
status = "disabled";
238238
};
239239

240+
saradc: adc@8680 {
241+
compatible = "amlogic,meson-saradc";
242+
reg = <0x0 0x8680 0x0 0x34>;
243+
#io-channel-cells = <1>;
244+
interrupts = <GIC_SPI 73 IRQ_TYPE_EDGE_RISING>;
245+
status = "disabled";
246+
};
247+
240248
pwm_ef: pwm@86c0 {
241249
compatible = "amlogic,meson-gx-pwm", "amlogic,meson-gxbb-pwm";
242250
reg = <0x0 0x086c0 0x0 0x10>;

arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,16 @@
490490
clocks = <&clkc CLKID_I2C>;
491491
};
492492

493+
&saradc {
494+
compatible = "amlogic,meson-gxbb-saradc", "amlogic,meson-saradc";
495+
clocks = <&xtal>,
496+
<&clkc CLKID_SAR_ADC>,
497+
<&clkc CLKID_SANA>,
498+
<&clkc CLKID_SAR_ADC_CLK>,
499+
<&clkc CLKID_SAR_ADC_SEL>;
500+
clock-names = "clkin", "core", "sana", "adc_clk", "adc_sel";
501+
};
502+
493503
&sd_emmc_a {
494504
clocks = <&clkc CLKID_SD_EMMC_A>,
495505
<&xtal>,

arch/arm64/boot/dts/amlogic/meson-gxl.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,16 @@
347347
clocks = <&clkc CLKID_I2C>;
348348
};
349349

350+
&saradc {
351+
compatible = "amlogic,meson-gxl-saradc", "amlogic,meson-saradc";
352+
clocks = <&xtal>,
353+
<&clkc CLKID_SAR_ADC>,
354+
<&clkc CLKID_SANA>,
355+
<&clkc CLKID_SAR_ADC_CLK>,
356+
<&clkc CLKID_SAR_ADC_SEL>;
357+
clock-names = "clkin", "core", "sana", "adc_clk", "adc_sel";
358+
};
359+
350360
&sd_emmc_a {
351361
clocks = <&clkc CLKID_SD_EMMC_A>,
352362
<&xtal>,

arch/arm64/boot/dts/amlogic/meson-gxm.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@
117117
};
118118
};
119119

120+
&saradc {
121+
compatible = "amlogic,meson-gxm-saradc", "amlogic,meson-saradc";
122+
};
123+
120124
&scpi_dvfs {
121125
clock-indices = <0 1>;
122126
clock-output-names = "vbig", "vlittle";

0 commit comments

Comments
 (0)