Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediatek: bananapi-r3: add drivers and overlay for ReSpeaker 2-mic audio hat #14196

Merged
merged 4 commits into from
Dec 11, 2023

Conversation

dangowrt
Copy link
Member

@dangowrt dangowrt commented Dec 10, 2023

Backport commits from upstream Linux adding driver for the audio engine part of the MT7986 SoC, package the resulting modules and add a device tree overlay to allow using the ReSpeaker 2-mic hat with the BananaPi BPi-R3.

image

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 update
opkg install 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

Discussion see also
https://forum.banana-pi.org/t/bpi-r3-with-respeaker-2-mic-hat-soundcard/16815

@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes core packages pull request/issue for core (in-tree) packages target/mediatek pull request/issue for mediatek target labels Dec 10, 2023
@github-actions github-actions bot added the target/ramips pull request/issue for ramips target label Dec 11, 2023
Maso Huang and others added 4 commits December 11, 2023 18:01
Pick commits adding drivers for audio engine found in MT7986 from
Linux 6.6 as well as follow-up fixes from Linux 6.7.

Signed-off-by: Maso Huang <maso.huang@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Package codec module for WM8960 in its own package to be used by more
than one target.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Packages the audio drivers for the MediaTek MT7986 SoC used with
Wolfson WM8960 codec.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
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 <daniel@makrotopia.org>
@openwrt-bot openwrt-bot merged commit 957a092 into openwrt:main Dec 11, 2023
7 checks passed
@dangowrt dangowrt deleted the mt7986-wm8960 branch December 11, 2023 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core packages pull request/issue for core (in-tree) packages kernel pull request/issue with Linux kernel related changes target/mediatek pull request/issue for mediatek target target/ramips pull request/issue for ramips target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants