10fe7575773a03f75f9b98c817f012a6f2138b42
[openwrt/staging/ldir.git] /
1 From 11a2b192e0a8b7514895f9f6b7451f4c6ddd0a22 Mon Sep 17 00:00:00 2001
2 From: Matt Flax <flatmax@flatmax.org>
3 Date: Fri, 17 Jul 2020 09:17:36 +1000
4 Subject: [PATCH] Mute bug fix for the Audioinjector.net isolated
5 soundcard.
6
7 ---
8 .../bcm/audioinjector-isolated-soundcard.c | 26 +++----------------
9 1 file changed, 3 insertions(+), 23 deletions(-)
10
11 --- a/sound/soc/bcm/audioinjector-isolated-soundcard.c
12 +++ b/sound/soc/bcm/audioinjector-isolated-soundcard.c
13 @@ -42,41 +42,20 @@ static int audioinjector_isolated_dai_in
14 int ret=snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 24576000, 0);
15 if (ret)
16 return ret;
17 -
18 return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64);
19 }
20
21 static int audioinjector_isolated_startup(struct snd_pcm_substream *substream)
22 {
23 snd_pcm_hw_constraint_list(substream->runtime, 0,
24 - SNDRV_PCM_HW_PARAM_RATE, &audioinjector_isolated_constraints);
25 -
26 - return 0;
27 -}
28 + SNDRV_PCM_HW_PARAM_RATE, &audioinjector_isolated_constraints);
29
30 -static int audioinjector_isolated_trigger(struct snd_pcm_substream *substream,
31 - int cmd){
32 -
33 - switch (cmd) {
34 - case SNDRV_PCM_TRIGGER_STOP:
35 - case SNDRV_PCM_TRIGGER_SUSPEND:
36 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
37 - gpiod_set_value(mute_gpio, 0);
38 - break;
39 - case SNDRV_PCM_TRIGGER_START:
40 - case SNDRV_PCM_TRIGGER_RESUME:
41 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
42 - gpiod_set_value(mute_gpio, 1);
43 - break;
44 - default:
45 - return -EINVAL;
46 - }
47 + gpiod_set_value(mute_gpio, 1);
48 return 0;
49 }
50
51 static struct snd_soc_ops audioinjector_isolated_ops = {
52 .startup = audioinjector_isolated_startup,
53 - .trigger = audioinjector_isolated_trigger,
54 };
55
56 SND_SOC_DAILINK_DEFS(audioinjector_isolated,
57 @@ -153,6 +132,7 @@ static int audioinjector_isolated_probe(
58 dev_err(&pdev->dev, "mute gpio not found in dt overlay\n");
59 return PTR_ERR(mute_gpio);
60 }
61 + gpiod_set_value(mute_gpio, 0);
62 }
63
64 ret = devm_snd_soc_register_card(&pdev->dev, card);