aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-05-13 05:33:43 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-09-10 06:49:31 -0400
commit4a3d3abe91963d7b3e562e70fc6c5c9d3f76fb30 (patch)
tree87c616149c2e42372012f788b9e2eedab1edf5a3
parentecc85e166fbec0378215aab13925b0e980a48d1e (diff)
[ARM] pxa/pcm990: convert pcm990 to soc-camera as platform-device
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c54
1 files changed, 44 insertions, 10 deletions
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index e211633471f7..bbda57078e0f 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -430,25 +430,56 @@ static void pcm990_camera_free_bus(struct soc_camera_link *link)
430 gpio_bus_switch = -EINVAL; 430 gpio_bus_switch = -EINVAL;
431} 431}
432 432
433static struct soc_camera_link iclink = {
434 .bus_id = 0, /* Must match with the camera ID above */
435 .query_bus_param = pcm990_camera_query_bus_param,
436 .set_bus_param = pcm990_camera_set_bus_param,
437 .free_bus = pcm990_camera_free_bus,
438};
439
440/* Board I2C devices. */ 433/* Board I2C devices. */
441static struct i2c_board_info __initdata pcm990_i2c_devices[] = { 434static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
442 { 435 {
443 /* Must initialize before the camera(s) */ 436 /* Must initialize before the camera(s) */
444 I2C_BOARD_INFO("pca9536", 0x41), 437 I2C_BOARD_INFO("pca9536", 0x41),
445 .platform_data = &pca9536_data, 438 .platform_data = &pca9536_data,
446 }, { 439 },
440};
441
442static struct i2c_board_info pcm990_camera_i2c[] = {
443 {
447 I2C_BOARD_INFO("mt9v022", 0x48), 444 I2C_BOARD_INFO("mt9v022", 0x48),
448 .platform_data = &iclink, /* With extender */
449 }, { 445 }, {
450 I2C_BOARD_INFO("mt9m001", 0x5d), 446 I2C_BOARD_INFO("mt9m001", 0x5d),
451 .platform_data = &iclink, /* With extender */ 447 },
448};
449
450static struct soc_camera_link iclink[] = {
451 {
452 .bus_id = 0, /* Must match with the camera ID */
453 .board_info = &pcm990_camera_i2c[0],
454 .i2c_adapter_id = 0,
455 .query_bus_param = pcm990_camera_query_bus_param,
456 .set_bus_param = pcm990_camera_set_bus_param,
457 .free_bus = pcm990_camera_free_bus,
458 .module_name = "mt9v022",
459 }, {
460 .bus_id = 0, /* Must match with the camera ID */
461 .board_info = &pcm990_camera_i2c[1],
462 .i2c_adapter_id = 0,
463 .query_bus_param = pcm990_camera_query_bus_param,
464 .set_bus_param = pcm990_camera_set_bus_param,
465 .free_bus = pcm990_camera_free_bus,
466 .module_name = "mt9m001",
467 },
468};
469
470static struct platform_device pcm990_camera[] = {
471 {
472 .name = "soc-camera-pdrv",
473 .id = 0,
474 .dev = {
475 .platform_data = &iclink[0],
476 },
477 }, {
478 .name = "soc-camera-pdrv",
479 .id = 1,
480 .dev = {
481 .platform_data = &iclink[1],
482 },
452 }, 483 },
453}; 484};
454#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ 485#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
@@ -504,6 +535,9 @@ void __init pcm990_baseboard_init(void)
504 pxa_set_camera_info(&pcm990_pxacamera_platform_data); 535 pxa_set_camera_info(&pcm990_pxacamera_platform_data);
505 536
506 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices)); 537 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
538
539 platform_device_register(&pcm990_camera[0]);
540 platform_device_register(&pcm990_camera[1]);
507#endif 541#endif
508 542
509 printk(KERN_INFO "PCM-990 Evaluation baseboard initialized\n"); 543 printk(KERN_INFO "PCM-990 Evaluation baseboard initialized\n");