diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-19 18:21:49 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-20 14:51:29 +0200 |
commit | eda1310b4087d6793c3e02c425e2292941f24631 (patch) | |
tree | f5ad5e893d5454ca1b1d58c2ad966ce082c0651a | |
parent | media: atomisp: simplify ov2680 array write logic (diff) | |
download | linux-eda1310b4087d6793c3e02c425e2292941f24631.tar.xz linux-eda1310b4087d6793c3e02c425e2292941f24631.zip |
media: atomisp: turn on camera before setting it
Camera cannot be set on power off mode.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 1cb55acf19e1..334f23f35d4a 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -698,10 +698,13 @@ static int power_ctrl(struct v4l2_subdev *sd, bool flag) { int ret = 0; struct ov2680_device *dev = to_ov2680_sensor(sd); + struct i2c_client *client = v4l2_get_subdevdata(sd); if (!dev || !dev->platform_data) return -ENODEV; + dev_dbg(&client->dev, "%s: %s", __func__, flag? "on" : "off"); + if (flag) { ret |= dev->platform_data->v1p8_ctrl(sd, 1); ret |= dev->platform_data->v2p8_ctrl(sd, 1); @@ -959,6 +962,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd, dev_dbg(&client->dev, "%s: i=%d, w=%d, h=%d\n", __func__, dev->fmt_idx, fmt->width, fmt->height); + // IS IT NEEDED? + power_up(sd); ret = ov2680_write_reg_array(client, ov2680_res[dev->fmt_idx].regs); if (ret) dev_err(&client->dev, |