brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch
1 From 89c0c9310876b7ae0d0ed9002e1ebe44f856f876 Mon Sep 17 00:00:00 2001
2 From: wm4 <wm4@nowhere>
3 Date: Tue, 19 Apr 2016 16:08:35 +0200
4 Subject: [PATCH] bcm2835: do not require substream for accessing chmap ctl
5
6 Fixes alsasctl store/restore operation.
7 ---
8 sound/arm/bcm2835-ctl.c | 10 +---------
9 1 file changed, 1 insertion(+), 9 deletions(-)
10
11 --- a/sound/arm/bcm2835-ctl.c
12 +++ b/sound/arm/bcm2835-ctl.c
13 @@ -489,8 +489,6 @@ static int snd_bcm2835_chmap_ctl_get(str
14 {
15 struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
16 bcm2835_chip_t *chip = info->private_data;
17 - unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
18 - struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx);
19 struct cea_channel_speaker_allocation *ch = NULL;
20 int res = 0;
21 int cur = 0;
22 @@ -499,11 +497,6 @@ static int snd_bcm2835_chmap_ctl_get(str
23 if (mutex_lock_interruptible(&chip->audio_mutex))
24 return -EINTR;
25
26 - if (!substream || !substream->runtime) {
27 - res = -ENODEV;
28 - goto unlock;
29 - }
30 -
31 for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
32 if (channel_allocations[i].ca_index == chip->cea_chmap)
33 ch = &channel_allocations[i];
34 @@ -521,7 +514,6 @@ static int snd_bcm2835_chmap_ctl_get(str
35 while (cur < 8)
36 ucontrol->value.integer.value[cur++] = SNDRV_CHMAP_NA;
37
38 -unlock:
39 mutex_unlock(&chip->audio_mutex);
40 return res;
41 }
42 @@ -541,7 +533,7 @@ static int snd_bcm2835_chmap_ctl_put(str
43 return -EINTR;
44
45 if (!substream || !substream->runtime) {
46 - res = -ENODEV;
47 + /* ignore and return success for the sake of alsactl */
48 goto unlock;
49 }
50