ARM: S3C24XX: Add platform device for AC97 controller
[safe/jmp/linux-2.6] / arch / arm / plat-s3c24xx / devs.c
index e93f8bf..4553ad6 100644 (file)
 #include <asm/mach/irq.h>
 #include <mach/fb.h>
 #include <mach/hardware.h>
+#include <mach/dma.h>
+#include <mach/irqs.h>
 #include <asm/irq.h>
 
 #include <plat/regs-serial.h>
-#include <asm/plat-s3c24xx/udc.h>
+#include <plat/udc.h>
 
 #include <plat/devs.h>
 #include <plat/cpu.h>
-#include <asm/plat-s3c24xx/regs-spi.h>
+#include <plat/regs-spi.h>
 
 /* Serial port registrations */
 
@@ -76,6 +78,19 @@ static struct resource s3c2410_uart2_resource[] = {
        }
 };
 
+static struct resource s3c2410_uart3_resource[] = {
+       [0] = {
+               .start = S3C2443_PA_UART3,
+               .end   = S3C2443_PA_UART3 + 0x3fff,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_S3CUART_RX3,
+               .end   = IRQ_S3CUART_ERR3,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
 struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
        [0] = {
                .resources      = s3c2410_uart0_resource,
@@ -89,6 +104,10 @@ struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
                .resources      = s3c2410_uart2_resource,
                .nr_resources   = ARRAY_SIZE(s3c2410_uart2_resource),
        },
+       [3] = {
+               .resources      = s3c2410_uart3_resource,
+               .nr_resources   = ARRAY_SIZE(s3c2410_uart3_resource),
+       },
 };
 
 /* yart devices */
@@ -105,45 +124,20 @@ static struct platform_device s3c24xx_uart_device2 = {
        .id             = 2,
 };
 
-struct platform_device *s3c24xx_uart_src[3] = {
+static struct platform_device s3c24xx_uart_device3 = {
+       .id             = 3,
+};
+
+struct platform_device *s3c24xx_uart_src[4] = {
        &s3c24xx_uart_device0,
        &s3c24xx_uart_device1,
        &s3c24xx_uart_device2,
+       &s3c24xx_uart_device3,
 };
 
-struct platform_device *s3c24xx_uart_devs[3] = {
-};
-
-/* USB Host Controller */
-
-static struct resource s3c_usb_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_USBHOST,
-               .end   = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_USBH,
-               .end   = IRQ_USBH,
-               .flags = IORESOURCE_IRQ,
-       }
-};
-
-static u64 s3c_device_usb_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_usb = {
-       .name             = "s3c2410-ohci",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_usb_resource),
-       .resource         = s3c_usb_resource,
-       .dev              = {
-               .dma_mask = &s3c_device_usb_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
+struct platform_device *s3c24xx_uart_devs[4] = {
 };
 
-EXPORT_SYMBOL(s3c_device_usb);
-
 /* LCD Controller */
 
 static struct resource s3c_lcd_resource[] = {
@@ -192,8 +186,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
 
 static struct resource s3c_nand_resource[] = {
        [0] = {
-               .start = S3C2410_PA_NAND,
-               .end   = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
+               .start = S3C24XX_PA_NAND,
+               .end   = S3C24XX_PA_NAND + S3C24XX_SZ_NAND - 1,
                .flags = IORESOURCE_MEM,
        }
 };
@@ -271,31 +265,6 @@ struct platform_device s3c_device_wdt = {
 
 EXPORT_SYMBOL(s3c_device_wdt);
 
-/* I2C */
-
-static struct resource s3c_i2c_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_IIC,
-               .end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_IIC,
-               .end   = IRQ_IIC,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_i2c = {
-       .name             = "s3c2410-i2c",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
-       .resource         = s3c_i2c_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_i2c);
-
 /* IIS */
 
 static struct resource s3c_iis_resource[] = {
@@ -372,18 +341,26 @@ static struct resource s3c_adc_resource[] = {
 };
 
 struct platform_device s3c_device_adc = {
-       .name             = "s3c2410-adc",
+       .name             = "s3c24xx-adc",
        .id               = -1,
        .num_resources    = ARRAY_SIZE(s3c_adc_resource),
        .resource         = s3c_adc_resource,
 };
 
+/* HWMON */
+
+struct platform_device s3c_device_hwmon = {
+       .name           = "s3c24xx-hwmon",
+       .id             = -1,
+       .dev.parent     = &s3c_device_adc.dev,
+};
+
 /* SDI */
 
 static struct resource s3c_sdi_resource[] = {
        [0] = {
-               .start = S3C2410_PA_SDI,
-               .end   = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
+               .start = S3C24XX_PA_SDI,
+               .end   = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1,
                .flags = IORESOURCE_MEM,
        },
        [1] = {
@@ -403,36 +380,6 @@ struct platform_device s3c_device_sdi = {
 
 EXPORT_SYMBOL(s3c_device_sdi);
 
-/* High-speed MMC/SD */
-
-static struct resource s3c_hsmmc_resource[] = {
-       [0] = {
-               .start = S3C2443_PA_HSMMC,
-               .end   = S3C2443_PA_HSMMC + S3C2443_SZ_HSMMC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_S3C2443_HSMMC,
-               .end   = IRQ_S3C2443_HSMMC,
-               .flags = IORESOURCE_IRQ,
-       }
-};
-
-static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_hsmmc = {
-       .name             = "s3c-sdhci",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_hsmmc_resource),
-       .resource         = s3c_hsmmc_resource,
-       .dev              = {
-               .dma_mask = &s3c_device_hsmmc_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
-};
-
-
-
 /* SPI (0) */
 
 static struct resource s3c_spi0_resource[] = {
@@ -528,4 +475,52 @@ struct platform_device s3c_device_camif = {
 
 EXPORT_SYMBOL(s3c_device_camif);
 
+/* AC97 */
+
+static struct resource s3c_ac97_resource[] = {
+       [0] = {
+               .start = S3C2440_PA_AC97,
+               .end   = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_S3C244x_AC97,
+               .end   = IRQ_S3C244x_AC97,
+               .flags = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .name  = "PCM out",
+               .start = DMACH_PCM_OUT,
+               .end   = DMACH_PCM_OUT,
+               .flags = IORESOURCE_DMA,
+       },
+       [3] = {
+               .name  = "PCM in",
+               .start = DMACH_PCM_IN,
+               .end   = DMACH_PCM_IN,
+               .flags = IORESOURCE_DMA,
+       },
+       [4] = {
+               .name  = "Mic in",
+               .start = DMACH_MIC_IN,
+               .end   = DMACH_MIC_IN,
+               .flags = IORESOURCE_DMA,
+       },
+};
+
+static u64 s3c_device_ac97_dmamask = 0xffffffffUL;
+
+struct platform_device s3c_device_ac97 = {
+       .name             = "s3c-ac97",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_ac97_resource),
+       .resource         = s3c_ac97_resource,
+       .dev              = {
+               .dma_mask = &s3c_device_ac97_dmamask,
+               .coherent_dma_mask = 0xffffffffUL
+       }
+};
+
+EXPORT_SYMBOL(s3c_device_ac97);
+
 #endif // CONFIG_CPU_S32440