OMAP2/3 powerdomain: return errors rather than returning the output of IS_ERR()
[safe/jmp/linux-2.6] / arch / arm / mach-versatile / versatile_pb.c
index 22d5ca0..239cd30 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/sysdev.h>
 #include <linux/amba/bus.h>
+#include <linux/amba/pl061.h>
+#include <linux/amba/mmci.h>
+#include <linux/io.h>
 
-#include <asm/hardware.h>
-#include <asm/io.h>
+#include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/mmc.h>
 
 #include "core.h"
 
 #define IRQ_MMCI1A     IRQ_SIC_MMCI1A
 #endif
 
-static struct mmc_platform_data mmc1_plat_data = {
+static struct mmci_platform_data mmc1_plat_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .status         = mmc_status,
+       .gpio_wp        = -1,
+       .gpio_cd        = -1,
+};
+
+static struct pl061_platform_data gpio2_plat_data = {
+       .gpio_base      = 16,
+       .irq_base       = IRQ_GPIO2_START,
+};
+
+static struct pl061_platform_data gpio3_plat_data = {
+       .gpio_base      = 24,
+       .irq_base       = IRQ_GPIO3_START,
 };
 
 #define UART3_IRQ      { IRQ_SIC_UART3, NO_IRQ }
@@ -71,8 +83,8 @@ AMBA_DEVICE(sci1,  "fpga:0a", SCI1,     NULL);
 AMBA_DEVICE(mmc1,  "fpga:0b", MMCI1,    &mmc1_plat_data);
 
 /* DevChip Primecells */
-AMBA_DEVICE(gpio2, "dev:e6",  GPIO2,    NULL);
-AMBA_DEVICE(gpio3, "dev:e7",  GPIO3,    NULL);
+AMBA_DEVICE(gpio2, "dev:e6",  GPIO2,    &gpio2_plat_data);
+AMBA_DEVICE(gpio3, "dev:e7",  GPIO3,    &gpio3_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
        &uart3_device,
@@ -82,30 +94,25 @@ static struct amba_device *amba_devs[] __initdata = {
        &mmc1_device,
 };
 
-static int __init versatile_pb_init(void)
+static void __init versatile_pb_init(void)
 {
        int i;
 
-       if (machine_is_versatile_pb()) {
-               for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
-                       struct amba_device *d = amba_devs[i];
-                       amba_device_register(d, &iomem_resource);
-               }
-       }
+       versatile_init();
 
-       return 0;
+       for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
+               struct amba_device *d = amba_devs[i];
+               amba_device_register(d, &iomem_resource);
+       }
 }
 
-arch_initcall(versatile_pb_init);
-
 MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0x00000000,
        .phys_io        = 0x101f1000,
        .io_pg_offst    = ((0xf11f1000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .map_io         = versatile_map_io,
        .init_irq       = versatile_init_irq,
        .timer          = &versatile_timer,
-       .init_machine   = versatile_init,
+       .init_machine   = versatile_pb_init,
 MACHINE_END