From: Chris Morgan <macroalpha82@gmail.com>
To: linux-sound@vger.kernel.org
Cc: devicetree@vger.kernel.org, wangweidong.a@awinic.com,
tiwai@suse.com, perex@perex.cz, conor+dt@kernel.org,
krzk+dt@kernel.org, robh@kernel.org, broonie@kernel.org,
lgirdwood@gmail.com, heiko@sntech.de,
linux-rockchip@lists.infradead.org,
Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH V2 3/3] arm64: dts: rockchip: add Awinic aw87391 for Anbernic RG-DS
Date: Wed, 28 Jan 2026 11:46:08 -0600 [thread overview]
Message-ID: <20260128174608.1498-4-macroalpha82@gmail.com> (raw)
In-Reply-To: <20260128174608.1498-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
Add support for the two Awinic aw87391 audio amplifiers used in the
Anbernic RG-DS. These amplifiers require a specific init sequence to
start which is usually provided by a firmware file, but in our case
the manufacturer only provided the sequence. As a result, we hard-code
a device specific compatible.
Additionally, add support for the VDD regulator used to power both
amplifiers. Note that the amps can accept and respond to i2c commands
even without regulator power (perhaps due to a secondary power source)
but cannot play audio.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
.../dts/rockchip/rk3568-anbernic-rg-ds.dts | 44 +++++++++++++++++--
1 file changed, 40 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-anbernic-rg-ds.dts b/arch/arm64/boot/dts/rockchip/rk3568-anbernic-rg-ds.dts
index 6ac1fe0d3c98..8d906ab02c5f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-anbernic-rg-ds.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-anbernic-rg-ds.dts
@@ -354,6 +354,7 @@ sound {
compatible = "simple-audio-card";
pinctrl-0 = <&hp_det>;
pinctrl-names = "default";
+ simple-audio-card,aux-devs = <&aw87391_pa_l>, <&aw87391_pa_r>;
simple-audio-card,format = "i2s";
simple-audio-card,hp-det-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
simple-audio-card,mclk-fs = <256>;
@@ -363,8 +364,10 @@ sound {
"MICL", "Mic Jack",
"Headphones", "HPOL",
"Headphones", "HPOR",
- "Internal Speakers", "HPOL",
- "Internal Speakers", "HPOR";
+ "Internal Speakers", "Left Amp OUT",
+ "Internal Speakers", "Right Amp OUT",
+ "Left Amp IN", "HPOL",
+ "Right Amp IN", "HPOR";
simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Headphone", "Headphones",
@@ -468,6 +471,18 @@ vcc_wifi: regulator-vcc-wifi {
regulator-max-microvolt = <3300000>;
regulator-name = "vcc_wifi";
};
+
+ vdd_amp: regulator-vcc-amp {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio4 RK_PC3 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&vdd_amp_h>;
+ pinctrl-names = "default";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&vccio_acodec>;
+ regulator-name = "vdd_amp";
+ };
};
&cpu0 {
@@ -840,8 +855,22 @@ &i2c2 {
pinctrl-names = "default";
status = "okay";
- /* awinic,aw87391 at 0x58 */
- /* awinic,aw87391 at 0x5b */
+ aw87391_pa_l: audio-codec@58 {
+ compatible = "anbernic,rgds-amp", "awinic,aw87391";
+ reg = <0x58>;
+ vdd-supply = <&vdd_amp>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "Left Amp";
+ };
+
+ aw87391_pa_r: audio-codec@5b {
+ compatible = "anbernic,rgds-amp", "awinic,aw87391";
+ reg = <0x5b>;
+ vdd-supply = <&vdd_amp>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "Right Amp";
+ };
+
/* invensense,icm42607p at 0x68 */
};
@@ -1014,6 +1043,13 @@ touch1_irq: touch1-irq {
};
};
+ vdd-amp {
+ vdd_amp_h: vdd-amp-h {
+ rockchip,pins =
+ <4 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
vcc-lcd {
vdd_lcd0_h: vdd-lcd0-h {
rockchip,pins =
--
2.43.0
next prev parent reply other threads:[~2026-01-28 17:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 17:46 [PATCH V2 0/3] Anbernic RG-DS AW87391 Speaker Amps Chris Morgan
2026-01-28 17:46 ` [PATCH V2 1/3] ASoC: dt-bindings: aw87390: Add Anbernic RG-DS Amplifier Chris Morgan
2026-01-28 17:46 ` [PATCH V2 2/3] ASoC: codecs: aw87390: Add Anbernic RG-DS amp driver Chris Morgan
2026-01-28 17:46 ` Chris Morgan [this message]
2026-02-03 12:05 ` (subset) [PATCH V2 0/3] Anbernic RG-DS AW87391 Speaker Amps Mark Brown
2026-02-22 22:39 ` Heiko Stuebner
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=20260128174608.1498-4-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=macromorgan@hotmail.com \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=tiwai@suse.com \
--cc=wangweidong.a@awinic.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