aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 12:03:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 12:03:10 -0400
commitc720f5655df159a630fa0290a0bd67c93e92b0bf (patch)
tree940d139d0ec1ff5201efddef6cc663166a8a2df3 /arch
parent33e6c1a0de818d3698cdab27c42915661011319d (diff)
parent84d6ae431f315e8973aac3c3fe1d550fc9240ef3 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (222 commits) V4L/DVB (13033): pt1: Don't use a deprecated DMA_BIT_MASK macro V4L/DVB (13029): radio-si4713: remove #include <linux/version.h> V4L/DVB (13027): go7007: convert printks to v4l2_info V4L/DVB (13026): s2250-board: Implement brightness and contrast controls V4L/DVB (13025): s2250-board: Fix memory leaks V4L/DVB (13024): go7007: Implement vidioc_g_std and vidioc_querystd V4L/DVB (13023): go7007: Merge struct gofh and go declarations V4L/DVB (13022): go7007: Fix mpeg controls V4L/DVB (13021): go7007: Fix whitespace and line lengths V4L/DVB (13020): go7007: Updates to Kconfig and Makefile V4L/DVB (13019): video: initial support for ADV7180 V4L/DVB (13018): kzalloc failure ignored in au8522_probe() V4L/DVB (13017): gspca: kmalloc failure ignored in sd_start() V4L/DVB (13016): kmalloc failure ignored in lgdt3304_attach() and s921_attach() V4L/DVB (13015): kmalloc failure ignored in m920x_firmware_download() V4L/DVB (13014): Add support for Compro VideoMate E800 (DVB-T part only) V4L/DVB (13013): FM TX: si4713: Kconfig: Fixed two typos. V4L/DVB (13012): uvc: introduce missing kfree V4L/DVB (13011): Change tuner type of BeholdTV cards V4L/DVB (13009): gspca - stv06xx-hdcs: Reduce exposure range ...
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/boards/board-ap325rxa.c58
1 files changed, 46 insertions, 12 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index 327d47c25a57..2d080732a964 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -310,8 +310,10 @@ static int camera_set_capture(struct soc_camera_platform_info *info,
310 return ret; 310 return ret;
311} 311}
312 312
313static int ap325rxa_camera_add(struct soc_camera_link *icl, struct device *dev);
314static void ap325rxa_camera_del(struct soc_camera_link *icl);
315
313static struct soc_camera_platform_info camera_info = { 316static struct soc_camera_platform_info camera_info = {
314 .iface = 0,
315 .format_name = "UYVY", 317 .format_name = "UYVY",
316 .format_depth = 16, 318 .format_depth = 16,
317 .format = { 319 .format = {
@@ -323,24 +325,46 @@ static struct soc_camera_platform_info camera_info = {
323 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | 325 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
324 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, 326 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
325 .set_capture = camera_set_capture, 327 .set_capture = camera_set_capture,
328 .link = {
329 .bus_id = 0,
330 .add_device = ap325rxa_camera_add,
331 .del_device = ap325rxa_camera_del,
332 .module_name = "soc_camera_platform",
333 },
326}; 334};
327 335
336static void dummy_release(struct device *dev)
337{
338}
339
328static struct platform_device camera_device = { 340static struct platform_device camera_device = {
329 .name = "soc_camera_platform", 341 .name = "soc_camera_platform",
330 .dev = { 342 .dev = {
331 .platform_data = &camera_info, 343 .platform_data = &camera_info,
344 .release = dummy_release,
332 }, 345 },
333}; 346};
334 347
335static int __init camera_setup(void) 348static int ap325rxa_camera_add(struct soc_camera_link *icl,
349 struct device *dev)
336{ 350{
337 if (camera_probe() > 0) 351 if (icl != &camera_info.link || camera_probe() <= 0)
338 platform_device_register(&camera_device); 352 return -ENODEV;
339 353
340 return 0; 354 camera_info.dev = dev;
355
356 return platform_device_register(&camera_device);
341} 357}
342late_initcall(camera_setup);
343 358
359static void ap325rxa_camera_del(struct soc_camera_link *icl)
360{
361 if (icl != &camera_info.link)
362 return;
363
364 platform_device_unregister(&camera_device);
365 memset(&camera_device.dev.kobj, 0,
366 sizeof(camera_device.dev.kobj));
367}
344#endif /* CONFIG_I2C */ 368#endif /* CONFIG_I2C */
345 369
346static int ov7725_power(struct device *dev, int mode) 370static int ov7725_power(struct device *dev, int mode)
@@ -416,6 +440,7 @@ static struct ov772x_camera_info ov7725_info = {
416 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 440 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
417 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), 441 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
418 .link = { 442 .link = {
443 .bus_id = 0,
419 .power = ov7725_power, 444 .power = ov7725_power,
420 .board_info = &ap325rxa_i2c_camera[0], 445 .board_info = &ap325rxa_i2c_camera[0],
421 .i2c_adapter_id = 0, 446 .i2c_adapter_id = 0,
@@ -423,11 +448,19 @@ static struct ov772x_camera_info ov7725_info = {
423 }, 448 },
424}; 449};
425 450
426static struct platform_device ap325rxa_camera = { 451static struct platform_device ap325rxa_camera[] = {
427 .name = "soc-camera-pdrv", 452 {
428 .id = 0, 453 .name = "soc-camera-pdrv",
429 .dev = { 454 .id = 0,
430 .platform_data = &ov7725_info.link, 455 .dev = {
456 .platform_data = &ov7725_info.link,
457 },
458 }, {
459 .name = "soc-camera-pdrv",
460 .id = 1,
461 .dev = {
462 .platform_data = &camera_info.link,
463 },
431 }, 464 },
432}; 465};
433 466
@@ -438,7 +471,8 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
438 &ceu_device, 471 &ceu_device,
439 &nand_flash_device, 472 &nand_flash_device,
440 &sdcard_cn3_device, 473 &sdcard_cn3_device,
441 &ap325rxa_camera, 474 &ap325rxa_camera[0],
475 &ap325rxa_camera[1],
442}; 476};
443 477
444static struct spi_board_info ap325rxa_spi_devices[] = { 478static struct spi_board_info ap325rxa_spi_devices[] = {