diff options
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/setup.c | 38 | ||||
-rw-r--r-- | arch/sh/boards/mach-migor/setup.c | 32 | ||||
-rw-r--r-- | drivers/media/video/ov772x.c | 4 | ||||
-rw-r--r-- | drivers/media/video/tw9910.c | 6 | ||||
-rw-r--r-- | include/media/ov772x.h | 1 | ||||
-rw-r--r-- | include/media/soc_camera_platform.h | 1 | ||||
-rw-r--r-- | include/media/tw9910.h | 1 |
7 files changed, 44 insertions, 39 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 | }; |
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 9099b6da9957..507c77be476d 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -432,23 +432,27 @@ static struct i2c_board_info migor_i2c_camera[] = { | |||
432 | 432 | ||
433 | static struct ov772x_camera_info ov7725_info = { | 433 | static struct ov772x_camera_info ov7725_info = { |
434 | .buswidth = SOCAM_DATAWIDTH_8, | 434 | .buswidth = SOCAM_DATAWIDTH_8, |
435 | .link = { | 435 | }; |
436 | .power = ov7725_power, | 436 | |
437 | .board_info = &migor_i2c_camera[0], | 437 | static struct soc_camera_link ov7725_link = { |
438 | .i2c_adapter_id = 0, | 438 | .power = ov7725_power, |
439 | .module_name = "ov772x", | 439 | .board_info = &migor_i2c_camera[0], |
440 | }, | 440 | .i2c_adapter_id = 0, |
441 | .module_name = "ov772x", | ||
442 | .priv = &ov7725_info, | ||
441 | }; | 443 | }; |
442 | 444 | ||
443 | static struct tw9910_video_info tw9910_info = { | 445 | static struct tw9910_video_info tw9910_info = { |
444 | .buswidth = SOCAM_DATAWIDTH_8, | 446 | .buswidth = SOCAM_DATAWIDTH_8, |
445 | .mpout = TW9910_MPO_FIELD, | 447 | .mpout = TW9910_MPO_FIELD, |
446 | .link = { | 448 | }; |
447 | .power = tw9910_power, | 449 | |
448 | .board_info = &migor_i2c_camera[1], | 450 | static struct soc_camera_link tw9910_link = { |
449 | .i2c_adapter_id = 0, | 451 | .power = tw9910_power, |
450 | .module_name = "tw9910", | 452 | .board_info = &migor_i2c_camera[1], |
451 | } | 453 | .i2c_adapter_id = 0, |
454 | .module_name = "tw9910", | ||
455 | .priv = &tw9910_info, | ||
452 | }; | 456 | }; |
453 | 457 | ||
454 | static struct platform_device migor_camera[] = { | 458 | static struct platform_device migor_camera[] = { |
@@ -456,13 +460,13 @@ static struct platform_device migor_camera[] = { | |||
456 | .name = "soc-camera-pdrv", | 460 | .name = "soc-camera-pdrv", |
457 | .id = 0, | 461 | .id = 0, |
458 | .dev = { | 462 | .dev = { |
459 | .platform_data = &ov7725_info.link, | 463 | .platform_data = &ov7725_link, |
460 | }, | 464 | }, |
461 | }, { | 465 | }, { |
462 | .name = "soc-camera-pdrv", | 466 | .name = "soc-camera-pdrv", |
463 | .id = 1, | 467 | .id = 1, |
464 | .dev = { | 468 | .dev = { |
465 | .platform_data = &tw9910_info.link, | 469 | .platform_data = &tw9910_link, |
466 | }, | 470 | }, |
467 | }, | 471 | }, |
468 | }; | 472 | }; |
diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index 205229333466..dcb690cb5ae7 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c | |||
@@ -1143,10 +1143,10 @@ static int ov772x_probe(struct i2c_client *client, | |||
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | icl = to_soc_camera_link(icd); | 1145 | icl = to_soc_camera_link(icd); |
1146 | if (!icl) | 1146 | if (!icl || !icl->priv) |
1147 | return -EINVAL; | 1147 | return -EINVAL; |
1148 | 1148 | ||
1149 | info = container_of(icl, struct ov772x_camera_info, link); | 1149 | info = icl->priv; |
1150 | 1150 | ||
1151 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { | 1151 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { |
1152 | dev_err(&adapter->dev, | 1152 | dev_err(&adapter->dev, |
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index 3cb9ba6caa41..35373d8bf6a0 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c | |||
@@ -955,10 +955,10 @@ static int tw9910_probe(struct i2c_client *client, | |||
955 | } | 955 | } |
956 | 956 | ||
957 | icl = to_soc_camera_link(icd); | 957 | icl = to_soc_camera_link(icd); |
958 | if (!icl) | 958 | if (!icl || !icl->priv) |
959 | return -EINVAL; | 959 | return -EINVAL; |
960 | 960 | ||
961 | info = container_of(icl, struct tw9910_video_info, link); | 961 | info = icl->priv; |
962 | 962 | ||
963 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { | 963 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { |
964 | dev_err(&client->dev, | 964 | dev_err(&client->dev, |
@@ -976,7 +976,7 @@ static int tw9910_probe(struct i2c_client *client, | |||
976 | v4l2_i2c_subdev_init(&priv->subdev, client, &tw9910_subdev_ops); | 976 | v4l2_i2c_subdev_init(&priv->subdev, client, &tw9910_subdev_ops); |
977 | 977 | ||
978 | icd->ops = &tw9910_ops; | 978 | icd->ops = &tw9910_ops; |
979 | icd->iface = info->link.bus_id; | 979 | icd->iface = icl->bus_id; |
980 | 980 | ||
981 | ret = tw9910_video_probe(icd, client); | 981 | ret = tw9910_video_probe(icd, client); |
982 | if (ret) { | 982 | if (ret) { |
diff --git a/include/media/ov772x.h b/include/media/ov772x.h index 37bcd096dded..14c77efd6a85 100644 --- a/include/media/ov772x.h +++ b/include/media/ov772x.h | |||
@@ -55,7 +55,6 @@ struct ov772x_edge_ctrl { | |||
55 | struct ov772x_camera_info { | 55 | struct ov772x_camera_info { |
56 | unsigned long buswidth; | 56 | unsigned long buswidth; |
57 | unsigned long flags; | 57 | unsigned long flags; |
58 | struct soc_camera_link link; | ||
59 | struct ov772x_edge_ctrl edgectrl; | 58 | struct ov772x_edge_ctrl edgectrl; |
60 | }; | 59 | }; |
61 | 60 | ||
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index bb70401b8141..88b3b5747f62 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -23,7 +23,6 @@ struct soc_camera_platform_info { | |||
23 | unsigned long bus_param; | 23 | unsigned long bus_param; |
24 | struct device *dev; | 24 | struct device *dev; |
25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
26 | struct soc_camera_link link; | ||
27 | }; | 26 | }; |
28 | 27 | ||
29 | #endif /* __SOC_CAMERA_H__ */ | 28 | #endif /* __SOC_CAMERA_H__ */ |
diff --git a/include/media/tw9910.h b/include/media/tw9910.h index 73231e7880d8..5e2895a05e6b 100644 --- a/include/media/tw9910.h +++ b/include/media/tw9910.h | |||
@@ -32,7 +32,6 @@ enum tw9910_mpout_pin { | |||
32 | struct tw9910_video_info { | 32 | struct tw9910_video_info { |
33 | unsigned long buswidth; | 33 | unsigned long buswidth; |
34 | enum tw9910_mpout_pin mpout; | 34 | enum tw9910_mpout_pin mpout; |
35 | struct soc_camera_link link; | ||
36 | }; | 35 | }; |
37 | 36 | ||
38 | 37 | ||