Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[sfrench/cifs-2.6.git] / arch / sh / boards / mach-migor / setup.c
index 003ce837734d598fc8b04027e3ea4a7579859966..97528198029997ba34f814b35d8aa7f63cbf8f22 100644 (file)
@@ -25,8 +25,8 @@
 #include <asm/machvec.h>
 #include <asm/io.h>
 #include <asm/sh_keysc.h>
-#include <asm/migor.h>
-#include <asm/sh7722.h>
+#include <mach/migor.h>
+#include <cpu/sh7722.h>
 
 /* Address     IRQ  Size  Bus  Description
  * 0x00000000       64MB  16   NOR Flash (SP29PL256N)
@@ -37,7 +37,7 @@
  */
 
 static struct smc91x_platdata smc91x_info = {
-       .flags = SMC91X_USE_16BIT,
+       .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
 };
 
 static struct resource smc91x_eth_resources[] = {
@@ -288,8 +288,11 @@ static struct clk *camera_clk;
 
 static void camera_power_on(void)
 {
+       /* Use 10 MHz VIO_CKO instead of 24 MHz to work
+        * around signal quality issues on Panel Board V2.1.
+        */
        camera_clk = clk_get(NULL, "video_clk");
-       clk_set_rate(camera_clk, 24000000);
+       clk_set_rate(camera_clk, 10000000);
        clk_enable(camera_clk); /* start VIO_CKO */
 
        /* use VIO_RST to take camera out of reset */
@@ -307,10 +310,18 @@ static void camera_power_off(void)
        gpio_set_value(GPIO_PTT3, 0);
 }
 
+static void camera_power(int mode)
+{
+       if (mode)
+               camera_power_on();
+       else
+               camera_power_off();
+}
+
 #ifdef CONFIG_I2C
 static unsigned char camera_ov772x_magic[] =
 {
-       0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01,
+       0x09, 0x01, 0x0c, 0x20, 0x0d, 0x41, 0x0e, 0x01,
        0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
        0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
        0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
@@ -386,6 +397,7 @@ static struct soc_camera_platform_info ov772x_info = {
        },
        .bus_param =  SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
        SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+       .power = camera_power,
        .set_capture = ov772x_set_capture,
 };
 
@@ -400,8 +412,6 @@ static struct platform_device migor_camera_device = {
 static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
        .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
        | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
-       .enable_camera = camera_power_on,
-       .disable_camera = camera_power_off,
 };
 
 static struct resource migor_ceu_resources[] = {
@@ -463,8 +473,10 @@ static int __init migor_devices_setup(void)
        gpio_direction_output(GPIO_PTJ5, 1);
        gpio_export(GPIO_PTJ5, 0);
 
-       /* SMC91C111 */
+       /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */
        gpio_request(GPIO_FN_IRQ0, NULL);
+       ctrl_outl(0x00003400, BSC_CS4BCR);
+       ctrl_outl(0x00110080, BSC_CS4WCR);
 
        /* KEYSC */
        clk_always_enable("mstp214"); /* KEYSC */