0001-i2s-allow-to-enable-ALSA-MMAP.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From d017ad0179e407a81ed2423f7620d46584470ad4 Mon Sep 17 00:00:00 2001
  2. From: Waldemar Brodkorb <wbrodkorb@conet.de>
  3. Date: Thu, 26 Mar 2015 13:00:07 +0100
  4. Subject: [PATCH] i2s: allow to enable ALSA MMAP
  5. For some ALSA plugins like dmix MMAP is required.
  6. Allow to enable it via a module parameter called use_mmap.
  7. Signed-off-by: Waldemar Brodkorb <wbrodkorb@conet.de>
  8. ---
  9. sound/soc/bcm/bcm2708-i2s.c | 13 ++++++++++++-
  10. 1 file changed, 12 insertions(+), 1 deletion(-)
  11. diff --git a/sound/soc/bcm/bcm2708-i2s.c b/sound/soc/bcm/bcm2708-i2s.c
  12. index 7570e50..3d3692f 100644
  13. --- a/sound/soc/bcm/bcm2708-i2s.c
  14. +++ b/sound/soc/bcm/bcm2708-i2s.c
  15. @@ -171,6 +171,11 @@ static const unsigned int bcm2708_clk_freq[BCM2708_CLK_SRC_HDMI+1] = {
  16. /* I2S pin configuration */
  17. static int bcm2708_i2s_gpio=BCM2708_I2S_GPIO_AUTO;
  18. +static bool use_mmap = 0;
  19. +module_param(use_mmap, bool, S_IRUGO);
  20. +MODULE_PARM_DESC(use_mmap, "Use MMAP");
  21. +
  22. +
  23. /* General device struct */
  24. struct bcm2708_i2s_dev {
  25. struct device *dev;
  26. @@ -874,7 +879,7 @@ static const struct snd_soc_component_driver bcm2708_i2s_component = {
  27. .name = "bcm2708-i2s-comp",
  28. };
  29. -static const struct snd_pcm_hardware bcm2708_pcm_hardware = {
  30. +static struct snd_pcm_hardware bcm2708_pcm_hardware = {
  31. .info = SNDRV_PCM_INFO_INTERLEAVED |
  32. SNDRV_PCM_INFO_JOINT_DUPLEX,
  33. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  34. @@ -966,6 +971,12 @@ static int bcm2708_i2s_probe(struct platform_device *pdev)
  35. return ret;
  36. }
  37. + if (use_mmap) {
  38. + printk("Enable ALSA MMAP support for I2S\n");
  39. + bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP;
  40. + bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP_VALID;
  41. + }
  42. +
  43. ret = snd_dmaengine_pcm_register(&pdev->dev,
  44. &bcm2708_dmaengine_pcm_config,
  45. SND_DMAENGINE_PCM_FLAG_COMPAT);
  46. --
  47. 1.9.1