summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Morgan <macromorgan@hotmail.com>2026-01-28 20:46:08 +0300
committerHeiko Stuebner <heiko@sntech.de>2026-02-23 01:28:49 +0300
commit1ee69b9cdcd1b838e514520fb4103ca77acd068a (patch)
tree36fdb53573968631b0df46211578527159e0e424
parent52ad35272559db09ad571d698665fe33d93534a8 (diff)
downloadlinux-1ee69b9cdcd1b838e514520fb4103ca77acd068a.tar.xz
arm64: dts: rockchip: add Awinic aw87391 amplifiers for Anbernic RG-DS
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> Link: https://patch.msgid.link/20260128174608.1498-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3568-anbernic-rg-ds.dts44
1 files 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 @@
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 @@
"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 @@
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 @@
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 @@
};
};
+ 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 =