aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9v022.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>2008-03-24 11:18:36 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:53 -0400
commit26f1b942156766c6ff1a70fb2ac463c6fce31309 (patch)
tree20799de356a6876dabbf1366963f849cb7f2889c /drivers/media/video/mt9v022.c
parent8be38c815e181402c777e033f40971a7be19cf8b (diff)
V4L/DVB (7406): soc-camera: improve separation between soc_camera_ops and soc_camera_device
In case of muliple cameras, handled by the same driver, they can support Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/mt9v022.c')
-rw-r--r--drivers/media/video/mt9v022.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index a2f161dcc72d..d4b9e2744343 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -506,13 +506,15 @@ const struct v4l2_queryctrl mt9v022_controls[] = {
506 } 506 }
507}; 507};
508 508
509static int mt9v022_get_control(struct soc_camera_device *icd, 509static int mt9v022_video_probe(struct soc_camera_device *);
510 struct v4l2_control *ctrl); 510static void mt9v022_video_remove(struct soc_camera_device *);
511static int mt9v022_set_control(struct soc_camera_device *icd, 511static int mt9v022_get_control(struct soc_camera_device *, struct v4l2_control *);
512 struct v4l2_control *ctrl); 512static int mt9v022_set_control(struct soc_camera_device *, struct v4l2_control *);
513 513
514static struct soc_camera_ops mt9v022_ops = { 514static struct soc_camera_ops mt9v022_ops = {
515 .owner = THIS_MODULE, 515 .owner = THIS_MODULE,
516 .probe = mt9v022_video_probe,
517 .remove = mt9v022_video_remove,
516 .init = mt9v022_init, 518 .init = mt9v022_init,
517 .release = mt9v022_release, 519 .release = mt9v022_release,
518 .start_capture = mt9v022_start_capture, 520 .start_capture = mt9v022_start_capture,
@@ -521,8 +523,6 @@ static struct soc_camera_ops mt9v022_ops = {
521 .try_fmt_cap = mt9v022_try_fmt_cap, 523 .try_fmt_cap = mt9v022_try_fmt_cap,
522 .set_bus_param = mt9v022_set_bus_param, 524 .set_bus_param = mt9v022_set_bus_param,
523 .query_bus_param = mt9v022_query_bus_param, 525 .query_bus_param = mt9v022_query_bus_param,
524 .formats = NULL, /* Filled in later depending on the */
525 .num_formats = 0, /* sensor type and data widths */
526 .controls = mt9v022_controls, 526 .controls = mt9v022_controls,
527 .num_controls = ARRAY_SIZE(mt9v022_controls), 527 .num_controls = ARRAY_SIZE(mt9v022_controls),
528 .get_control = mt9v022_get_control, 528 .get_control = mt9v022_get_control,
@@ -705,19 +705,19 @@ static int mt9v022_video_probe(struct soc_camera_device *icd)
705 !strcmp("color", sensor_type))) { 705 !strcmp("color", sensor_type))) {
706 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11); 706 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11);
707 mt9v022->model = V4L2_IDENT_MT9V022IX7ATC; 707 mt9v022->model = V4L2_IDENT_MT9V022IX7ATC;
708 mt9v022_ops.formats = mt9v022_colour_formats; 708 icd->formats = mt9v022_colour_formats;
709 if (mt9v022->client->dev.platform_data) 709 if (mt9v022->client->dev.platform_data)
710 mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_colour_formats); 710 icd->num_formats = ARRAY_SIZE(mt9v022_colour_formats);
711 else 711 else
712 mt9v022_ops.num_formats = 1; 712 icd->num_formats = 1;
713 } else { 713 } else {
714 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11); 714 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11);
715 mt9v022->model = V4L2_IDENT_MT9V022IX7ATM; 715 mt9v022->model = V4L2_IDENT_MT9V022IX7ATM;
716 mt9v022_ops.formats = mt9v022_monochrome_formats; 716 icd->formats = mt9v022_monochrome_formats;
717 if (mt9v022->client->dev.platform_data) 717 if (mt9v022->client->dev.platform_data)
718 mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_monochrome_formats); 718 icd->num_formats = ARRAY_SIZE(mt9v022_monochrome_formats);
719 else 719 else
720 mt9v022_ops.num_formats = 1; 720 icd->num_formats = 1;
721 } 721 }
722 722
723 if (ret >= 0) 723 if (ret >= 0)
@@ -773,8 +773,6 @@ static int mt9v022_probe(struct i2c_client *client)
773 i2c_set_clientdata(client, mt9v022); 773 i2c_set_clientdata(client, mt9v022);
774 774
775 icd = &mt9v022->icd; 775 icd = &mt9v022->icd;
776 icd->probe = mt9v022_video_probe;
777 icd->remove = mt9v022_video_remove;
778 icd->ops = &mt9v022_ops; 776 icd->ops = &mt9v022_ops;
779 icd->control = &client->dev; 777 icd->control = &client->dev;
780 icd->x_min = 1; 778 icd->x_min = 1;