Merge branch 'fix/soundcore' into for-linus
[pandora-kernel.git] / arch / sh / boards / board-sh7785lcr.c
index 33b194b..42410a1 100644 (file)
 #include <linux/fb.h>
 #include <linux/mtd/physmap.h>
 #include <linux/delay.h>
+#include <linux/interrupt.h>
 #include <linux/i2c.h>
 #include <linux/i2c-pca-platform.h>
 #include <linux/i2c-algo-pca.h>
+#include <linux/usb/r8a66597.h>
 #include <linux/irq.h>
 #include <linux/clk.h>
 #include <linux/errno.h>
 #include <mach/sh7785lcr.h>
+#include <cpu/sh7785.h>
 #include <asm/heartbeat.h>
 #include <asm/clock.h>
 
@@ -97,18 +100,21 @@ static struct platform_device nor_flash_device = {
        .resource       = nor_flash_resources,
 };
 
+static struct r8a66597_platdata r8a66597_data = {
+       .xtal = R8A66597_PLATDATA_XTAL_12MHZ,
+       .vif = 1,
+};
+
 static struct resource r8a66597_usb_host_resources[] = {
        [0] = {
-               .name   = "r8a66597_hcd",
                .start  = R8A66597_ADDR,
                .end    = R8A66597_ADDR + R8A66597_SIZE - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .name   = "r8a66597_hcd",
                .start  = 2,
                .end    = 2,
-               .flags  = IORESOURCE_IRQ,
+               .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
        },
 };
 
@@ -118,6 +124,7 @@ static struct platform_device r8a66597_usb_host_device = {
        .dev = {
                .dma_mask               = NULL,
                .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &r8a66597_data,
        },
        .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
        .resource       = r8a66597_usb_host_resources,
@@ -320,6 +327,26 @@ static void __init sh7785lcr_setup(char **cmdline_p)
        writel(0x000307c2, sm501_reg);
 }
 
+/* Return the board specific boot mode pin configuration */
+static int sh7785lcr_mode_pins(void)
+{
+       int value = 0;
+
+       /* These are the factory default settings of S1 and S2.
+        * If you change these dip switches then you will need to
+        * adjust the values below as well.
+        */
+       value |= MODE_PIN4; /* Clock Mode 16 */
+       value |= MODE_PIN5; /* 32-bit Area0 bus width */
+       value |= MODE_PIN6; /* 32-bit Area0 bus width */
+       value |= MODE_PIN7; /* Area 0 SRAM interface [fixed] */
+       value |= MODE_PIN8; /* Little Endian */
+       value |= MODE_PIN9; /* Master Mode */
+       value |= MODE_PIN14; /* No PLL step-up */
+
+       return value;
+}
+
 /*
  * The Machine Vector
  */
@@ -328,5 +355,6 @@ static struct sh_machine_vector mv_sh7785lcr __initmv = {
        .mv_setup               = sh7785lcr_setup,
        .mv_clk_init            = sh7785lcr_clk_init,
        .mv_init_irq            = init_sh7785lcr_IRQ,
+       .mv_mode_pins           = sh7785lcr_mode_pins,
 };