Skip to content

Commit 224a465

Browse files
HiassofTpopcornmix
authored andcommitted
bcm2835-i2s: Enable MMAP support via a DT property
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("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 Signed-off-by: Matthias Reichl <[email protected]>
1 parent b99821f commit 224a465

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sound/soc/bcm/bcm2835-i2s.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ static const struct snd_soc_component_driver bcm2835_i2s_component = {
799799
.name = "bcm2835-i2s-comp",
800800
};
801801

802-
static const struct snd_pcm_hardware bcm2835_pcm_hardware = {
802+
static struct snd_pcm_hardware bcm2835_pcm_hardware = {
803803
.info = SNDRV_PCM_INFO_INTERLEAVED |
804804
SNDRV_PCM_INFO_JOINT_DUPLEX,
805805
.formats = SNDRV_PCM_FMTBIT_S16_LE |
@@ -835,6 +835,11 @@ static int bcm2835_i2s_probe(struct platform_device *pdev)
835835
}
836836
dma_reg_base = be32_to_cpup(addr);
837837

838+
if (of_property_read_bool(pdev->dev.of_node, "brcm,enable-mmap"))
839+
bcm2835_pcm_hardware.info |=
840+
SNDRV_PCM_INFO_MMAP |
841+
SNDRV_PCM_INFO_MMAP_VALID;
842+
838843
/* Request both ioareas */
839844
for (i = 0; i <= 1; i++) {
840845
void __iomem *base;

0 commit comments

Comments
 (0)