devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hal Feng <hal.feng@starfivetech.com>
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor@kernel.org>,
	"Walker Chen" <walker.chen@starfivetech.com>,
	Xingyu Wu <xingyu.wu@starfivetech.com>,
	Emil Renner Berthing <emil.renner.berthing@canonical.com>,
	Hal Feng <hal.feng@starfivetech.com>
Cc: <alsa-devel@alsa-project.org>, <devicetree@vger.kernel.org>,
	<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v1 5/5] riscv: dts: starfive: Add JH7110 PWM-DAC support
Date: Mon, 26 Jun 2023 19:09:09 +0800	[thread overview]
Message-ID: <20230626110909.38718-6-hal.feng@starfivetech.com> (raw)
In-Reply-To: <20230626110909.38718-1-hal.feng@starfivetech.com>

Add PWM-DAC support for StarFive JH7110 SoC.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
---
 .../jh7110-starfive-visionfive-2.dtsi         | 50 +++++++++++++++++++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      | 13 +++++
 2 files changed, 63 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
index 19b5954ee72d..5ca66a65e722 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
@@ -36,6 +36,34 @@ gpio-restart {
 		gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
 		priority = <224>;
 	};
+
+	pwmdac_dit: pwmdac-dit {
+		compatible = "starfive,jh7110-pwmdac-dit";
+		#sound-dai-cells = <0>;
+	};
+
+	sound {
+		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>;
+			status = "okay";
+
+			sndcpu0: cpu {
+				sound-dai = <&pwmdac>;
+			};
+
+			codec {
+				sound-dai = <&pwmdac_dit>;
+			};
+		};
+	};
 };
 
 &dvp_clk {
@@ -191,6 +219,22 @@ GPOEN_SYS_I2C6_DATA,
 		};
 	};
 
+	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>;
+		};
+	};
+
 	uart0_pins: uart0-0 {
 		tx-pins {
 			pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
@@ -250,6 +294,12 @@ GPOEN_DISABLE,
 	};
 };
 
+&pwmdac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwmdac_pins>;
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins>;
diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index cfda6fb0d91b..bbb3f65e6f80 100644
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -387,6 +387,19 @@ tdm: tdm@10090000 {
 			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";
+		};
+
 		stgcrg: clock-controller@10230000 {
 			compatible = "starfive,jh7110-stgcrg";
 			reg = <0x0 0x10230000 0x0 0x10000>;
-- 
2.38.1


  parent reply	other threads:[~2023-06-26 11:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 11:09 [PATCH v1 0/5] Add PWM-DAC audio support for StarFive JH7110 RISC-V SoC Hal Feng
2023-06-26 11:09 ` [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter Hal Feng
2023-06-26 15:32   ` Krzysztof Kozlowski
2023-06-30  1:42     ` Hal Feng
2023-06-26 15:34   ` Krzysztof Kozlowski
2023-06-30  1:57     ` Hal Feng
2023-07-01  8:17       ` Krzysztof Kozlowski
2023-07-10  3:22         ` Hal Feng
2023-07-25  8:27           ` Hal Feng
2023-06-26 11:09 ` [PATCH v1 2/5] ASoC: codecs: Add StarFive JH7110 dummy PWM-DAC transmitter driver Hal Feng
2023-06-26 15:33   ` Krzysztof Kozlowski
2023-06-30  1:45     ` Hal Feng
2023-06-26 11:09 ` [PATCH v1 3/5] ASoC: dt-bindings: Add StarFive JH7110 PWM-DAC controller Hal Feng
2023-06-26 15:36   ` Krzysztof Kozlowski
2023-06-30  2:04     ` Hal Feng
2023-06-26 11:09 ` [PATCH v1 4/5] ASoC: starfive: Add JH7110 PWM-DAC driver Hal Feng
2023-06-26 12:25   ` Walker Chen
2023-06-26 11:09 ` Hal Feng [this message]
2023-06-26 12:11   ` [PATCH v1 5/5] riscv: dts: starfive: Add JH7110 PWM-DAC support Walker Chen
2023-06-26 15:37   ` Krzysztof Kozlowski
2023-06-30  2:12     ` Hal Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230626110909.38718-6-hal.feng@starfivetech.com \
    --to=hal.feng@starfivetech.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=emil.renner.berthing@canonical.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    --cc=walker.chen@starfivetech.com \
    --cc=xingyu.wu@starfivetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).