]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/devices.c
Merge branch 'omap-fixes'
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / devices.c
index ce03fa750775d25d4d715175218354e90a8d2567..894cc355818afacdb0119796cffd76d793972075 100644 (file)
 #include <mach/board.h>
 #include <mach/mux.h>
 #include <mach/gpio.h>
-#include <mach/eac.h>
 #include <mach/mmc.h>
 
-#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
-#define OMAP2_MBOX_BASE                IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
+#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
 
-static struct resource mbox_resources[] = {
+static struct resource cam_resources[] = {
        {
-               .start          = OMAP2_MBOX_BASE,
-               .end            = OMAP2_MBOX_BASE + 0x11f,
+               .start          = OMAP24XX_CAMERA_BASE,
+               .end            = OMAP24XX_CAMERA_BASE + 0xfff,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = INT_24XX_CAM_IRQ,
+               .flags          = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device omap_cam_device = {
+       .name           = "omap24xxcam",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cam_resources),
+       .resource       = cam_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+       platform_device_register(&omap_cam_device);
+}
+
+#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+
+static struct resource omap3isp_resources[] = {
+       {
+               .start          = OMAP3430_ISP_BASE,
+               .end            = OMAP3430_ISP_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_CBUFF_BASE,
+               .end            = OMAP3430_ISP_CBUFF_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_CCP2_BASE,
+               .end            = OMAP3430_ISP_CCP2_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_CCDC_BASE,
+               .end            = OMAP3430_ISP_CCDC_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_HIST_BASE,
+               .end            = OMAP3430_ISP_HIST_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_H3A_BASE,
+               .end            = OMAP3430_ISP_H3A_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_PREV_BASE,
+               .end            = OMAP3430_ISP_PREV_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_RESZ_BASE,
+               .end            = OMAP3430_ISP_RESZ_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_SBL_BASE,
+               .end            = OMAP3430_ISP_SBL_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_CSI2A_BASE,
+               .end            = OMAP3430_ISP_CSI2A_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = OMAP3430_ISP_CSI2PHY_BASE,
+               .end            = OMAP3430_ISP_CSI2PHY_END,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = INT_34XX_CAM_IRQ,
+               .flags          = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device omap3isp_device = {
+       .name           = "omap3isp",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(omap3isp_resources),
+       .resource       = omap3isp_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+       platform_device_register(&omap3isp_device);
+}
+#else
+static inline void omap_init_camera(void)
+{
+}
+#endif
+
+#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
+
+#define MBOX_REG_SIZE  0x120
+
+static struct resource omap2_mbox_resources[] = {
+       {
+               .start          = OMAP24XX_MAILBOX_BASE,
+               .end            = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
                .flags          = IORESOURCE_MEM,
        },
        {
@@ -47,20 +154,40 @@ static struct resource mbox_resources[] = {
        },
 };
 
+static struct resource omap3_mbox_resources[] = {
+       {
+               .start          = OMAP34XX_MAILBOX_BASE,
+               .end            = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = INT_24XX_MAIL_U0_MPU,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
 static struct platform_device mbox_device = {
-       .name           = "mailbox",
+       .name           = "omap2-mailbox",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(mbox_resources),
-       .resource       = mbox_resources,
 };
 
 static inline void omap_init_mbox(void)
 {
+       if (cpu_is_omap2420()) {
+               mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
+               mbox_device.resource = omap2_mbox_resources;
+       } else if (cpu_is_omap3430()) {
+               mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
+               mbox_device.resource = omap3_mbox_resources;
+       } else {
+               pr_err("%s: platform not supported\n", __func__);
+               return;
+       }
        platform_device_register(&mbox_device);
 }
 #else
 static inline void omap_init_mbox(void) { }
-#endif
+#endif /* CONFIG_OMAP_MBOX_FWK */
 
 #if defined(CONFIG_OMAP_STI)
 
@@ -227,10 +354,12 @@ static void omap_init_mcspi(void)
        platform_device_register(&omap2_mcspi1);
        platform_device_register(&omap2_mcspi2);
 #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3)
-       platform_device_register(&omap2_mcspi3);
+       if (cpu_is_omap2430() || cpu_is_omap343x())
+               platform_device_register(&omap2_mcspi3);
 #endif
 #ifdef CONFIG_ARCH_OMAP3
-       platform_device_register(&omap2_mcspi4);
+       if (cpu_is_omap343x())
+               platform_device_register(&omap2_mcspi4);
 #endif
 }
 
@@ -238,38 +367,6 @@ static void omap_init_mcspi(void)
 static inline void omap_init_mcspi(void) {}
 #endif
 
-#ifdef CONFIG_SND_OMAP24XX_EAC
-
-#define OMAP2_EAC_BASE                 0x48090000
-
-static struct resource omap2_eac_resources[] = {
-       {
-               .start          = OMAP2_EAC_BASE,
-               .end            = OMAP2_EAC_BASE + 0x109,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device omap2_eac_device = {
-       .name           = "omap24xx-eac",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(omap2_eac_resources),
-       .resource       = omap2_eac_resources,
-       .dev = {
-               .platform_data = NULL,
-       },
-};
-
-void omap_init_eac(struct eac_platform_data *pdata)
-{
-       omap2_eac_device.dev.platform_data = pdata;
-       platform_device_register(&omap2_eac_device);
-}
-
-#else
-void omap_init_eac(struct eac_platform_data *pdata) {}
-#endif
-
 #ifdef CONFIG_OMAP_SHA1_MD5
 static struct resource sha1_md5_resources[] = {
        {
@@ -348,11 +445,12 @@ static void __init omap_hsmmc_reset(void)
                }
 
                dummy_pdev.id = i;
-               iclk = clk_get(dev, "mmchs_ick");
+               dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
+               iclk = clk_get(dev, "ick");
                if (iclk && clk_enable(iclk))
                        iclk = NULL;
 
-               fclk = clk_get(dev, "mmchs_fck");
+               fclk = clk_get(dev, "fck");
                if (fclk && clk_enable(fclk))
                        fclk = NULL;
 
@@ -506,6 +604,7 @@ static int __init omap2_init_devices(void)
         * in alphabetical order so they're easier to sort through.
         */
        omap_hsmmc_reset();
+       omap_init_camera();
        omap_init_mbox();
        omap_init_mcspi();
        omap_hdq_init();