0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. diff -Nur linux-3.18.6.orig/sound/soc/bcm/bcm2708-i2s.c linux-3.18.6/sound/soc/bcm/bcm2708-i2s.c
  2. --- linux-3.18.6.orig/sound/soc/bcm/bcm2708-i2s.c 2015-02-12 12:00:42.809186343 +0100
  3. +++ linux-3.18.6/sound/soc/bcm/bcm2708-i2s.c 2015-02-12 13:35:35.929213859 +0100
  4. @@ -171,6 +171,11 @@
  5. /* I2S pin configuration */
  6. static int bcm2708_i2s_gpio=BCM2708_I2S_GPIO_AUTO;
  7. +static bool use_mmap = 1;
  8. +module_param(use_mmap, bool, S_IRUGO);
  9. +MODULE_PARM_DESC(use_mmap, "Use MMAP");
  10. +
  11. +
  12. /* General device struct */
  13. struct bcm2708_i2s_dev {
  14. struct device *dev;
  15. @@ -874,7 +879,7 @@
  16. .name = "bcm2708-i2s-comp",
  17. };
  18. -static const struct snd_pcm_hardware bcm2708_pcm_hardware = {
  19. +static struct snd_pcm_hardware bcm2708_pcm_hardware = {
  20. .info = SNDRV_PCM_INFO_INTERLEAVED |
  21. SNDRV_PCM_INFO_JOINT_DUPLEX,
  22. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  23. @@ -966,6 +971,12 @@
  24. return ret;
  25. }
  26. + if (use_mmap) {
  27. + printk("Enable ALSA MMAP support for I2S\n");
  28. + bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP;
  29. + bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP_VALID;
  30. + }
  31. +
  32. ret = snd_dmaengine_pcm_register(&pdev->dev,
  33. &bcm2708_dmaengine_pcm_config,
  34. SND_DMAENGINE_PCM_FLAG_COMPAT);