From 3675b5df0c9aa36d5cf8a701bcb1616e46b0576c Mon Sep 17 00:00:00 2001 From: Jianlong Huang Date: Thu, 1 Sep 2022 15:22:36 +0800 Subject: [PATCH] dts: starfive: Add wm8960 and ac108 dts Add wm8960 and ac108 dts base default dts Signed-off-by: Jianlong Huang --- arch/riscv/boot/dts/starfive/Makefile | 4 ++- .../starfive/jh7110-visionfive-v2-ac108.dts | 14 ++++++++ .../starfive/jh7110-visionfive-v2-wm8960.dts | 17 ++++++++++ .../dts/starfive/jh7110-visionfive-v2.dtsi | 32 ++++--------------- 4 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-ac108.dts create mode 100644 arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-wm8960.dts diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile index 328f4cc7d54c..697a57a3cff8 100644 --- a/arch/riscv/boot/dts/starfive/Makefile +++ b/arch/riscv/boot/dts/starfive/Makefile @@ -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 index 000000000000..be979a9f9f8a --- /dev/null +++ b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-ac108.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2022 StarFive Technology Co., Ltd. + * Copyright (C) 2022 Hal Feng + */ + +/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 index 000000000000..480bd0d2cc94 --- /dev/null +++ b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-wm8960.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2022 StarFive Technology Co., Ltd. + * Copyright (C) 2022 Hal Feng + */ + +/dts-v1/; +#include "jh7110-visionfive-v2.dts" +#include "codecs/sf_wm8960.dtsi" + +&i2srx_3ch { + status = "okay"; +}; + +&i2stx_4ch1 { + status = "okay"; +}; diff --git a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi index 818d209a4e92..d53248e1b1cc 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi @@ -9,18 +9,6 @@ #include #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"; @@ -326,7 +314,6 @@ }; }; -#ifdef WM8960_AC108_COMMON i2srx_pins: i2srx-pins { i2srx-pins0 { sf,pins = ; @@ -354,8 +341,7 @@ sf,pin-gpio-doen = ; }; }; -#endif -#ifdef WM8960_ENABLED + i2stx_pins: i2stx-pins { i2stx-pins0 { sf,pins = ; @@ -365,7 +351,6 @@ sf,pin-gpio-doen = ; }; }; -#endif }; &uart0 { @@ -397,15 +382,14 @@ 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>; @@ -413,7 +397,6 @@ wlf,shared-lrclk; }; -#endif }; &i2c2 { @@ -635,20 +618,17 @@ 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"; -- 2.34.1