dts: starfive: Add wm8960 and ac108 dts
authorJianlong Huang <jianlong.huang@starfivetech.com>
Thu, 1 Sep 2022 07:22:36 +0000 (15:22 +0800)
committerJianlong Huang <jianlong.huang@starfivetech.com>
Thu, 3 Nov 2022 09:23:28 +0000 (17:23 +0800)
Add wm8960 and ac108 dts base default dts

Signed-off-by: Jianlong Huang <jianlong.huang@starfivetech.com>
arch/riscv/boot/dts/starfive/Makefile
arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-ac108.dts [new file with mode: 0644]
arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-wm8960.dts [new file with mode: 0644]
arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi

index 328f4cc..697a57a 100644 (file)
@@ -12,4 +12,6 @@ dtb-$(CONFIG_SOC_STARFIVE_JH7110) += jh7110-visionfive-v2.dtb \
                                jh7110-evb-uart4-emmc-spdif.dtb \
                                jh7110-evb-uart5-pwm-i2c-tdm.dtb\
                                jh7110-evb-usbdevice.dtb        \
-                               jh7110-visionfive-v2-A10.dtb
+                               jh7110-visionfive-v2-A10.dtb    \
+                               jh7110-visionfive-v2-wm8960.dtb \
+                               jh7110-visionfive-v2-ac108.dtb
diff --git a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-ac108.dts b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-ac108.dts
new file mode 100644 (file)
index 0000000..be979a9
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright (C) 2022 StarFive Technology Co., Ltd.
+ * Copyright (C) 2022 Hal Feng <hal.feng@starfivetech.com>
+ */
+
+/dts-v1/;
+#include "jh7110-visionfive-v2.dts"
+#include "codecs/sf_ac108.dtsi"
+
+&i2srx_3ch {
+       status = "okay";
+};
+
diff --git a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-wm8960.dts b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-wm8960.dts
new file mode 100644 (file)
index 0000000..480bd0d
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright (C) 2022 StarFive Technology Co., Ltd.
+ * Copyright (C) 2022 Hal Feng <hal.feng@starfivetech.com>
+ */
+
+/dts-v1/;
+#include "jh7110-visionfive-v2.dts"
+#include "codecs/sf_wm8960.dtsi"
+
+&i2srx_3ch {
+       status = "okay";
+};
+
+&i2stx_4ch1 {
+       status = "okay";
+};
index 818d209..d53248e 100644 (file)
@@ -9,18 +9,6 @@
 #include <dt-bindings/pinctrl/starfive,jh7110-pinfunc.h>
 #include "jh7110.dtsi"
 #include "codecs/sf_pwmdac.dtsi"
-#undef WM8960_ENABLED
-#undef AC108_ENABLED
-
-#ifdef WM8960_ENABLED
-#define WM8960_AC108_COMMON 1
-#include "codecs/sf_wm8960.dtsi"
-#endif
-
-#ifdef AC108_ENABLED
-#define WM8960_AC108_COMMON 1
-#include "codecs/sf_ac108.dtsi"
-#endif
 
 / {
        model = "StarFive VisionFive V2";
                };
        };
 
-#ifdef WM8960_AC108_COMMON
        i2srx_pins: i2srx-pins {
                i2srx-pins0 {
                        sf,pins = <PAD_GPIO61>;
                        sf,pin-gpio-doen = <OEN_HIGH>;
                };
        };
-#endif
-#ifdef WM8960_ENABLED
+
        i2stx_pins: i2stx-pins {
                i2stx-pins0 {
                        sf,pins = <PAD_GPIO44>;
                        sf,pin-gpio-doen = <OEN_LOW>;
                };
        };
-#endif
 };
 
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c0_pins>;
        status = "okay";
-#ifdef AC108_ENABLED
+
        ac108_a: ac108@3b {
                compatible = "x-power,ac108_0";
                reg = <0x3b>;
                #sound-dai-cells = <0>;
                data-protocol = <0>;
        };
-#endif
-#ifdef WM8960_ENABLED
+
        wm8960: codec@1a {
                compatible = "wlf,wm8960";
                reg = <0x1a>;
 
                wlf,shared-lrclk;
        };
-#endif
 };
 
 &i2c2 {
        status = "okay";
 };
 
-#ifdef WM8960_AC108_COMMON
 &i2srx_3ch {
        pinctrl-names = "default";
        pinctrl-0 = <&i2s_clk_pins &i2srx_pins>;
-       status = "okay";
+       status = "disabled";
 };
-#endif
-#ifdef WM8960_ENABLED
+
 &i2stx_4ch1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2stx_pins>;
-       status = "okay";
+       status = "disabled";
 };
-#endif
 
 &pwmdac_codec {
        status = "okay";