2f16bf7f1ae573bdea05570c347a8d398291cd45
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch
1 From ec8796e8ccf92931ff87fb7626be8f3e63ddc2d0 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/423] bcm2835-i2s: Enable MMAP support via a DT property
5
6 Code ported from bcm2708-i2s driver in Raspberry Pi tree.
7
8 RPi commit 7ee829fd77a30127db5d0b3c7d79b8718166e568 ("bcm2708-i2s:
9 Enable MMAP support via a DT property and overlay")
10
11 The i2s driver used to claim to support MMAP, but that feature was disabled
12 when some problems were found. Add the ability to enable this feature
13 through Device Tree, using the i2s-mmap overlay.
14
15 See: #1004
16
17 Signed-off-by: Matthias Reichl <hias@horus.com>
18 ---
19 sound/soc/bcm/bcm2835-i2s.c | 7 ++++++-
20 1 file changed, 6 insertions(+), 1 deletion(-)
21
22 --- a/sound/soc/bcm/bcm2835-i2s.c
23 +++ b/sound/soc/bcm/bcm2835-i2s.c
24 @@ -799,7 +799,7 @@ static const struct snd_soc_component_dr
25 .name = "bcm2835-i2s-comp",
26 };
27
28 -static const struct snd_pcm_hardware bcm2835_pcm_hardware = {
29 +static struct snd_pcm_hardware bcm2835_pcm_hardware = {
30 .info = SNDRV_PCM_INFO_INTERLEAVED |
31 SNDRV_PCM_INFO_JOINT_DUPLEX,
32 .formats = SNDRV_PCM_FMTBIT_S16_LE |
33 @@ -835,6 +835,11 @@ static int bcm2835_i2s_probe(struct plat
34 }
35 dma_reg_base = be32_to_cpup(addr);
36
37 + if (of_property_read_bool(pdev->dev.of_node, "brcm,enable-mmap"))
38 + bcm2835_pcm_hardware.info |=
39 + SNDRV_PCM_INFO_MMAP |
40 + SNDRV_PCM_INFO_MMAP_VALID;
41 +
42 /* Request both ioareas */
43 for (i = 0; i <= 1; i++) {
44 void __iomem *base;