aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0919-Mute-bug-fix-for-the-Audioinjector.net-isolated-soun.patch
blob: 10fe7575773a03f75f9b98c817f012a6f2138b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 11a2b192e0a8b7514895f9f6b7451f4c6ddd0a22 Mon Sep 17 00:00:00 2001
From: Matt Flax <flatmax@flatmax.org>
Date: Fri, 17 Jul 2020 09:17:36 +1000
Subject: [PATCH] Mute bug fix for the Audioinjector.net isolated
 soundcard.

---
 .../bcm/audioinjector-isolated-soundcard.c    | 26 +++----------------
 1 file changed, 3 insertions(+), 23 deletions(-)

--- a/sound/soc/bcm/audioinjector-isolated-soundcard.c
+++ b/sound/soc/bcm/audioinjector-isolated-soundcard.c
@@ -42,41 +42,20 @@ static int audioinjector_isolated_dai_in
 	int ret=snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 24576000, 0);
 	if (ret)
 		return ret;
-
 	return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64);
 }
 
 static int audioinjector_isolated_startup(struct snd_pcm_substream *substream)
 {
 	snd_pcm_hw_constraint_list(substream->runtime, 0,
-				SNDRV_PCM_HW_PARAM_RATE, &audioinjector_isolated_constraints);
-
-	return 0;
-}
+			SNDRV_PCM_HW_PARAM_RATE, &audioinjector_isolated_constraints);
 
-static int audioinjector_isolated_trigger(struct snd_pcm_substream *substream,
-								int cmd){
-
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		gpiod_set_value(mute_gpio, 0);
-		break;
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		gpiod_set_value(mute_gpio, 1);
-		break;
-	default:
-		return -EINVAL;
-	}
+	gpiod_set_value(mute_gpio, 1);
 	return 0;
 }
 
 static struct snd_soc_ops audioinjector_isolated_ops = {
 	.startup	= audioinjector_isolated_startup,
-	.trigger = audioinjector_isolated_trigger,
 };
 
 SND_SOC_DAILINK_DEFS(audioinjector_isolated,
@@ -153,6 +132,7 @@ static int audioinjector_isolated_probe(
 			dev_err(&pdev->dev, "mute gpio not found in dt overlay\n");
 			return PTR_ERR(mute_gpio);
 		}
+		gpiod_set_value(mute_gpio, 0);
 	}
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);