Skip to content

Commit

Permalink
bcm2835-i2s: Enable MMAP support via a DT property
Browse files Browse the repository at this point in the history
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: #1004

Signed-off-by: Matthias Reichl <hias@horus.com>
  • Loading branch information
HiassofT authored and popcornmix committed Jun 3, 2016
1 parent f5012a2 commit d39bf07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/bcm/bcm2835-i2s.c
Expand Up @@ -802,7 +802,7 @@ static const struct snd_soc_component_driver bcm2835_i2s_component = {
.name = "bcm2835-i2s-comp",
};

static const struct snd_pcm_hardware bcm2835_pcm_hardware = {
static struct snd_pcm_hardware bcm2835_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_JOINT_DUPLEX,
.formats = SNDRV_PCM_FMTBIT_S16_LE |
Expand All @@ -829,6 +829,11 @@ static int bcm2835_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"))
bcm2835_pcm_hardware.info |=
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID;

/* Request both ioareas */
for (i = 0; i <= 1; i++) {
void __iomem *base;
Expand Down

0 comments on commit d39bf07

Please sign in to comment.