diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2018-02-20 23:48:12 +0000 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2019-05-01 11:51:28 +0100 |
commit | 8eb9b9e4c04bbc48dc84687aac49c457201ab166 (patch) | |
tree | 9281dc49d5d3918689daa00c67edf334ab5846a1 | |
parent | b0e2d96813c7fe9b849912e7ffa06152a9ee8c5d (diff) |
media: ov2680: do not try to read control values if disable
Control values can only be read if the sensor is power up, if not the i2c
reading will fail. So, make sure that only in enable status control get be
fetched.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
-rw-r--r-- | drivers/media/i2c/ov2680.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index 5de332e5d87d..faaf8b10632f 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -831,6 +831,9 @@ static int ov2680_g_volatile_ctrl(struct v4l2_ctrl *ctrl) struct ov2680_dev *sensor = to_ov2680_dev(sd); int val; + if (!sensor->is_enabled) + return 0; + switch (ctrl->id) { case V4L2_CID_AUTOGAIN: if (!ctrl->val) |