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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From f1290350dc2cc8defb2d613a32f1a7bd4400de65 Mon Sep 17 00:00:00 2001
  2. From: Waldemar Brodkorb <wbrodkorb@conet.de>
  3. Date: Fri, 28 Nov 2014 16:18:36 +0100
  4. Subject: [PATCH 2/2] enable MMAP by default, allow overide via use_mmap
  5. Add a bool module parameter to control availability of MMAP
  6. in the driver.
  7. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  8. ---
  9. sound/soc/bcm/bcm2708-i2s.c | 12 +++++++++++-
  10. 1 file changed, 11 insertions(+), 1 deletion(-)
  11. diff --git a/sound/soc/bcm/bcm2708-i2s.c b/sound/soc/bcm/bcm2708-i2s.c
  12. index 3fcb740..ddf9796 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 = 1;
  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. @@ -870,7 +875,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. @@ -962,6 +967,11 @@ static int bcm2708_i2s_probe(struct platform_device *pdev)
  35. return ret;
  36. }
  37. + if (use_mmap) {
  38. + bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP;
  39. + bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP_VALID;
  40. + }
  41. +
  42. ret = snd_dmaengine_pcm_register(&pdev->dev,
  43. &bcm2708_dmaengine_pcm_config,
  44. SND_DMAENGINE_PCM_FLAG_COMPAT);
  45. --
  46. 1.7.10.4