d1: add new target
[openwrt/staging/mans0n.git] / target / linux / d1 / patches-6.1 / 0083-riscv-dts-allwinner-d1-Add-sound-cards-to-boards.patch
1 From 54b1030c72d74ba6390d62086cbfc6a511f58aa7 Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Thu, 11 Aug 2022 00:39:42 -0500
4 Subject: [PATCH 083/117] riscv: dts: allwinner: d1: Add sound cards to boards
5
6 Signed-off-by: Samuel Holland <samuel@sholland.org>
7 ---
8 .../sun20i-d1-common-regulators.dtsi | 5 +++++
9 .../sun20i-d1-lichee-rv-86-panel.dtsi | 21 +++++++++++++++++++
10 .../allwinner/sun20i-d1-lichee-rv-dock.dts | 12 +++++++++++
11 .../boot/dts/allwinner/sun20i-d1-nezha.dts | 12 +++++++++++
12 arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi | 13 +++++++++++-
13 5 files changed, 62 insertions(+), 1 deletion(-)
14
15 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-common-regulators.dtsi
16 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-common-regulators.dtsi
17 @@ -18,6 +18,11 @@
18 };
19 };
20
21 +&codec {
22 + avcc-supply = <&reg_aldo>;
23 + hpvcc-supply = <&reg_hpldo>;
24 +};
25 +
26 &lradc {
27 vref-supply = <&reg_aldo>;
28 };
29 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dtsi
30 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dtsi
31 @@ -9,6 +9,12 @@
32 ethernet1 = &xr829;
33 };
34
35 + audio_amplifier: audio-amplifier {
36 + compatible = "simple-audio-amplifier";
37 + enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
38 + sound-name-prefix = "Amplifier";
39 + };
40 +
41 dmic_codec: dmic-codec {
42 compatible = "dmic-codec";
43 num-channels = <2>;
44 @@ -51,6 +57,21 @@
45 };
46 };
47
48 +&codec {
49 + aux-devs = <&audio_amplifier>;
50 + routing = "Internal Speaker", "Amplifier OUTL",
51 + "Internal Speaker", "Amplifier OUTR",
52 + "Amplifier INL", "HPOUTL",
53 + "Amplifier INR", "HPOUTR",
54 + "LINEINL", "HPOUTL",
55 + "LINEINR", "HPOUTR",
56 + "MICIN3", "Internal Microphone",
57 + "Internal Microphone", "HBIAS";
58 + widgets = "Microphone", "Internal Microphone",
59 + "Speaker", "Internal Speaker";
60 + status = "okay";
61 +};
62 +
63 &dmic {
64 pinctrl-0 = <&dmic_pb11_d0_pin>, <&dmic_pe17_clk_pin>;
65 pinctrl-names = "default";
66 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts
67 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts
68 @@ -48,6 +48,18 @@
69 };
70 };
71
72 +&codec {
73 + routing = "Internal Speaker", "HPOUTL",
74 + "Internal Speaker", "HPOUTR",
75 + "LINEINL", "HPOUTL",
76 + "LINEINR", "HPOUTR",
77 + "MICIN3", "Internal Microphone",
78 + "Internal Microphone", "HBIAS";
79 + widgets = "Microphone", "Internal Microphone",
80 + "Speaker", "Internal Speaker";
81 + status = "okay";
82 +};
83 +
84 &dmic {
85 pinctrl-0 = <&dmic_pb11_d0_pin>, <&dmic_pe17_clk_pin>;
86 pinctrl-names = "default";
87 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
88 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
89 @@ -51,6 +51,18 @@
90 };
91 };
92
93 +&codec {
94 + routing = "Headphone Jack", "HPOUTL",
95 + "Headphone Jack", "HPOUTR",
96 + "LINEINL", "HPOUTL",
97 + "LINEINR", "HPOUTR",
98 + "MICIN3", "Headset Microphone",
99 + "Headset Microphone", "HBIAS";
100 + widgets = "Microphone", "Headset Microphone",
101 + "Headphone", "Headphone Jack";
102 + status = "okay";
103 +};
104 +
105 &cpu0 {
106 cpu-supply = <&reg_vdd_cpu>;
107 };
108 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi
109 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi
110 @@ -312,10 +312,21 @@
111 };
112
113 codec: audio-codec@2030000 {
114 - compatible = "simple-mfd", "syscon";
115 + compatible = "allwinner,sun20i-d1-codec", "simple-mfd", "syscon";
116 reg = <0x2030000 0x1000>;
117 + interrupts = <41 IRQ_TYPE_LEVEL_HIGH>;
118 + clocks = <&ccu CLK_BUS_AUDIO>,
119 + <&ccu CLK_AUDIO_ADC>,
120 + <&ccu CLK_AUDIO_DAC>,
121 + <&osc24M>,
122 + <&rtc CLK_OSC32K>;
123 + clock-names = "bus", "adc", "dac", "hosc", "losc";
124 + resets = <&ccu RST_BUS_AUDIO>;
125 + dmas = <&dma 7>, <&dma 7>;
126 + dma-names = "rx", "tx";
127 #address-cells = <1>;
128 #size-cells = <1>;
129 + #sound-dai-cells = <0>;
130
131 regulators@2030348 {
132 compatible = "allwinner,sun20i-d1-analog-ldos";