Skip to content

Commit 7ee829f

Browse files
author
Phil Elwell
committed
bcm2708-i2s: Enable MMAP support via a DT property and overlay
The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: raspberrypi#1004
1 parent 739c586 commit 7ee829f

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb
1919
dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
2020
dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
2121
dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
22+
dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
2223
dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
2324
dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
2425
dtb-$(RPI_DT_OVERLAYS) += lirc-rpi-overlay.dtb
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/{
5+
compatible = "brcm,bcm2708";
6+
7+
fragment@0 {
8+
target = <&i2s>;
9+
__overlay__ {
10+
brcm,enable-mmap;
11+
};
12+
};
13+
};

sound/soc/bcm/bcm2708-i2s.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ static const struct snd_soc_component_driver bcm2708_i2s_component = {
874874
.name = "bcm2708-i2s-comp",
875875
};
876876

877-
static const struct snd_pcm_hardware bcm2708_pcm_hardware = {
877+
static struct snd_pcm_hardware bcm2708_pcm_hardware = {
878878
.info = SNDRV_PCM_INFO_INTERLEAVED |
879879
SNDRV_PCM_INFO_JOINT_DUPLEX,
880880
.formats = SNDRV_PCM_FMTBIT_S16_LE |
@@ -902,6 +902,11 @@ static int bcm2708_i2s_probe(struct platform_device *pdev)
902902
struct regmap *regmap[2];
903903
struct resource *mem[2];
904904

905+
if (of_property_read_bool(pdev->dev.of_node, "brcm,enable-mmap"))
906+
bcm2708_pcm_hardware.info |=
907+
SNDRV_PCM_INFO_MMAP |
908+
SNDRV_PCM_INFO_MMAP_VALID;
909+
905910
/* Request both ioareas */
906911
for (i = 0; i <= 1; i++) {
907912
void __iomem *base;

0 commit comments

Comments
 (0)