aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9m001.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mt9m001.c')
-rw-r--r--drivers/media/video/mt9m001.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index e8cf56189ef1..4b394798a293 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -122,9 +122,8 @@ static int reg_clear(struct i2c_client *client, const u8 reg,
122 return reg_write(client, reg, ret & ~data); 122 return reg_write(client, reg, ret & ~data);
123} 123}
124 124
125static int mt9m001_init(struct soc_camera_device *icd) 125static int mt9m001_init(struct i2c_client *client)
126{ 126{
127 struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
128 int ret; 127 int ret;
129 128
130 dev_dbg(&client->dev, "%s\n", __func__); 129 dev_dbg(&client->dev, "%s\n", __func__);
@@ -144,16 +143,6 @@ static int mt9m001_init(struct soc_camera_device *icd)
144 return ret; 143 return ret;
145} 144}
146 145
147static int mt9m001_release(struct soc_camera_device *icd)
148{
149 struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
150
151 /* Disable the chip */
152 reg_write(client, MT9M001_OUTPUT_CONTROL, 0);
153
154 return 0;
155}
156
157static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) 146static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable)
158{ 147{
159 struct i2c_client *client = sd->priv; 148 struct i2c_client *client = sd->priv;
@@ -446,8 +435,6 @@ static const struct v4l2_queryctrl mt9m001_controls[] = {
446}; 435};
447 436
448static struct soc_camera_ops mt9m001_ops = { 437static struct soc_camera_ops mt9m001_ops = {
449 .init = mt9m001_init,
450 .release = mt9m001_release,
451 .set_bus_param = mt9m001_set_bus_param, 438 .set_bus_param = mt9m001_set_bus_param,
452 .query_bus_param = mt9m001_query_bus_param, 439 .query_bus_param = mt9m001_query_bus_param,
453 .controls = mt9m001_controls, 440 .controls = mt9m001_controls,
@@ -581,6 +568,7 @@ static int mt9m001_video_probe(struct soc_camera_device *icd,
581 struct soc_camera_link *icl = to_soc_camera_link(icd); 568 struct soc_camera_link *icl = to_soc_camera_link(icd);
582 s32 data; 569 s32 data;
583 unsigned long flags; 570 unsigned long flags;
571 int ret;
584 572
585 /* We must have a parent by now. And it cannot be a wrong one. 573 /* We must have a parent by now. And it cannot be a wrong one.
586 * So this entire test is completely redundant. */ 574 * So this entire test is completely redundant. */
@@ -637,7 +625,11 @@ static int mt9m001_video_probe(struct soc_camera_device *icd,
637 dev_info(&client->dev, "Detected a MT9M001 chip ID %x (%s)\n", data, 625 dev_info(&client->dev, "Detected a MT9M001 chip ID %x (%s)\n", data,
638 data == 0x8431 ? "C12STM" : "C12ST"); 626 data == 0x8431 ? "C12STM" : "C12ST");
639 627
640 return 0; 628 ret = mt9m001_init(client);
629 if (ret < 0)
630 dev_err(&client->dev, "Failed to initialise the camera\n");
631
632 return ret;
641} 633}
642 634
643static void mt9m001_video_remove(struct soc_camera_device *icd) 635static void mt9m001_video_remove(struct soc_camera_device *icd)