diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-08-25 10:06:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:18:24 -0400 |
commit | c41debafc6e396a8e15f1f017aec7c0cf67e1b54 (patch) | |
tree | 4f128d3acb39deab3eb9f8ab1a9681fc07148432 /arch/sh | |
parent | 2639ead140aa7063188b6599a1a7398d60db2712 (diff) |
V4L/DVB (12504): soc-camera: prepare soc_camera_platform.c and its users for conversion
soc_camera_platform.c is only used by y SuperH ap325rxa board. This patch
converts soc_camera_platform.c and its users for the soc-camera platform-
device conversion and also extends soc-camera core to handle non-I2C cameras.
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 327d47c25a57..7e2d2de0384d 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -310,6 +310,9 @@ static int camera_set_capture(struct soc_camera_platform_info *info, | |||
310 | return ret; | 310 | return ret; |
311 | } | 311 | } |
312 | 312 | ||
313 | static int ap325rxa_camera_add(struct soc_camera_link *icl, struct device *dev); | ||
314 | static void ap325rxa_camera_del(struct soc_camera_link *icl); | ||
315 | |||
313 | static struct soc_camera_platform_info camera_info = { | 316 | static struct soc_camera_platform_info camera_info = { |
314 | .iface = 0, | 317 | .iface = 0, |
315 | .format_name = "UYVY", | 318 | .format_name = "UYVY", |
@@ -323,6 +326,10 @@ static struct soc_camera_platform_info camera_info = { | |||
323 | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | | 326 | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | |
324 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, | 327 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, |
325 | .set_capture = camera_set_capture, | 328 | .set_capture = camera_set_capture, |
329 | .link = { | ||
330 | .add_device = ap325rxa_camera_add, | ||
331 | .del_device = ap325rxa_camera_del, | ||
332 | }, | ||
326 | }; | 333 | }; |
327 | 334 | ||
328 | static struct platform_device camera_device = { | 335 | static struct platform_device camera_device = { |
@@ -332,15 +339,20 @@ static struct platform_device camera_device = { | |||
332 | }, | 339 | }, |
333 | }; | 340 | }; |
334 | 341 | ||
335 | static int __init camera_setup(void) | 342 | static int ap325rxa_camera_add(struct soc_camera_link *icl, |
343 | struct device *dev) | ||
336 | { | 344 | { |
337 | if (camera_probe() > 0) | 345 | if (icl != &camera_info.link || camera_probe() <= 0) |
338 | platform_device_register(&camera_device); | 346 | return -ENODEV; |
339 | 347 | ||
340 | return 0; | 348 | return platform_device_register(&camera_device); |
341 | } | 349 | } |
342 | late_initcall(camera_setup); | ||
343 | 350 | ||
351 | static void ap325rxa_camera_del(struct soc_camera_link *icl) | ||
352 | { | ||
353 | if (icl == &camera_info.link) | ||
354 | platform_device_unregister(&camera_device); | ||
355 | } | ||
344 | #endif /* CONFIG_I2C */ | 356 | #endif /* CONFIG_I2C */ |
345 | 357 | ||
346 | static int ov7725_power(struct device *dev, int mode) | 358 | static int ov7725_power(struct device *dev, int mode) |
@@ -423,11 +435,19 @@ static struct ov772x_camera_info ov7725_info = { | |||
423 | }, | 435 | }, |
424 | }; | 436 | }; |
425 | 437 | ||
426 | static struct platform_device ap325rxa_camera = { | 438 | static struct platform_device ap325rxa_camera[] = { |
427 | .name = "soc-camera-pdrv", | 439 | { |
428 | .id = 0, | 440 | .name = "soc-camera-pdrv", |
429 | .dev = { | 441 | .id = 0, |
430 | .platform_data = &ov7725_info.link, | 442 | .dev = { |
443 | .platform_data = &ov7725_info.link, | ||
444 | }, | ||
445 | }, { | ||
446 | .name = "soc-camera-pdrv", | ||
447 | .id = 1, | ||
448 | .dev = { | ||
449 | .platform_data = &camera_info.link, | ||
450 | }, | ||
431 | }, | 451 | }, |
432 | }; | 452 | }; |
433 | 453 | ||
@@ -438,7 +458,8 @@ static struct platform_device *ap325rxa_devices[] __initdata = { | |||
438 | &ceu_device, | 458 | &ceu_device, |
439 | &nand_flash_device, | 459 | &nand_flash_device, |
440 | &sdcard_cn3_device, | 460 | &sdcard_cn3_device, |
441 | &ap325rxa_camera, | 461 | &ap325rxa_camera[0], |
462 | &ap325rxa_camera[1], | ||
442 | }; | 463 | }; |
443 | 464 | ||
444 | static struct spi_board_info ap325rxa_spi_devices[] = { | 465 | static struct spi_board_info ap325rxa_spi_devices[] = { |