diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-08-25 16:06:21 +0200 |
---|---|---|
committer | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-08-25 16:06:21 +0200 |
commit | aea41520a95b61491620e5702c8322a8fcfbf12e (patch) | |
tree | dae424dbcb72aec9da4a9cbfb4c8815f66f75f8c /linux/arch/sh/boards | |
parent | 9d0dc1f40d5d02887f421e23e1c6e0c93bf69f00 (diff) | |
download | mediapointer-dvb-s2-aea41520a95b61491620e5702c8322a8fcfbf12e.tar.gz mediapointer-dvb-s2-aea41520a95b61491620e5702c8322a8fcfbf12e.tar.bz2 |
soc-camera: prepare soc_camera_platform.c and its users for conversion
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Priority: low
---
arch/sh/boards/board-ap325rxa.c | 43 ++++++++++++++++++------
drivers/media/video/soc_camera.c | 61 ++++++++++++++++++++++++++--------
include/media/soc_camera.h | 6 +++
include/media/soc_camera_platform.h | 2 +
4 files changed, 86 insertions(+), 26 deletions(-)
Diffstat (limited to 'linux/arch/sh/boards')
-rw-r--r-- | linux/arch/sh/boards/board-ap325rxa.c | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/linux/arch/sh/boards/board-ap325rxa.c b/linux/arch/sh/boards/board-ap325rxa.c index 7ffd1b431..a40dc9d00 100644 --- a/linux/arch/sh/boards/board-ap325rxa.c +++ b/linux/arch/sh/boards/board-ap325rxa.c @@ -307,6 +307,9 @@ static int camera_set_capture(struct soc_camera_platform_info *info, return ret; } +static int ap325rxa_camera_add(struct soc_camera_link *icl, struct device *dev); +static void ap325rxa_camera_del(struct soc_camera_link *icl); + static struct soc_camera_platform_info camera_info = { .iface = 0, .format_name = "UYVY", @@ -320,6 +323,10 @@ static struct soc_camera_platform_info camera_info = { .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, .set_capture = camera_set_capture, + .link = { + .add_device = ap325rxa_camera_add, + .del_device = ap325rxa_camera_del, + }, }; static struct platform_device camera_device = { @@ -329,15 +336,20 @@ static struct platform_device camera_device = { }, }; -static int __init camera_setup(void) +static int ap325rxa_camera_add(struct soc_camera_link *icl, + struct device *dev) { - if (camera_probe() > 0) - platform_device_register(&camera_device); + if (icl != &camera_info.link || camera_probe() <= 0) + return -ENODEV; - return 0; + return platform_device_register(&camera_device); } -late_initcall(camera_setup); +static void ap325rxa_camera_del(struct soc_camera_link *icl) +{ + if (icl == &camera_info.link) + platform_device_unregister(&camera_device); +} #endif /* CONFIG_I2C */ static int ov7725_power(struct device *dev, int mode) @@ -417,11 +429,19 @@ static struct ov772x_camera_info ov7725_info = { }, }; -static struct platform_device ap325rxa_camera = { - .name = "soc-camera-pdrv", - .id = 0, - .dev = { - .platform_data = &ov7725_info.link, +static struct platform_device ap325rxa_camera[] = { + { + .name = "soc-camera-pdrv", + .id = 0, + .dev = { + .platform_data = &ov7725_info.link, + }, + }, { + .name = "soc-camera-pdrv", + .id = 1, + .dev = { + .platform_data = &camera_info.link, + }, }, }; @@ -432,7 +452,8 @@ static struct platform_device *ap325rxa_devices[] __initdata = { &ceu_device, &nand_flash_device, &sdcard_cn3_device, - &ap325rxa_camera, + &ap325rxa_camera[0], + &ap325rxa_camera[1], }; static struct spi_board_info ap325rxa_spi_devices[] = { |