diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-03-24 16:18:36 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 19:07:53 +0200 |
commit | 26f1b942156766c6ff1a70fb2ac463c6fce31309 (patch) | |
tree | 20799de356a6876dabbf1366963f849cb7f2889c /drivers/media/video/mt9m001.c | |
parent | V4L/DVB (7404): saa7134.h: Remove unnecessary validation (diff) | |
download | linux-26f1b942156766c6ff1a70fb2ac463c6fce31309.tar.xz linux-26f1b942156766c6ff1a70fb2ac463c6fce31309.zip |
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.c | 24 |
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[] = { } }; -static int mt9m001_get_control(struct soc_camera_device *icd, struct v4l2_control *ctrl); -static int mt9m001_set_control(struct soc_camera_device *icd, struct v4l2_control *ctrl); +static int mt9m001_video_probe(struct soc_camera_device *); +static void mt9m001_video_remove(struct soc_camera_device *); +static int mt9m001_get_control(struct soc_camera_device *, struct v4l2_control *); +static int mt9m001_set_control(struct soc_camera_device *, struct v4l2_control *); static struct soc_camera_ops mt9m001_ops = { .owner = THIS_MODULE, + .probe = mt9m001_video_probe, + .remove = mt9m001_video_remove, .init = mt9m001_init, .release = mt9m001_release, .start_capture = mt9m001_start_capture, @@ -423,8 +427,6 @@ static struct soc_camera_ops mt9m001_ops = { .try_fmt_cap = mt9m001_try_fmt_cap, .set_bus_param = mt9m001_set_bus_param, .query_bus_param = mt9m001_query_bus_param, - .formats = NULL, /* Filled in later depending on the */ - .num_formats = 0, /* camera type and data widths */ .controls = mt9m001_controls, .num_controls = ARRAY_SIZE(mt9m001_controls), .get_control = mt9m001_get_control, @@ -573,19 +575,19 @@ static int mt9m001_video_probe(struct soc_camera_device *icd) case 0x8411: case 0x8421: mt9m001->model = V4L2_IDENT_MT9M001C12ST; - mt9m001_ops.formats = mt9m001_colour_formats; + icd->formats = mt9m001_colour_formats; if (mt9m001->client->dev.platform_data) - mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_colour_formats); + icd->num_formats = ARRAY_SIZE(mt9m001_colour_formats); else - mt9m001_ops.num_formats = 1; + icd->num_formats = 1; break; case 0x8431: mt9m001->model = V4L2_IDENT_MT9M001C12STM; - mt9m001_ops.formats = mt9m001_monochrome_formats; + icd->formats = mt9m001_monochrome_formats; if (mt9m001->client->dev.platform_data) - mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_monochrome_formats); + icd->num_formats = ARRAY_SIZE(mt9m001_monochrome_formats); else - mt9m001_ops.num_formats = 1; + icd->num_formats = 1; break; default: ret = -ENODEV; @@ -646,8 +648,6 @@ static int mt9m001_probe(struct i2c_client *client) /* Second stage probe - when a capture adapter is there */ icd = &mt9m001->icd; - icd->probe = mt9m001_video_probe; - icd->remove = mt9m001_video_remove; icd->ops = &mt9m001_ops; icd->control = &client->dev; icd->x_min = 20; |