a4bcd0f62f963f1b82b04fdfef352d5fc1dcb629
[openwrt/staging/jow.git] /
1 From d808f57da035c0a908043d5b293211f4e1159f52 Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Tue, 4 Sep 2018 17:58:31 +0200
4 Subject: [PATCH 435/782] staging: bcm2835-audio: Remove redundant spdif stream
5 ctls
6
7 commit ab91e26229eaca2832df51e13c1285aea3be33ab upstream.
8
9 The "IEC958 Playback Stream" control does basically the very same
10 thing as "IEC958 Playback Default" redundantly. The former should
11 have been stream-specific and restored after closing the stream, but
12 we don't do in that way.
13
14 Since it's nothing but confusion, remove this fake.
15
16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 51 -------------------
21 1 file changed, 51 deletions(-)
22
23 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
24 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
25 @@ -233,48 +233,6 @@ static int snd_bcm2835_spdif_mask_get(st
26 return 0;
27 }
28
29 -static int snd_bcm2835_spdif_stream_info(struct snd_kcontrol *kcontrol,
30 - struct snd_ctl_elem_info *uinfo)
31 -{
32 - uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
33 - uinfo->count = 1;
34 - return 0;
35 -}
36 -
37 -static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol *kcontrol,
38 - struct snd_ctl_elem_value *ucontrol)
39 -{
40 - struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
41 - int i;
42 -
43 - mutex_lock(&chip->audio_mutex);
44 -
45 - for (i = 0; i < 4; i++)
46 - ucontrol->value.iec958.status[i] =
47 - (chip->spdif_status >> (i * 8)) & 0xff;
48 -
49 - mutex_unlock(&chip->audio_mutex);
50 - return 0;
51 -}
52 -
53 -static int snd_bcm2835_spdif_stream_put(struct snd_kcontrol *kcontrol,
54 - struct snd_ctl_elem_value *ucontrol)
55 -{
56 - struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
57 - unsigned int val = 0;
58 - int i, change;
59 -
60 - mutex_lock(&chip->audio_mutex);
61 -
62 - for (i = 0; i < 4; i++)
63 - val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8);
64 - change = val != chip->spdif_status;
65 - chip->spdif_status = val;
66 -
67 - mutex_unlock(&chip->audio_mutex);
68 - return change;
69 -}
70 -
71 static struct snd_kcontrol_new snd_bcm2835_spdif[] = {
72 {
73 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
74 @@ -290,15 +248,6 @@ static struct snd_kcontrol_new snd_bcm28
75 .info = snd_bcm2835_spdif_mask_info,
76 .get = snd_bcm2835_spdif_mask_get,
77 },
78 - {
79 - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
80 - SNDRV_CTL_ELEM_ACCESS_INACTIVE,
81 - .iface = SNDRV_CTL_ELEM_IFACE_PCM,
82 - .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, PCM_STREAM),
83 - .info = snd_bcm2835_spdif_stream_info,
84 - .get = snd_bcm2835_spdif_stream_get,
85 - .put = snd_bcm2835_spdif_stream_put,
86 - },
87 };
88
89 int snd_bcm2835_new_ctl(struct bcm2835_chip *chip)