openwrt/target/linux/bcm27xx/patches-6.6/950-1284-googlevoicehat-Fix-playback-muting-when-recording-is.patch
Álvaro Fernández Rojas 538a1d740c bcm27xx: update to latest RPi patches
The patches were generated from the RPi repo with the following command:
git format-patch v6.6.58..rpi-6.6.y

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-10-31 13:44:23 +01:00

45 lines
2.0 KiB
Diff

From d52d2bd85ad4d1cfc37a87a6b7bfcc37207c6025 Mon Sep 17 00:00:00 2001
From: Ali Tekin <140681099+alitekin-saha@users.noreply.github.com>
Date: Thu, 26 Sep 2024 10:51:13 +0300
Subject: [PATCH 1284/1350] googlevoicehat: Fix playback muting when recording
is stopped
Fixed audio amplifier control logic in the voicehat trigger function
Resolves improper handling of the SDMODE pin, which caused issues when the microphone and speaker were used simultaneously. The playback stream check is now correctly based on `substream->stream == SNDRV_PCM_STREAM_PLAYBACK`, ensuring proper control of the audio amplifier.
Signed-off-by: Ali Tekin <ali.tekin@saharobotik.com>
---
sound/soc/bcm/googlevoicehat-codec.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/sound/soc/bcm/googlevoicehat-codec.c
+++ b/sound/soc/bcm/googlevoicehat-codec.c
@@ -95,8 +95,7 @@ static int voicehat_daiops_trigger(struc
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
- struct voicehat_priv *voicehat =
- snd_soc_component_get_drvdata(component);
+ struct voicehat_priv *voicehat = snd_soc_component_get_drvdata(component);
if (voicehat->sdmode_delay_jiffies == 0)
return 0;
@@ -109,7 +108,7 @@ static int voicehat_daiops_trigger(struc
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- if (dai->stream[SNDRV_PCM_STREAM_PLAYBACK].active) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
dev_info(dai->dev, "Enabling audio amp...\n");
queue_delayed_work(
system_power_efficient_wq,
@@ -120,7 +119,7 @@ static int voicehat_daiops_trigger(struc
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- if (dai->stream[SNDRV_PCM_STREAM_PLAYBACK].active) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
cancel_delayed_work(&voicehat->enable_sdmode_work);
dev_info(dai->dev, "Disabling audio amp...\n");
gpiod_set_value(voicehat->sdmode_gpio, 0);