aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9m001.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/mt9m001.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/mt9m001.c')
-rw-r--r--drivers/media/video/mt9m001.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index acb5454b57eb..2ea133e8a625 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -410,11 +410,15 @@ const struct v4l2_queryctrl mt9m001_controls[] = {
410 } 410 }
411}; 411};
412 412
413static int mt9m001_get_control(struct soc_camera_device *icd, struct v4l2_control *ctrl); 413static int mt9m001_video_probe(struct soc_camera_device *);
414static int mt9m001_set_control(struct soc_camera_device *icd, struct v4l2_control *ctrl); 414static void mt9m001_video_remove(struct soc_camera_device *);
415static int mt9m001_get_control(struct soc_camera_device *, struct v4l2_control *);
416static int mt9m001_set_control(struct soc_camera_device *, struct v4l2_control *);
415 417
416static struct soc_camera_ops mt9m001_ops = { 418static struct soc_camera_ops mt9m001_ops = {
417 .owner = THIS_MODULE, 419 .owner = THIS_MODULE,
420 .probe = mt9m001_video_probe,
421 .remove = mt9m001_video_remove,
418 .init = mt9m001_init, 422 .init = mt9m001_init,
419 .release = mt9m001_release, 423 .release = mt9m001_release,
420 .start_capture = mt9m001_start_capture, 424 .start_capture = mt9m001_start_capture,
@@ -423,8 +427,6 @@ static struct soc_camera_ops mt9m001_ops = {
423 .try_fmt_cap = mt9m001_try_fmt_cap, 427 .try_fmt_cap = mt9m001_try_fmt_cap,
424 .set_bus_param = mt9m001_set_bus_param, 428 .set_bus_param = mt9m001_set_bus_param,
425 .query_bus_param = mt9m001_query_bus_param, 429 .query_bus_param = mt9m001_query_bus_param,
426 .formats = NULL, /* Filled in later depending on the */
427 .num_formats = 0, /* camera type and data widths */
428 .controls = mt9m001_controls, 430 .controls = mt9m001_controls,
429 .num_controls = ARRAY_SIZE(mt9m001_controls), 431 .num_controls = ARRAY_SIZE(mt9m001_controls),
430 .get_control = mt9m001_get_control, 432 .get_control = mt9m001_get_control,
@@ -573,19 +575,19 @@ static int mt9m001_video_probe(struct soc_camera_device *icd)
573 case 0x8411: 575 case 0x8411:
574 case 0x8421: 576 case 0x8421:
575 mt9m001->model = V4L2_IDENT_MT9M001C12ST; 577 mt9m001->model = V4L2_IDENT_MT9M001C12ST;
576 mt9m001_ops.formats = mt9m001_colour_formats; 578 icd->formats = mt9m001_colour_formats;
577 if (mt9m001->client->dev.platform_data) 579 if (mt9m001->client->dev.platform_data)
578 mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_colour_formats); 580 icd->num_formats = ARRAY_SIZE(mt9m001_colour_formats);
579 else 581 else
580 mt9m001_ops.num_formats = 1; 582 icd->num_formats = 1;
581 break; 583 break;
582 case 0x8431: 584 case 0x8431:
583 mt9m001->model = V4L2_IDENT_MT9M001C12STM; 585 mt9m001->model = V4L2_IDENT_MT9M001C12STM;
584 mt9m001_ops.formats = mt9m001_monochrome_formats; 586 icd->formats = mt9m001_monochrome_formats;
585 if (mt9m001->client->dev.platform_data) 587 if (mt9m001->client->dev.platform_data)
586 mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_monochrome_formats); 588 icd->num_formats = ARRAY_SIZE(mt9m001_monochrome_formats);
587 else 589 else
588 mt9m001_ops.num_formats = 1; 590 icd->num_formats = 1;
589 break; 591 break;
590 default: 592 default:
591 ret = -ENODEV; 593 ret = -ENODEV;
@@ -646,8 +648,6 @@ static int mt9m001_probe(struct i2c_client *client)
646 648
647 /* Second stage probe - when a capture adapter is there */ 649 /* Second stage probe - when a capture adapter is there */
648 icd = &mt9m001->icd; 650 icd = &mt9m001->icd;
649 icd->probe = mt9m001_video_probe;
650 icd->remove = mt9m001_video_remove;
651 icd->ops = &mt9m001_ops; 651 icd->ops = &mt9m001_ops;
652 icd->control = &client->dev; 652 icd->control = &client->dev;
653 icd->x_min = 20; 653 icd->x_min = 20;