diff mbox

[3/4] ARM: shmobile: Marzen: add VIN and ADV7180 support

Message ID 201304180215.01218.sergei.shtylyov@cogentembedded.com (mailing list archive)
State Superseded
Headers show

Commit Message

Sergei Shtylyov April 17, 2013, 10:15 p.m. UTC
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>

Add ADV7180 platform devices on the Marzen board, configure VIN1/3 pins, and
register VIN1/3 devices with the ADV7180 specific platform data.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 arch/arm/mach-shmobile/board-marzen.c |   55 ++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sergei Shtylyov April 17, 2013, 10:29 p.m. UTC | #1
Hello.

On 04/18/2013 02:15 AM, Sergei Shtylyov wrote:

> From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>
> Add ADV7180 platform devices on the Marzen board, configure VIN1/3 pins, and
> register VIN1/3 devices with the ADV7180 specific platform data.
>
> Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
>   arch/arm/mach-shmobile/board-marzen.c |   55 ++++++++++++++++++++++++++++++++++
>   1 file changed, 55 insertions(+)

    Oops, should have updated copyrights on this file. :-/
    Well, this is probably not the last version of the patchset 
anyway... :-)

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov April 18, 2013, 2:25 p.m. UTC | #2
On 18-04-2013 2:15, I wrote:

> From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>

> Add ADV7180 platform devices on the Marzen board, configure VIN1/3 pins, and
> register VIN1/3 devices with the ADV7180 specific platform data.

> Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

    I'm going to repost this patch recasted using a macro for camera sensor data.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: renesas/arch/arm/mach-shmobile/board-marzen.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/board-marzen.c
+++ renesas/arch/arm/mach-shmobile/board-marzen.c
@@ -37,6 +37,7 @@ 
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
+#include <media/soc_camera.h>
 #include <mach/hardware.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -178,12 +179,54 @@  static struct platform_device leds_devic
 	},
 };
 
+static struct rcar_vin_platform_data vin_platform_data = {
+	.flags	= RCAR_VIN_BT656,
+};
+
+static struct i2c_board_info i2c_camera[] = {
+	{
+		I2C_BOARD_INFO("adv7180", 0x20),
+	}, {
+		I2C_BOARD_INFO("adv7180", 0x21),
+	},
+};
+
+static struct soc_camera_link iclink_adv7180[] = {
+	{
+		.bus_id		= 1,
+		.i2c_adapter_id	= 0,
+		.board_info	= &i2c_camera[0],
+	}, {
+		.bus_id		= 3,
+		.i2c_adapter_id	= 0,
+		.board_info	= &i2c_camera[1],
+	}
+};
+
+static struct platform_device camera0_device = {
+	.name	= "soc-camera-pdrv",
+	.id	= 0,
+	.dev	= {
+		.platform_data	= &iclink_adv7180[0],
+	},
+};
+
+static struct platform_device camera1_device = {
+	.name	= "soc-camera-pdrv",
+	.id	= 1,
+	.dev	= {
+		.platform_data	= &iclink_adv7180[1],
+	},
+};
+
 static struct platform_device *marzen_devices[] __initdata = {
 	&eth_device,
 	&sdhi0_device,
 	&thermal_device,
 	&hspi_device,
 	&leds_device,
+	&camera0_device,
+	&camera1_device,
 };
 
 static const struct pinctrl_map marzen_pinctrl_map[] = {
@@ -219,6 +262,16 @@  static const struct pinctrl_map marzen_p
 	/* USB2 */
 	PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779",
 				  "usb2", "usb2"),
+	/* VIN1 */
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.1", "pfc-r8a7779",
+				  "vin1_clk", "vin1"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.1", "pfc-r8a7779",
+				  "vin1_data8", "vin1"),
+	/* VIN3 */
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.3", "pfc-r8a7779",
+				  "vin3_clk", "vin3"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.3", "pfc-r8a7779",
+				  "vin3_data8", "vin3"),
 };
 
 static void __init marzen_init(void)
@@ -234,6 +287,8 @@  static void __init marzen_init(void)
 
 	r8a7779_add_standard_devices();
 	r8a7779_add_usb_phy_device(&usb_phy_platform_data);
+	r8a7779_add_vin_device(1, &vin_platform_data);
+	r8a7779_add_vin_device(3, &vin_platform_data);
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }