Skip to content

Commit

Permalink
overlays-14-add-rk3328-pcm5102-dac(:1)
Browse files Browse the repository at this point in the history
Original-Subject: rk3328: add dtb overlay to enable pcm5102 DAC on i2s1 bus
None
X-Armbian: Patch-File: overlays-14-add-rk3328-pcm5102-dac
X-Armbian: Patch-File-Counter: 1
X-Armbian: Patch-Rel-Directory: patch/kernel/archive/rockchip64-6.3
X-Armbian: Patch-Type: kernel
X-Armbian: Patch-Root-Type: core
X-Armbian: Patch-Sub-Type: common
X-Armbian: Original-Subject: rk3328: add dtb overlay to enable pcm5102 DAC on i2s1 bus
  • Loading branch information
paolosabatino authored and Armbian AutoPatcher committed Apr 22, 2023
1 parent a8f3e06 commit 5bdae80
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/rockchip/overlay/Makefile
Expand Up @@ -23,6 +23,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-rk3318-box-wlan-ap6330.dtbo \
rockchip-rk3318-box-cpu-hs.dtbo \
rockchip-rk3318-box-emmc-hs200.dtbo \
rockchip-rk3328-i2s1-pcm5102.dtbo \
rk3308-bs.dtbo rk3308-bs@1.3ghz.dtbo \
rk3308-sdio@10mhz.dtbo rk3308-sdio@4mhz.dtbo \
rk3308-emmc.dtbo
Expand Down
104 changes: 104 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3328-i2s1-pcm5102.dts
@@ -0,0 +1,104 @@
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>

/*
* Device tree overlay to disabled internal analog codec for
* rk3328 boards and enable external i2s, binding it to a
* pcm5102-based DAC.
* Tested on rock-pi E, but should be suitable for other
* similar boards
*/

&{/} {

pcm5102: pcm510x {
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
pcm510x,format = "i2s";
status = "okay";
};

i2s_sound: i2s-sound {
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,name = "I2S";
status = "okay";

simple-audio-card,cpu {
sound-dai = <&i2s1>;
};

simple-audio-card,codec {
sound-dai = <&pcm5102>;
};
};

};

&analog_sound {
status = "disabled";
};

&codec {
status = "disabled";
};

&i2s1_mclk {
rockchip,pins = <2 RK_PB7 1 &pcfg_pull_down>;
};

&i2s1_sclk {
rockchip,pins = <2 RK_PC2 1 &pcfg_pull_down>;
};

&i2s1_lrckrx {
rockchip,pins = <2 RK_PC0 1 &pcfg_pull_up>;
};

&i2s1_lrcktx {
rockchip,pins = <2 RK_PC1 1 &pcfg_pull_up>;
};

&i2s1_sdi {
rockchip,pins = <2 RK_PC3 1 &pcfg_pull_up>;
};

&i2s1_sdo {
rockchip,pins = <2 RK_PC7 1 &pcfg_pull_up>;
};

&i2s1_sdio1 {
rockchip,pins = <2 RK_PC4 1 &pcfg_pull_up>;
};

&i2s1_sdio2 {
rockchip,pins = <2 RK_PC5 1 &pcfg_pull_up>;
};

&i2s1_sdio3 {
rockchip,pins = <2 RK_PC6 1 &pcfg_pull_up>;
};

&i2s1_sleep {
rockchip,pins =
<2 RK_PB7 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC0 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC1 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC2 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC3 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC4 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC5 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC6 RK_FUNC_GPIO &pcfg_input_high>,
<2 RK_PC7 RK_FUNC_GPIO &pcfg_input_high>;
};

&i2s1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2s1_mclk>, <&i2s1_sclk>, <&i2s1_lrckrx>, <&i2s1_lrcktx>, <&i2s1_sdi>, <&i2s1_sdo>, <&i2s1_sdio1>, <&i2s1_sdio2>;
rockchip,playback-channels = <8>;
};

0 comments on commit 5bdae80

Please sign in to comment.