[ARM] 2897/2: PXA2xx IRDA support
[linux-2.6.git] / arch / arm / mach-pxa / generic.c
index 2e9e170..3248bc9 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/arch/udc.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/irda.h>
 #include <asm/arch/i2c.h>
 
 #include "generic.h"
@@ -253,6 +254,10 @@ static struct platform_device stuart_device = {
        .name           = "pxa2xx-uart",
        .id             = 2,
 };
+static struct platform_device hwuart_device = {
+       .name           = "pxa2xx-uart",
+       .id             = 3,
+};
 
 static struct resource i2c_resources[] = {
        {
@@ -293,10 +298,26 @@ static struct resource i2s_resources[] = {
 static struct platform_device i2s_device = {
        .name           = "pxa2xx-i2s",
        .id             = -1,
-       .resource       = i2c_resources,
+       .resource       = i2s_resources,
        .num_resources  = ARRAY_SIZE(i2s_resources),
 };
 
+static u64 pxaficp_dmamask = ~(u32)0;
+
+static struct platform_device pxaficp_device = {
+       .name           = "pxa2xx-ir",
+       .id             = -1,
+       .dev            = {
+               .dma_mask = &pxaficp_dmamask,
+               .coherent_dma_mask = 0xffffffff,
+       },
+};
+
+void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
+{
+       pxaficp_device.dev.platform_data = info;
+}
+
 static struct platform_device *devices[] __initdata = {
        &pxamci_device,
        &udc_device,
@@ -304,13 +325,26 @@ static struct platform_device *devices[] __initdata = {
        &ffuart_device,
        &btuart_device,
        &stuart_device,
+       &pxaficp_device,
        &i2c_device,
        &i2s_device,
 };
 
 static int __init pxa_init(void)
 {
-       return platform_add_devices(devices, ARRAY_SIZE(devices));
+       int cpuid, ret;
+
+       ret = platform_add_devices(devices, ARRAY_SIZE(devices));
+       if (ret)
+               return ret;
+
+       /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
+       cpuid = read_cpuid(CPUID_ID);
+       if (((cpuid >> 4) & 0xfff) == 0x2d0 ||
+           ((cpuid >> 4) & 0xfff) == 0x290)
+               ret = platform_device_register(&hwuart_device);
+
+       return ret;
 }
 
 subsys_initcall(pxa_init);