riscv: dts: starfive: Add JH7110 PWM-DAC support
authorHal Feng <hal.feng@starfivetech.com>
Mon, 14 Aug 2023 08:06:18 +0000 (16:06 +0800)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 19 Feb 2024 00:13:56 +0000 (09:13 +0900)
Add PWM-DAC support for StarFive JH7110 SoC.

Reviewed-by: Walker Chen <walker.chen@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
(cherry picked from commit be326bee09374a2ebd18cb5af8fcd6f1e7825260)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I643966a59e0dfadb8f333878e693d30937213966
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
arch/riscv/boot/dts/starfive/jh7110.dtsi

index ac1ae79..9510356 100644 (file)
                gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
                priority = <224>;
        };
+
+       pwmdac_codec: pwmdac-codec {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+       };
+
+       sound-pwmdac {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "StarFive-PWMDAC-Sound-Card";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               simple-audio-card,dai-link@0 {
+                       reg = <0>;
+                       format = "left_j";
+                       bitclock-master = <&sndcpu0>;
+                       frame-master = <&sndcpu0>;
+
+                       sndcpu0: cpu {
+                               sound-dai = <&pwmdac>;
+                       };
+
+                       codec {
+                               sound-dai = <&pwmdac_codec>;
+                       };
+               };
+       };
 };
 
 &dc8200 {
        status = "okay";
 };
 
+&pwmdac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwmdac_pins>;
+       status = "okay";
+};
+
 &qspi {
        #address-cells = <1>;
        #size-cells = <0>;
                };
        };
 
+       pwmdac_pins: pwmdac-0 {
+               pwmdac-pins {
+                       pinmux = <GPIOMUX(33, GPOUT_SYS_PWMDAC_LEFT,
+                                             GPOEN_ENABLE,
+                                             GPI_NONE)>,
+                                <GPIOMUX(34, GPOUT_SYS_PWMDAC_RIGHT,
+                                             GPOEN_ENABLE,
+                                             GPI_NONE)>;
+                       bias-disable;
+                       drive-strength = <2>;
+                       input-disable;
+                       input-schmitt-disable;
+                       slew-rate = <0>;
+               };
+       };
+
        spi0_pins: spi0-0 {
                mosi-pins {
                        pinmux = <GPIOMUX(52, GPOUT_SYS_SPI0_TXD,
index 41a9e35..76ebb76 100644 (file)
                        status = "disabled";
                };
 
+               pwmdac: pwmdac@100b0000 {
+                       compatible = "starfive,jh7110-pwmdac";
+                       reg = <0x0 0x100b0000 0x0 0x1000>;
+                       clocks = <&syscrg JH7110_SYSCLK_PWMDAC_APB>,
+                                <&syscrg JH7110_SYSCLK_PWMDAC_CORE>;
+                       clock-names = "apb", "core";
+                       resets = <&syscrg JH7110_SYSRST_PWMDAC_APB>;
+                       dmas = <&dma 22>;
+                       dma-names = "tx";
+                       #sound-dai-cells = <0>;
+                       status = "disabled";
+               };
+
                usb0: usb@10100000 {
                        compatible = "starfive,jh7110-usb";
                        ranges = <0x0 0x0 0x10100000 0x100000>;