]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-shmobile/board-bockw.c
Merge tag 'renesas-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[~andy/linux] / arch / arm / mach-shmobile / board-bockw.c
index 255e97e5be837545fd0d021662b76d71e8f60a31..6b9faf3908f72b2f23bd3a1a3b07887c6581bc9b 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2013  Renesas Solutions Corp.
  * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ * Copyright (C) 2013  Cogent Embedded, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,6 +32,7 @@
 #include <linux/smsc911x.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
+#include <media/soc_camera.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
 #include <mach/r8a7778.h>
@@ -102,7 +104,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_eth_plat_data ether_platform_data __initdata = {
        .phy            = 0x01,
        .edmac_endian   = EDMAC_LITTLE_ENDIAN,
-       .register_type  = SH_ETH_REG_FAST_RCAR,
        .phy_interface  = PHY_INTERFACE_MODE_RMII,
        /*
         * Although the LINK signal is available on the board, it's connected to
@@ -161,6 +162,25 @@ static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
                          MMC_CAP_NEEDS_POLL,
 };
 
+static struct rcar_vin_platform_data vin_platform_data __initdata = {
+       .flags  = RCAR_VIN_BT656,
+};
+
+/* In the default configuration both decoders reside on I2C bus 0 */
+#define BOCKW_CAMERA(idx)                                              \
+static struct i2c_board_info camera##idx##_info = {                    \
+       I2C_BOARD_INFO("ml86v7667", 0x41 + 2 * (idx)),                  \
+};                                                                     \
+                                                                       \
+static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = {   \
+       .bus_id         = idx,                                          \
+       .i2c_adapter_id = 0,                                            \
+       .board_info     = &camera##idx##_info,                          \
+}
+
+BOCKW_CAMERA(0);
+BOCKW_CAMERA(1);
+
 static const struct pinctrl_map bockw_pinctrl_map[] = {
        /* Ether */
        PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778",
@@ -192,6 +212,16 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
                                  "sdhi0_cd", "sdhi0"),
        PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
                                  "sdhi0_wp", "sdhi0"),
+       /* VIN0 */
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778",
+                                 "vin0_clk", "vin0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778",
+                                 "vin0_data8", "vin0"),
+       /* VIN1 */
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778",
+                                 "vin1_clk", "vin1"),
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778",
+                                 "vin1_data8", "vin1"),
 };
 
 #define FPGA   0x18200000
@@ -206,6 +236,16 @@ static void __init bockw_init(void)
        r8a7778_init_irq_extpin(1);
        r8a7778_add_standard_devices();
        r8a7778_add_ether_device(&ether_platform_data);
+       r8a7778_add_vin_device(0, &vin_platform_data);
+       /* VIN1 has a pin conflict with Ether */
+       if (!IS_ENABLED(CONFIG_SH_ETH))
+               r8a7778_add_vin_device(1, &vin_platform_data);
+       platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0,
+                                     &iclink0_ml86v7667,
+                                     sizeof(iclink0_ml86v7667));
+       platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
+                                     &iclink1_ml86v7667,
+                                     sizeof(iclink1_ml86v7667));
 
        i2c_register_board_info(0, i2c0_devices,
                                ARRAY_SIZE(i2c0_devices));