Skip to content

Commit 48e87b8

Browse files
koalopopcornmix
authored andcommitted
BCM2708: Add I2S support to board file
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> 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
1 parent 6b65db9 commit 48e87b8

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,28 @@ static struct platform_device bcm2835_thermal_device = {
616616
.name = "bcm2835_thermal",
617617
};
618618

619+
#if defined(CONFIG_SND_BCM2708_SOC_I2S) || defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE)
620+
static struct resource bcm2708_i2s_resources[] = {
621+
{
622+
.start = I2S_BASE,
623+
.end = I2S_BASE + 0x20,
624+
.flags = IORESOURCE_MEM,
625+
},
626+
{
627+
.start = PCM_CLOCK_BASE,
628+
.end = PCM_CLOCK_BASE + 0x02,
629+
.flags = IORESOURCE_MEM,
630+
}
631+
};
632+
633+
static struct platform_device bcm2708_i2s_device = {
634+
.name = "bcm2708-i2s",
635+
.id = 0,
636+
.num_resources = ARRAY_SIZE(bcm2708_i2s_resources),
637+
.resource = bcm2708_i2s_resources,
638+
};
639+
#endif
640+
619641
int __init bcm_register_device(struct platform_device *pdev)
620642
{
621643
int ret;
@@ -780,6 +802,10 @@ void __init bcm2708_init(void)
780802

781803
bcm_register_device_dt(&bcm2835_thermal_device);
782804

805+
#if defined(CONFIG_SND_BCM2708_SOC_I2S) || defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE)
806+
bcm_register_device_dt(&bcm2708_i2s_device);
807+
#endif
808+
783809
if (!use_dt) {
784810
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
785811
struct amba_device *d = amba_devs[i];

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)