From 54b1030c72d74ba6390d62086cbfc6a511f58aa7 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 11 Aug 2022 00:39:42 -0500 Subject: [PATCH 083/117] riscv: dts: allwinner: d1: Add sound cards to boards Signed-off-by: Samuel Holland --- .../sun20i-d1-common-regulators.dtsi | 5 +++++ .../sun20i-d1-lichee-rv-86-panel.dtsi | 21 +++++++++++++++++++ .../allwinner/sun20i-d1-lichee-rv-dock.dts | 12 +++++++++++ .../boot/dts/allwinner/sun20i-d1-nezha.dts | 12 +++++++++++ arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi | 13 +++++++++++- 5 files changed, 62 insertions(+), 1 deletion(-) --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-common-regulators.dtsi +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-common-regulators.dtsi @@ -18,6 +18,11 @@ }; }; +&codec { + avcc-supply = <®_aldo>; + hpvcc-supply = <®_hpldo>; +}; + &lradc { vref-supply = <®_aldo>; }; --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dtsi +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dtsi @@ -9,6 +9,12 @@ ethernet1 = &xr829; }; + audio_amplifier: audio-amplifier { + compatible = "simple-audio-amplifier"; + enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */ + sound-name-prefix = "Amplifier"; + }; + dmic_codec: dmic-codec { compatible = "dmic-codec"; num-channels = <2>; @@ -51,6 +57,21 @@ }; }; +&codec { + aux-devs = <&audio_amplifier>; + routing = "Internal Speaker", "Amplifier OUTL", + "Internal Speaker", "Amplifier OUTR", + "Amplifier INL", "HPOUTL", + "Amplifier INR", "HPOUTR", + "LINEINL", "HPOUTL", + "LINEINR", "HPOUTR", + "MICIN3", "Internal Microphone", + "Internal Microphone", "HBIAS"; + widgets = "Microphone", "Internal Microphone", + "Speaker", "Internal Speaker"; + status = "okay"; +}; + &dmic { pinctrl-0 = <&dmic_pb11_d0_pin>, <&dmic_pe17_clk_pin>; pinctrl-names = "default"; --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts @@ -48,6 +48,18 @@ }; }; +&codec { + routing = "Internal Speaker", "HPOUTL", + "Internal Speaker", "HPOUTR", + "LINEINL", "HPOUTL", + "LINEINR", "HPOUTR", + "MICIN3", "Internal Microphone", + "Internal Microphone", "HBIAS"; + widgets = "Microphone", "Internal Microphone", + "Speaker", "Internal Speaker"; + status = "okay"; +}; + &dmic { pinctrl-0 = <&dmic_pb11_d0_pin>, <&dmic_pe17_clk_pin>; pinctrl-names = "default"; --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts @@ -51,6 +51,18 @@ }; }; +&codec { + routing = "Headphone Jack", "HPOUTL", + "Headphone Jack", "HPOUTR", + "LINEINL", "HPOUTL", + "LINEINR", "HPOUTR", + "MICIN3", "Headset Microphone", + "Headset Microphone", "HBIAS"; + widgets = "Microphone", "Headset Microphone", + "Headphone", "Headphone Jack"; + status = "okay"; +}; + &cpu0 { cpu-supply = <®_vdd_cpu>; }; --- a/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi @@ -312,10 +312,21 @@ }; codec: audio-codec@2030000 { - compatible = "simple-mfd", "syscon"; + compatible = "allwinner,sun20i-d1-codec", "simple-mfd", "syscon"; reg = <0x2030000 0x1000>; + interrupts = <41 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_AUDIO>, + <&ccu CLK_AUDIO_ADC>, + <&ccu CLK_AUDIO_DAC>, + <&osc24M>, + <&rtc CLK_OSC32K>; + clock-names = "bus", "adc", "dac", "hosc", "losc"; + resets = <&ccu RST_BUS_AUDIO>; + dmas = <&dma 7>, <&dma 7>; + dma-names = "rx", "tx"; #address-cells = <1>; #size-cells = <1>; + #sound-dai-cells = <0>; regulators@2030348 { compatible = "allwinner,sun20i-d1-analog-ldos";