Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / powerpc / platforms / 83xx / mpc832x_rdb.c
index fbca336..f049d69 100644 (file)
  */
 
 #include <linux/pci.h>
+#include <linux/interrupt.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
+#include <linux/of_platform.h>
 
-#include <asm/of_platform.h>
 #include <asm/time.h>
 #include <asm/ipic.h>
 #include <asm/udbg.h>
 #include <asm/qe.h>
 #include <asm/qe_ic.h>
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 
 #include "mpc83xx.h"
 
@@ -46,22 +50,20 @@ static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity)
        par_io_data_set(3, 13, !polarity);
 }
 
+static struct mmc_spi_platform_data mpc832x_mmc_pdata = {
+       .ocr_mask = MMC_VDD_33_34,
+};
+
 static struct spi_board_info mpc832x_spi_boardinfo = {
        .bus_num = 0x4c0,
        .chip_select = 0,
        .max_speed_hz = 50000000,
-       /*
-        * XXX: This is spidev (spi in userspace) stub, should
-        * be replaced by "mmc_spi" when mmc_spi will hit mainline.
-        */
-       .modalias = "spidev",
+       .modalias = "mmc_spi",
+       .platform_data = &mpc832x_mmc_pdata,
 };
 
 static int __init mpc832x_spi_init(void)
 {
-       if (!machine_is(mpc832x_rdb))
-               return 0;
-
        par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
        par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
        par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
@@ -76,7 +78,7 @@ static int __init mpc832x_spi_init(void)
                            mpc83xx_spi_deactivate_cs);
 }
 
-device_initcall(mpc832x_spi_init);
+machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
 
 /* ************************************************************************
  *
@@ -100,7 +102,7 @@ static void __init mpc832x_rdb_setup_arch(void)
 #ifdef CONFIG_QUICC_ENGINE
        qe_reset();
 
-       if ((np = of_find_node_by_name(np, "par_io")) != NULL) {
+       if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
                par_io_init(np);
                of_node_put(np);
 
@@ -114,20 +116,18 @@ static struct of_device_id mpc832x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
+       { .compatible = "fsl,qe", },
        {},
 };
 
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-       if (!machine_is(mpc832x_rdb))
-               return 0;
-
        /* Publish the QE devices */
        of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
        return 0;
 }
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
 
 void __init mpc832x_rdb_init_IRQ(void)
 {
@@ -147,10 +147,12 @@ void __init mpc832x_rdb_init_IRQ(void)
        of_node_put(np);
 
 #ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+       if (!np) {
+               np = of_find_node_by_type(NULL, "qeic");
+               if (!np)
+                       return;
+       }
        qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
        of_node_put(np);
 #endif                         /* CONFIG_QUICC_ENGINE */