forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mediatek: bananapi-r3: add overlay for ReSpeaker 2-mic hat
Add DT overlay to allow using the ReSpeaker 2-mic hat connected to the 26-pin header of the BananaPi BPi-R3. Supported sample formats: S16_LE, S24_LE, S32_LE Supported sample rates: 8/12/16/24/32/48/96/192 kHz | BPi-R3 | ReSpeaker 2-mic Signal | 26-pin | 40-pin ----------+----------+------------------- VCC 5V | 2 | 2 I2C SDA | 3 | 3 I2C SCL | 5 | 5 GND | 6 | 6 PCM CLK | 12 | 12 PCM FS | 15 | 35 PCM DIN | 26 | 38 GND | 25 | 39 PCM DOUT | 22 | 40 Once connected, install the driver and tell U-Boot to apply the DT overlay: opkg kmod-sound-soc-mt7986-wm8960 fw_setenv bootconf_base "config-mt7986a-bananapi-bpi-r3#mt7986a-bananapi-bpi-r3-respeaker-2mics" reboot To setup the ReSpeaker for Stereo out on the Headphone plug: amixer sset 'Right Output Mixer PCM' on amixer sset 'Left Output Mixer PCM' on amixer sset 'PCM Playback -6dB' off amixer sset 'O018 I150_Switch' on amixer sset 'O019 I151_Switch' on amixer sset 'O124 I032_Switch' on amixer sset 'O125 I033_Switch' on amixer sset 'Headphone' 121 amixer sset 'Playback' 255 Signed-off-by: Daniel Golle <[email protected]>
- Loading branch information
Showing
3 changed files
with
143 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
target/linux/mediatek/patches-5.15/864-arm64-dts-mt7986-add-sound-overlay-for-bpi-r3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- /dev/null | ||
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-respeaker-2mics.dtso | ||
@@ -0,0 +1,62 @@ | ||
+// SPDX-License-Identifier: (GPL-2.0 OR MIT) | ||
+/* | ||
+ * Copyright (C) 2023 MediaTek Inc. | ||
+ * Author: Maso Huang <[email protected]> | ||
+ */ | ||
+ | ||
+/dts-v1/; | ||
+/plugin/; | ||
+ | ||
+/ { | ||
+ compatible = "bananapi,bpi-r3", "mediatek,mt7986a"; | ||
+ | ||
+ fragment@0 { | ||
+ target-path = "/"; | ||
+ __overlay__ { | ||
+ sound_wm8960 { | ||
+ compatible = "mediatek,mt7986-wm8960-sound"; | ||
+ audio-routing = "Headphone", "HP_L", | ||
+ "Headphone", "HP_R", | ||
+ "LINPUT1", "AMIC", | ||
+ "RINPUT1", "AMIC"; | ||
+ | ||
+ status = "okay"; | ||
+ | ||
+ platform { | ||
+ sound-dai = <&afe>; | ||
+ }; | ||
+ | ||
+ codec { | ||
+ sound-dai = <&wm8960>; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@1 { | ||
+ target = <&i2c0>; | ||
+ __overlay__ { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&i2c_pins>; | ||
+ clock-frequency = <400000>; | ||
+ status = "okay"; | ||
+ | ||
+ wm8960: wm8960@1a { | ||
+ compatible = "wlf,wm8960"; | ||
+ reg = <0x1a>; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@2 { | ||
+ target = <&pio>; | ||
+ __overlay__ { | ||
+ i2c_pins: i2c-pins-3-4 { | ||
+ mux { | ||
+ function = "i2c"; | ||
+ groups = "i2c"; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+}; |
75 changes: 75 additions & 0 deletions
75
target/linux/mediatek/patches-6.1/864-arm64-dts-mt7986-add-sound-overlay-for-bpi-r3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- /dev/null | ||
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-respeaker-2mics.dtso | ||
@@ -0,0 +1,62 @@ | ||
+// SPDX-License-Identifier: (GPL-2.0 OR MIT) | ||
+/* | ||
+ * Copyright (C) 2023 MediaTek Inc. | ||
+ * Author: Maso Huang <[email protected]> | ||
+ */ | ||
+ | ||
+/dts-v1/; | ||
+/plugin/; | ||
+ | ||
+/ { | ||
+ compatible = "bananapi,bpi-r3", "mediatek,mt7986a"; | ||
+ | ||
+ fragment@0 { | ||
+ target-path = "/"; | ||
+ __overlay__ { | ||
+ sound_wm8960 { | ||
+ compatible = "mediatek,mt7986-wm8960-sound"; | ||
+ audio-routing = "Headphone", "HP_L", | ||
+ "Headphone", "HP_R", | ||
+ "LINPUT1", "AMIC", | ||
+ "RINPUT1", "AMIC"; | ||
+ | ||
+ status = "okay"; | ||
+ | ||
+ platform { | ||
+ sound-dai = <&afe>; | ||
+ }; | ||
+ | ||
+ codec { | ||
+ sound-dai = <&wm8960>; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@1 { | ||
+ target = <&i2c0>; | ||
+ __overlay__ { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&i2c_pins>; | ||
+ clock-frequency = <400000>; | ||
+ status = "okay"; | ||
+ | ||
+ wm8960: wm8960@1a { | ||
+ compatible = "wlf,wm8960"; | ||
+ reg = <0x1a>; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@2 { | ||
+ target = <&pio>; | ||
+ __overlay__ { | ||
+ i2c_pins: i2c-pins-3-4 { | ||
+ mux { | ||
+ function = "i2c"; | ||
+ groups = "i2c"; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+}; | ||
--- a/arch/arm64/boot/dts/mediatek/Makefile | ||
+++ b/arch/arm64/boot/dts/mediatek/Makefile | ||
@@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-b | ||
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo | ||
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo | ||
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo | ||
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-respeaker-2mics.dtbo | ||
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb | ||
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb | ||
dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb |