diff options
author | Vladimir Barinov <vladimir.barinov@cogentembedded.com> | 2013-08-22 16:25:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-08-25 06:34:13 -0400 |
commit | 7cef5e7fd1ab891bc59c269a1a55b8e8d8ca5bc8 (patch) | |
tree | 9627e8e244b051916c922dff84ebb7b382d490f5 | |
parent | 4714a0255eee45b87634ab28f8a7e66038f645ba (diff) |
[media] ARM: shmobile: Marzen: add VIN and ADV7180 support
Add ADV7180 platform devices on the Marzen board, configure VIN1/3 pins, and
register VIN1/3 devices with the ADV7180 specific platform data.
[Sergei: removed superfluous tabulation and inserted empty lines in the macro
definition, updated the copyrights, annotated VIN platform data as '__initdata']
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | arch/arm/mach-shmobile/board-marzen.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index a7d1010505bf..ca7fb2e63c60 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
@@ -1,8 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * marzen board support | 2 | * marzen board support |
3 | * | 3 | * |
4 | * Copyright (C) 2011 Renesas Solutions Corp. | 4 | * Copyright (C) 2011, 2013 Renesas Solutions Corp. |
5 | * Copyright (C) 2011 Magnus Damm | 5 | * Copyright (C) 2011 Magnus Damm |
6 | * Copyright (C) 2013 Cogent Embedded, Inc. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -37,6 +38,7 @@ | |||
37 | #include <linux/mmc/host.h> | 38 | #include <linux/mmc/host.h> |
38 | #include <linux/mmc/sh_mobile_sdhi.h> | 39 | #include <linux/mmc/sh_mobile_sdhi.h> |
39 | #include <linux/mfd/tmio.h> | 40 | #include <linux/mfd/tmio.h> |
41 | #include <media/soc_camera.h> | ||
40 | #include <mach/hardware.h> | 42 | #include <mach/hardware.h> |
41 | #include <mach/r8a7779.h> | 43 | #include <mach/r8a7779.h> |
42 | #include <mach/common.h> | 44 | #include <mach/common.h> |
@@ -178,12 +180,40 @@ static struct platform_device leds_device = { | |||
178 | }, | 180 | }, |
179 | }; | 181 | }; |
180 | 182 | ||
183 | static struct rcar_vin_platform_data vin_platform_data __initdata = { | ||
184 | .flags = RCAR_VIN_BT656, | ||
185 | }; | ||
186 | |||
187 | #define MARZEN_CAMERA(idx) \ | ||
188 | static struct i2c_board_info camera##idx##_info = { \ | ||
189 | I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \ | ||
190 | }; \ | ||
191 | \ | ||
192 | static struct soc_camera_link iclink##idx##_adv7180 = { \ | ||
193 | .bus_id = 1 + 2 * (idx), \ | ||
194 | .i2c_adapter_id = 0, \ | ||
195 | .board_info = &camera##idx##_info, \ | ||
196 | }; \ | ||
197 | \ | ||
198 | static struct platform_device camera##idx##_device = { \ | ||
199 | .name = "soc-camera-pdrv", \ | ||
200 | .id = idx, \ | ||
201 | .dev = { \ | ||
202 | .platform_data = &iclink##idx##_adv7180, \ | ||
203 | }, \ | ||
204 | }; | ||
205 | |||
206 | MARZEN_CAMERA(0); | ||
207 | MARZEN_CAMERA(1); | ||
208 | |||
181 | static struct platform_device *marzen_devices[] __initdata = { | 209 | static struct platform_device *marzen_devices[] __initdata = { |
182 | ð_device, | 210 | ð_device, |
183 | &sdhi0_device, | 211 | &sdhi0_device, |
184 | &thermal_device, | 212 | &thermal_device, |
185 | &hspi_device, | 213 | &hspi_device, |
186 | &leds_device, | 214 | &leds_device, |
215 | &camera0_device, | ||
216 | &camera1_device, | ||
187 | }; | 217 | }; |
188 | 218 | ||
189 | static const struct pinctrl_map marzen_pinctrl_map[] = { | 219 | static const struct pinctrl_map marzen_pinctrl_map[] = { |
@@ -219,6 +249,16 @@ static const struct pinctrl_map marzen_pinctrl_map[] = { | |||
219 | /* USB2 */ | 249 | /* USB2 */ |
220 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", | 250 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", |
221 | "usb2", "usb2"), | 251 | "usb2", "usb2"), |
252 | /* VIN1 */ | ||
253 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779", | ||
254 | "vin1_clk", "vin1"), | ||
255 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779", | ||
256 | "vin1_data8", "vin1"), | ||
257 | /* VIN3 */ | ||
258 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779", | ||
259 | "vin3_clk", "vin3"), | ||
260 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779", | ||
261 | "vin3_data8", "vin3"), | ||
222 | }; | 262 | }; |
223 | 263 | ||
224 | static void __init marzen_init(void) | 264 | static void __init marzen_init(void) |
@@ -235,6 +275,8 @@ static void __init marzen_init(void) | |||
235 | 275 | ||
236 | r8a7779_add_standard_devices(); | 276 | r8a7779_add_standard_devices(); |
237 | r8a7779_add_usb_phy_device(&usb_phy_platform_data); | 277 | r8a7779_add_usb_phy_device(&usb_phy_platform_data); |
278 | r8a7779_add_vin_device(1, &vin_platform_data); | ||
279 | r8a7779_add_vin_device(3, &vin_platform_data); | ||
238 | platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); | 280 | platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); |
239 | } | 281 | } |
240 | 282 | ||