0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. Fixes alsasctl store/restore operation.
  6. ---
  7. sound/arm/bcm2835-ctl.c | 10 +---------
  8. 1 file changed, 1 insertion(+), 9 deletions(-)
  9. --- a/sound/arm/bcm2835-ctl.c
  10. +++ b/sound/arm/bcm2835-ctl.c
  11. @@ -489,8 +489,6 @@ static int snd_bcm2835_chmap_ctl_get(str
  12. {
  13. struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
  14. bcm2835_chip_t *chip = info->private_data;
  15. - unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  16. - struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx);
  17. struct cea_channel_speaker_allocation *ch = NULL;
  18. int res = 0;
  19. int cur = 0;
  20. @@ -499,11 +497,6 @@ static int snd_bcm2835_chmap_ctl_get(str
  21. if (mutex_lock_interruptible(&chip->audio_mutex))
  22. return -EINTR;
  23. - if (!substream || !substream->runtime) {
  24. - res = -ENODEV;
  25. - goto unlock;
  26. - }
  27. -
  28. for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
  29. if (channel_allocations[i].ca_index == chip->cea_chmap)
  30. ch = &channel_allocations[i];
  31. @@ -521,7 +514,6 @@ static int snd_bcm2835_chmap_ctl_get(str
  32. while (cur < 8)
  33. ucontrol->value.integer.value[cur++] = SNDRV_CHMAP_NA;
  34. -unlock:
  35. mutex_unlock(&chip->audio_mutex);
  36. return res;
  37. }
  38. @@ -541,7 +533,7 @@ static int snd_bcm2835_chmap_ctl_put(str
  39. return -EINTR;
  40. if (!substream || !substream->runtime) {
  41. - res = -ENODEV;
  42. + /* ignore and return success for the sake of alsactl */
  43. goto unlock;
  44. }