diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index 12c59dd7b5fd3..c7666165453a3 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -19,6 +19,7 @@ dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb +dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb dtb-$(RPI_DT_OVERLAYS) += lirc-rpi-overlay.dtb diff --git a/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts b/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts new file mode 100644 index 0000000000000..a11160afa4bfb --- /dev/null +++ b/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts @@ -0,0 +1,13 @@ +/dts-v1/; +/plugin/; + +/{ + compatible = "brcm,bcm2708"; + + fragment@0 { + target = <&i2s>; + __overlay__ { + brcm,enable-mmap; + }; + }; +}; diff --git a/sound/soc/bcm/bcm2708-i2s.c b/sound/soc/bcm/bcm2708-i2s.c index 7570e50cd19ca..1b28aca77290c 100644 --- a/sound/soc/bcm/bcm2708-i2s.c +++ b/sound/soc/bcm/bcm2708-i2s.c @@ -874,7 +874,7 @@ static const struct snd_soc_component_driver bcm2708_i2s_component = { .name = "bcm2708-i2s-comp", }; -static const struct snd_pcm_hardware bcm2708_pcm_hardware = { +static struct snd_pcm_hardware bcm2708_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_JOINT_DUPLEX, .formats = SNDRV_PCM_FMTBIT_S16_LE | @@ -902,6 +902,11 @@ static int bcm2708_i2s_probe(struct platform_device *pdev) struct regmap *regmap[2]; struct resource *mem[2]; + if (of_property_read_bool(pdev->dev.of_node, "brcm,enable-mmap")) + bcm2708_pcm_hardware.info |= + SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID; + /* Request both ioareas */ for (i = 0; i <= 1; i++) { void __iomem *base;