summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/soc_camera/ov9640.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/soc_camera/ov9640.c')
-rw-r--r--drivers/media/i2c/soc_camera/ov9640.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c
index 53156ef1ec0c..b323684eaf77 100644
--- a/drivers/media/i2c/soc_camera/ov9640.c
+++ b/drivers/media/i2c/soc_camera/ov9640.c
@@ -592,7 +592,11 @@ static int ov9640_video_probe(struct i2c_client *client)
struct ov9640_priv *priv = to_ov9640_sensor(sd);
u8 pid, ver, midh, midl;
const char *devname;
- int ret = 0;
+ int ret;
+
+ ret = ov9640_s_power(&priv->subdev, 1);
+ if (ret < 0)
+ return ret;
/*
* check and show product ID and manufacturer ID
@@ -606,7 +610,7 @@ static int ov9640_video_probe(struct i2c_client *client)
if (!ret)
ret = ov9640_reg_read(client, OV9640_MIDL, &midl);
if (ret)
- return ret;
+ goto done;
switch (VERSION(pid, ver)) {
case OV9640_V2:
@@ -621,13 +625,18 @@ static int ov9640_video_probe(struct i2c_client *client)
break;
default:
dev_err(&client->dev, "Product ID error %x:%x\n", pid, ver);
- return -ENODEV;
+ ret = -ENODEV;
+ goto done;
}
dev_info(&client->dev, "%s Product ID %0x:%0x Manufacturer ID %x:%x\n",
devname, pid, ver, midh, midl);
- return v4l2_ctrl_handler_setup(&priv->hdl);
+ ret = v4l2_ctrl_handler_setup(&priv->hdl);
+
+done:
+ ov9640_s_power(&priv->subdev, 0);
+ return ret;
}
static const struct v4l2_ctrl_ops ov9640_ctrl_ops = {