diff options
author | Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> | 2010-10-01 19:37:00 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-10-01 19:37:00 -0400 |
commit | 8452e9ef2b08c7bd492194554cdffc67d0b2a51b (patch) | |
tree | cd0a844b7b4cd51963284ccbeca5f63835ca064e /arch/arm/mach-omap1 | |
parent | 1a96edd70c1f4b4a1904803f8a83900087f4d1da (diff) |
OMAP1: Amstrad Delta: add support for camera
This patch adds configuration data and initialization code required for camera
support to the Amstrad Delta board.
Three devices are declared: SoC camera, OMAP1 camera interface and OV6650
sensor.
Default 12MHz clock has been selected for driving the sensor. Pixel clock has
been limited to get reasonable frame rates, not exceeding the board
capabilities. Since both devices (interface and sensor) support both pixel
clock polarities, decision on polarity selection has been left to drivers.
Interface GPIO line has been found not functional, thus not configured.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/board-ams-delta.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 41992ab71961..12f7f607ab1f 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/serial_8250.h> | 20 | #include <linux/serial_8250.h> |
21 | 21 | ||
22 | #include <media/soc_camera.h> | ||
23 | |||
22 | #include <asm/serial.h> | 24 | #include <asm/serial.h> |
23 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
24 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
@@ -32,6 +34,7 @@ | |||
32 | #include <plat/usb.h> | 34 | #include <plat/usb.h> |
33 | #include <plat/board.h> | 35 | #include <plat/board.h> |
34 | #include <plat/common.h> | 36 | #include <plat/common.h> |
37 | #include <mach/camera.h> | ||
35 | 38 | ||
36 | #include <mach/ams-delta-fiq.h> | 39 | #include <mach/ams-delta-fiq.h> |
37 | 40 | ||
@@ -213,10 +216,37 @@ static struct platform_device ams_delta_led_device = { | |||
213 | .id = -1 | 216 | .id = -1 |
214 | }; | 217 | }; |
215 | 218 | ||
219 | static struct i2c_board_info ams_delta_camera_board_info[] = { | ||
220 | { | ||
221 | I2C_BOARD_INFO("ov6650", 0x60), | ||
222 | }, | ||
223 | }; | ||
224 | |||
225 | static struct soc_camera_link __initdata ams_delta_iclink = { | ||
226 | .bus_id = 0, /* OMAP1 SoC camera bus */ | ||
227 | .i2c_adapter_id = 1, | ||
228 | .board_info = &ams_delta_camera_board_info[0], | ||
229 | .module_name = "ov6650", | ||
230 | }; | ||
231 | |||
232 | static struct platform_device ams_delta_camera_device = { | ||
233 | .name = "soc-camera-pdrv", | ||
234 | .id = 0, | ||
235 | .dev = { | ||
236 | .platform_data = &ams_delta_iclink, | ||
237 | }, | ||
238 | }; | ||
239 | |||
240 | static struct omap1_cam_platform_data ams_delta_camera_platform_data = { | ||
241 | .camexclk_khz = 12000, /* default 12MHz clock, no extra DPLL */ | ||
242 | .lclk_khz_max = 1334, /* results in 5fps CIF, 10fps QCIF */ | ||
243 | }; | ||
244 | |||
216 | static struct platform_device *ams_delta_devices[] __initdata = { | 245 | static struct platform_device *ams_delta_devices[] __initdata = { |
217 | &ams_delta_kp_device, | 246 | &ams_delta_kp_device, |
218 | &ams_delta_lcd_device, | 247 | &ams_delta_lcd_device, |
219 | &ams_delta_led_device, | 248 | &ams_delta_led_device, |
249 | &ams_delta_camera_device, | ||
220 | }; | 250 | }; |
221 | 251 | ||
222 | static void __init ams_delta_init(void) | 252 | static void __init ams_delta_init(void) |
@@ -225,6 +255,20 @@ static void __init ams_delta_init(void) | |||
225 | omap_cfg_reg(UART1_TX); | 255 | omap_cfg_reg(UART1_TX); |
226 | omap_cfg_reg(UART1_RTS); | 256 | omap_cfg_reg(UART1_RTS); |
227 | 257 | ||
258 | /* parallel camera interface */ | ||
259 | omap_cfg_reg(H19_1610_CAM_EXCLK); | ||
260 | omap_cfg_reg(J15_1610_CAM_LCLK); | ||
261 | omap_cfg_reg(L18_1610_CAM_VS); | ||
262 | omap_cfg_reg(L15_1610_CAM_HS); | ||
263 | omap_cfg_reg(L19_1610_CAM_D0); | ||
264 | omap_cfg_reg(K14_1610_CAM_D1); | ||
265 | omap_cfg_reg(K15_1610_CAM_D2); | ||
266 | omap_cfg_reg(K19_1610_CAM_D3); | ||
267 | omap_cfg_reg(K18_1610_CAM_D4); | ||
268 | omap_cfg_reg(J14_1610_CAM_D5); | ||
269 | omap_cfg_reg(J19_1610_CAM_D6); | ||
270 | omap_cfg_reg(J18_1610_CAM_D7); | ||
271 | |||
228 | iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc)); | 272 | iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc)); |
229 | 273 | ||
230 | omap_board_config = ams_delta_config; | 274 | omap_board_config = ams_delta_config; |
@@ -236,6 +280,7 @@ static void __init ams_delta_init(void) | |||
236 | ams_delta_latch2_write(~0, 0); | 280 | ams_delta_latch2_write(~0, 0); |
237 | 281 | ||
238 | omap1_usb_init(&ams_delta_usb_config); | 282 | omap1_usb_init(&ams_delta_usb_config); |
283 | omap1_set_camera_info(&ams_delta_camera_platform_data); | ||
239 | platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); | 284 | platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); |
240 | 285 | ||
241 | #ifdef CONFIG_AMS_DELTA_FIQ | 286 | #ifdef CONFIG_AMS_DELTA_FIQ |