]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 5085/2: PXA: Move AC97 over to the new central device declaration model
authorMark Brown <broonie@sirena.org.uk>
Tue, 10 Jun 2008 11:30:05 +0000 (12:30 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 9 Jul 2008 20:31:51 +0000 (21:31 +0100)
As well as moving all the device declarations to a single one in devices.c
this causes all platforms to register the I/O and interrupt resources for
the AC97 controller.

Cc: eric miao <eric.miao@marvell.com>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Jürgen Schindele <linux@schindele.name>
Cc: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/cm-x270.c
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/devices.h
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/trizeps4.c
include/asm-arm/arch-pxa/audio.h

index 6d4416a4f378807e17b886862d012acbe51fca3c..b3c3fd72d04561bc4cdf616ddd7a31532f1ff1da 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
 #include <asm/arch/pxa2xx-gpio.h>
+#include <asm/arch/audio.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/mmc.h>
@@ -81,12 +82,6 @@ static struct platform_device cmx270_device_dm9k = {
        }
 };
 
-/* audio device */
-static struct platform_device cmx270_audio_device = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-};
-
 /* touchscreen controller */
 static struct platform_device cmx270_ts_device = {
        .name           = "ucb1400_ts",
@@ -219,7 +214,6 @@ static struct platform_device cmx270_ata = {
 /* platform devices */
 static struct platform_device *platform_devices[] __initdata = {
        &cmx270_device_dm9k,
-       &cmx270_audio_device,
        &cmx270_rtc_device,
        &cmx270_2700G,
        &cmx270_led_device,
@@ -594,6 +588,7 @@ static void __init cmx270_init(void)
 
        /* register CM-X270 platform devices */
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       pxa_set_ac97_info(NULL);
 
        /* set MCI and OHCI platform parameters */
        pxa_set_mci_info(&cmx270_mci_platform_data);
index 123ee19ca795e99deef0dd4f30a60256661bf9d6..a6f2390ce662de674a520aca8bed2d5623148c0b 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/arch/ohci.h>
 #include <asm/arch/pxa27x_keypad.h>
 #include <asm/arch/camera.h>
+#include <asm/arch/audio.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -298,6 +299,37 @@ struct platform_device pxa_device_rtc = {
        .id             = -1,
 };
 
+static struct resource pxa_ac97_resources[] = {
+       [0] = {
+               .start  = 0x40500000,
+               .end    = 0x40500000 + 0xfff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_AC97,
+               .end    = IRQ_AC97,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static u64 pxa_ac97_dmamask = 0xffffffffUL;
+
+struct platform_device pxa_device_ac97 = {
+       .name           = "pxa2xx-ac97",
+       .id             = -1,
+       .dev            = {
+               .dma_mask = &pxa_ac97_dmamask,
+               .coherent_dma_mask = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(pxa_ac97_resources),
+       .resource       = pxa_ac97_resources,
+};
+
+void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops)
+{
+       pxa_register_device(&pxa_device_ac97, ops);
+}
+
 #ifdef CONFIG_PXA25x
 
 static struct resource pxa25x_resource_pwm0[] = {
index 881d1a7bf178fe96a18e57355154fc4e0d454398..b852eb18daa5f78526a2e40d835b4d166bc93594 100644 (file)
@@ -12,6 +12,7 @@ extern struct platform_device pxa_device_i2c;
 extern struct platform_device pxa_device_i2s;
 extern struct platform_device pxa_device_ficp;
 extern struct platform_device pxa_device_rtc;
+extern struct platform_device pxa_device_ac97;
 
 extern struct platform_device pxa27x_device_i2c_power;
 extern struct platform_device pxa27x_device_ohci;
index 1269ac991505e410470af4f15b7063a59747fc87..e23865affc0c5c9fda581a74c3d3d05f4ed6f457 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/pxa27x-udc.h>
+#include <asm/arch/audio.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/mmc.h>
@@ -73,12 +74,6 @@ static struct platform_device em_x270_dm9k = {
        }
 };
 
-/* audio device */
-static struct platform_device em_x270_audio = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-};
-
 /* WM9712 touchscreen controller. Hopefully the driver will make it to
  * the mainstream sometime */
 static struct platform_device em_x270_ts = {
@@ -218,7 +213,6 @@ static struct platform_device em_x270_nand = {
 /* platform devices */
 static struct platform_device *platform_devices[] __initdata = {
        &em_x270_dm9k,
-       &em_x270_audio,
        &em_x270_ts,
        &em_x270_rtc,
        &em_x270_nand,
@@ -326,6 +320,7 @@ static void __init em_x270_init(void)
 
        /* register EM-X270 platform devices */
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       pxa_set_ac97_info(NULL);
 
        /* set MCI and OHCI platform parameters */
        pxa_set_mci_info(&em_x270_mci_platform_data);
index 183b587672a6596cff6ff3b7ab9cd9b2dc76b3fc..cc1c4fa061451cc26e15c9250b545773adf9072a 100644 (file)
@@ -168,11 +168,6 @@ static struct platform_device smc91x_device = {
        .resource       = smc91x_resources,
 };
 
-static struct platform_device lpd270_audio_device = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-};
-
 static struct resource lpd270_flash_resources[] = {
        [0] = {
                .start  = PXA_CS0_PHYS,
@@ -412,7 +407,6 @@ __setup("lcd=", lpd270_set_lcd);
 static struct platform_device *platform_devices[] __initdata = {
        &smc91x_device,
        &lpd270_backlight_device,
-       &lpd270_audio_device,
        &lpd270_flash_device[0],
        &lpd270_flash_device[1],
 };
@@ -456,6 +450,8 @@ static void __init lpd270_init(void)
 
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 
+       pxa_set_ac97_info(NULL);
+
        if (lpd270_lcd_to_use != NULL)
                set_pxa_fb_info(lpd270_lcd_to_use);
 
index 7b9bdd0c66653b5a423b772d7f7e8152975e25ef..a3fae4139203d42325f6ecc0f3b833e57bc804b5 100644 (file)
@@ -43,6 +43,7 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
 #include <asm/arch/mfp-pxa25x.h>
+#include <asm/arch/audio.h>
 #include <asm/arch/lubbock.h>
 #include <asm/arch/udc.h>
 #include <asm/arch/irda.h>
@@ -196,11 +197,6 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {
        // no D+ pullup; lubbock can't connect/disconnect in software
 };
 
-static struct platform_device lub_audio_device = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-};
-
 static struct resource sa1111_resources[] = {
        [0] = {
                .start  = 0x10000000,
@@ -368,7 +364,6 @@ static struct platform_device lubbock_flash_device[2] = {
 
 static struct platform_device *devices[] __initdata = {
        &sa1111_device,
-       &lub_audio_device,
        &smc91x_device,
        &lubbock_flash_device[0],
        &lubbock_flash_device[1],
@@ -494,6 +489,7 @@ static void __init lubbock_init(void)
        set_pxa_fb_info(&sharp_lm8v31);
        pxa_set_mci_info(&lubbock_mci_platform_data);
        pxa_set_ficp_info(&lubbock_ficp_platform_data);
+       pxa_set_ac97_info(NULL);
 
        lubbock_flash_data[0].width = lubbock_flash_data[1].width =
                (BOOT_DEF & 1) ? 2 : 4;
index 266594426e8bb0049057510005ad8942a5823d1c..f2e9e7c4da8e625988d3d401c84a3650795caea8 100644 (file)
@@ -280,12 +280,6 @@ static pxa2xx_audio_ops_t mst_audio_ops = {
        .resume         = mst_audio_resume,
 };
 
-static struct platform_device mst_audio_device = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-       .dev            = { .platform_data = &mst_audio_ops },
-};
-
 static struct resource flash_resources[] = {
        [0] = {
                .start  = PXA_CS0_PHYS,
@@ -499,7 +493,6 @@ static struct platform_device mst_gpio_keys_device = {
 
 static struct platform_device *platform_devices[] __initdata = {
        &smc91x_device,
-       &mst_audio_device,
        &mst_flash_device[0],
        &mst_flash_device[1],
        &mst_gpio_keys_device,
@@ -609,6 +602,7 @@ static void __init mainstone_init(void)
        pxa_set_ficp_info(&mainstone_ficp_platform_data);
        pxa_set_ohci_info(&mainstone_ohci_platform_data);
        pxa_set_i2c_info(NULL);
+       pxa_set_ac97_info(&mst_audio_ops);
 
        mainstone_init_keypad();
 }
index 2564e16e4e2f266751ae8447baee385cc16efefc..5d87c7c866e4b30da57fa90a1693741220298815 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/mach/map.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-gpio.h>
+#include <asm/arch/audio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/pcm990_baseboard.h>
@@ -423,36 +424,6 @@ static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
 };
 #endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
 
-/*
- * AC97 support
- * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ
- */
-static struct resource pxa27x_ac97_resources[] = {
-       [0] = {
-               .start  = 0x40500000,
-               .end    = 0x40500000 + 0xfff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_AC97,
-               .end    = IRQ_AC97,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static u64 pxa_ac97_dmamask = 0xffffffffUL;
-
-static struct platform_device pxa27x_device_ac97 = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-       .dev            = {
-               .dma_mask = &pxa_ac97_dmamask,
-               .coherent_dma_mask = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(pxa27x_ac97_resources),
-       .resource       = pxa27x_ac97_resources,
-};
-
 /*
  * enable generic access to the base board control CPLDs U6 and U7
  */
@@ -490,8 +461,6 @@ void __init pcm990_baseboard_init(void)
        pxa_gpio_mode(GPIO16_PWM0_MD);
        platform_device_register(&pcm990_backlight_device);
 
-       platform_device_register(&pxa27x_device_ac97);
-
        /* MMC */
        pxa_set_mci_info(&pcm990_mci_platform_data);
 
@@ -499,6 +468,7 @@ void __init pcm990_baseboard_init(void)
        pxa_set_ohci_info(&pcm990_ohci_platform_data);
 
        pxa_set_i2c_info(NULL);
+       pxa_set_ac97_info(NULL);
 
 #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
        pxa_set_camera_info(&pcm990_pxacamera_platform_data);
index bc7c465ef32b770eb8c96a7a059ec529389eea5d..61e2440230896c2a056105629765af1eee47b52d 100644 (file)
@@ -176,19 +176,10 @@ static struct platform_device uart_devices = {
        .resource       = NULL,
 };
 
-/********************************************************************************************
- * PXA270 ac97 sound codec
- ********************************************************************************************/
-static struct platform_device ac97_audio_device = {
-       .name           = "pxa2xx-ac97",
-       .id             = -1,
-};
-
 static struct platform_device * trizeps4_devices[] __initdata = {
        &flash_device,
        &uart_devices,
        &dm9000_device,
-       &ac97_audio_device,
 };
 
 #ifdef CONFIG_MACH_TRIZEPS4_CONXS
@@ -439,6 +430,7 @@ static void __init trizeps4_init(void)
        pxa_set_mci_info(&trizeps4_mci_platform_data);
        pxa_set_ficp_info(&trizeps4_ficp_platform_data);
        pxa_set_ohci_info(&trizeps4_ohci_platform_data);
+       pxa_set_ac97_info(NULL);
 }
 
 static void __init trizeps4_map_io(void)
index 52bbe3bc25e1e5f283cc2d2d56603e06a127f4b1..f82f96dd1053c6b6b513a1fdb5bd1955dc495f1d 100644 (file)
@@ -12,4 +12,6 @@ typedef struct {
        void *priv;
 } pxa2xx_audio_ops_t;
 
+extern void pxa_set_ac97_info(pxa2xx_audio_ops_t *ops);
+
 #endif