diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-12-11 09:31:35 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-16 06:27:19 -0500 |
commit | 0f4482940a75b52db931e1fff181c9d267e462d2 (patch) | |
tree | f1b354771394b99aaecbbf56e1c3d82b522b50a4 /arch/sh/boards/mach-ap325rxa/setup.c | |
parent | 3fd7ceffddd52c2f8c004a7999ccb705d592cbfd (diff) |
V4L/DVB (13650): soc-camera: switch drivers and platforms to use .priv in struct soc_camera_link
After this change drivers can be further extended to not fail, if they don't
get platform data, but to use defaults.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch/sh/boards/mach-ap325rxa/setup.c')
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/setup.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index cf9dc12dfeb1..4c8602884573 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -324,12 +324,14 @@ static struct soc_camera_platform_info camera_info = { | |||
324 | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | | 324 | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | |
325 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, | 325 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, |
326 | .set_capture = camera_set_capture, | 326 | .set_capture = camera_set_capture, |
327 | .link = { | 327 | }; |
328 | .bus_id = 0, | 328 | |
329 | .add_device = ap325rxa_camera_add, | 329 | struct soc_camera_link camera_link = { |
330 | .del_device = ap325rxa_camera_del, | 330 | .bus_id = 0, |
331 | .module_name = "soc_camera_platform", | 331 | .add_device = ap325rxa_camera_add, |
332 | }, | 332 | .del_device = ap325rxa_camera_del, |
333 | .module_name = "soc_camera_platform", | ||
334 | .priv = &camera_info, | ||
333 | }; | 335 | }; |
334 | 336 | ||
335 | static void dummy_release(struct device *dev) | 337 | static void dummy_release(struct device *dev) |
@@ -347,7 +349,7 @@ static struct platform_device camera_device = { | |||
347 | static int ap325rxa_camera_add(struct soc_camera_link *icl, | 349 | static int ap325rxa_camera_add(struct soc_camera_link *icl, |
348 | struct device *dev) | 350 | struct device *dev) |
349 | { | 351 | { |
350 | if (icl != &camera_info.link || camera_probe() <= 0) | 352 | if (icl != &camera_link || camera_probe() <= 0) |
351 | return -ENODEV; | 353 | return -ENODEV; |
352 | 354 | ||
353 | camera_info.dev = dev; | 355 | camera_info.dev = dev; |
@@ -357,7 +359,7 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl, | |||
357 | 359 | ||
358 | static void ap325rxa_camera_del(struct soc_camera_link *icl) | 360 | static void ap325rxa_camera_del(struct soc_camera_link *icl) |
359 | { | 361 | { |
360 | if (icl != &camera_info.link) | 362 | if (icl != &camera_link) |
361 | return; | 363 | return; |
362 | 364 | ||
363 | platform_device_unregister(&camera_device); | 365 | platform_device_unregister(&camera_device); |
@@ -470,13 +472,15 @@ static struct ov772x_camera_info ov7725_info = { | |||
470 | .buswidth = SOCAM_DATAWIDTH_8, | 472 | .buswidth = SOCAM_DATAWIDTH_8, |
471 | .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, | 473 | .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, |
472 | .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), | 474 | .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), |
473 | .link = { | 475 | }; |
474 | .bus_id = 0, | 476 | |
475 | .power = ov7725_power, | 477 | static struct soc_camera_link ov7725_link = { |
476 | .board_info = &ap325rxa_i2c_camera[0], | 478 | .bus_id = 0, |
477 | .i2c_adapter_id = 0, | 479 | .power = ov7725_power, |
478 | .module_name = "ov772x", | 480 | .board_info = &ap325rxa_i2c_camera[0], |
479 | }, | 481 | .i2c_adapter_id = 0, |
482 | .module_name = "ov772x", | ||
483 | .priv = &ov7725_info, | ||
480 | }; | 484 | }; |
481 | 485 | ||
482 | static struct platform_device ap325rxa_camera[] = { | 486 | static struct platform_device ap325rxa_camera[] = { |
@@ -484,13 +488,13 @@ static struct platform_device ap325rxa_camera[] = { | |||
484 | .name = "soc-camera-pdrv", | 488 | .name = "soc-camera-pdrv", |
485 | .id = 0, | 489 | .id = 0, |
486 | .dev = { | 490 | .dev = { |
487 | .platform_data = &ov7725_info.link, | 491 | .platform_data = &ov7725_link, |
488 | }, | 492 | }, |
489 | }, { | 493 | }, { |
490 | .name = "soc-camera-pdrv", | 494 | .name = "soc-camera-pdrv", |
491 | .id = 1, | 495 | .id = 1, |
492 | .dev = { | 496 | .dev = { |
493 | .platform_data = &camera_info.link, | 497 | .platform_data = &camera_link, |
494 | }, | 498 | }, |
495 | }, | 499 | }, |
496 | }; | 500 | }; |