2
0

0083-riscv-dts-allwinner-d1-Add-sound-cards-to-boards.patch 3.7 KB

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