0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From d4e3e25ba7157e76f248ad9ec5a0ea87d47a06f8 Mon Sep 17 00:00:00 2001
  2. From: Matthias Reichl <hias@horus.com>
  3. Date: Sun, 11 Oct 2015 15:55:21 +0200
  4. Subject: [PATCH 019/381] bcm2835-i2s: Enable MMAP support via a DT property
  5. Code ported from bcm2708-i2s driver in Raspberry Pi tree.
  6. RPi commit 7ee829fd77a30127db5d0b3c7d79b8718166e568 ("bcm2708-i2s:
  7. Enable MMAP support via a DT property and overlay")
  8. The i2s driver used to claim to support MMAP, but that feature was disabled
  9. when some problems were found. Add the ability to enable this feature
  10. through Device Tree, using the i2s-mmap overlay.
  11. See: #1004
  12. Signed-off-by: Matthias Reichl <hias@horus.com>
  13. ---
  14. sound/soc/bcm/bcm2835-i2s.c | 7 ++++++-
  15. 1 file changed, 6 insertions(+), 1 deletion(-)
  16. --- a/sound/soc/bcm/bcm2835-i2s.c
  17. +++ b/sound/soc/bcm/bcm2835-i2s.c
  18. @@ -799,7 +799,7 @@ static const struct snd_soc_component_dr
  19. .name = "bcm2835-i2s-comp",
  20. };
  21. -static const struct snd_pcm_hardware bcm2835_pcm_hardware = {
  22. +static struct snd_pcm_hardware bcm2835_pcm_hardware = {
  23. .info = SNDRV_PCM_INFO_INTERLEAVED |
  24. SNDRV_PCM_INFO_JOINT_DUPLEX,
  25. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  26. @@ -835,6 +835,11 @@ static int bcm2835_i2s_probe(struct plat
  27. }
  28. dma_reg_base = be32_to_cpup(addr);
  29. + if (of_property_read_bool(pdev->dev.of_node, "brcm,enable-mmap"))
  30. + bcm2835_pcm_hardware.info |=
  31. + SNDRV_PCM_INFO_MMAP |
  32. + SNDRV_PCM_INFO_MMAP_VALID;
  33. +
  34. /* Request both ioareas */
  35. for (i = 0; i <= 1; i++) {
  36. void __iomem *base;