ARM: ep93xx: add AC97 platform support
authorMika Westerberg <mika.westerberg@iki.fi>
Thu, 14 Oct 2010 14:49:07 +0000 (17:49 +0300)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 15 Oct 2010 10:54:53 +0000 (11:54 +0100)
Add platform support for the EP93xx AC97 controller driver.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
arch/arm/mach-ep93xx/include/mach/platform.h

index 1990e2299841918f9900f897eac41d05dad2c7ea..ffdf87be295855e93a5e74734c86d060e28b4022 100644 (file)
@@ -832,6 +832,40 @@ void ep93xx_i2s_release(void)
 }
 EXPORT_SYMBOL(ep93xx_i2s_release);
 
+/*************************************************************************
+ * EP93xx AC97 audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_ac97_resources[] = {
+       {
+               .start  = EP93XX_AAC_PHYS_BASE,
+               .end    = EP93XX_AAC_PHYS_BASE + 0xb0 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_EP93XX_AACINTR,
+               .end    = IRQ_EP93XX_AACINTR,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device ep93xx_ac97_device = {
+       .name           = "ep93xx-ac97",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ep93xx_ac97_resources),
+       .resource       = ep93xx_ac97_resources,
+};
+
+void __init ep93xx_register_ac97(void)
+{
+       /*
+        * Make sure that the AC97 pins are not used by I2S.
+        */
+       ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+
+       platform_device_register(&ep93xx_ac97_device);
+       platform_device_register(&ep93xx_pcm_device);
+}
+
 extern void ep93xx_gpio_init(void);
 
 void __init ep93xx_init_devices(void)
index c54b3e56ba635a6c3edfc599dcf9154f27c5d43c..9ac4d105509727ef7968fedd488a9f121f73a6b0 100644 (file)
 #define EP93XX_GPIO_B_INT_STATUS       EP93XX_GPIO_REG(0xbc)
 #define EP93XX_GPIO_EEDRIVE            EP93XX_GPIO_REG(0xc8)
 
+#define EP93XX_AAC_PHYS_BASE           EP93XX_APB_PHYS(0x00080000)
 #define EP93XX_AAC_BASE                        EP93XX_APB_IOMEM(0x00080000)
 
 #define EP93XX_SPI_PHYS_BASE           EP93XX_APB_PHYS(0x000a0000)
index 3330b36d79e6a0838a88b0960db3ee436e0edc33..50660455b1d8bbaca6f221e8a8f7aa1710816057 100644 (file)
@@ -61,6 +61,7 @@ void ep93xx_keypad_release_gpio(struct platform_device *pdev);
 void ep93xx_register_i2s(void);
 int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config);
 void ep93xx_i2s_release(void);
+void ep93xx_register_ac97(void);
 
 void ep93xx_init_devices(void);
 extern struct sys_timer ep93xx_timer;