summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Miguel Silva <rui.silva@linaro.org>2018-02-20 23:48:12 +0000
committerRui Miguel Silva <rui.silva@linaro.org>2018-08-12 16:49:37 +0100
commit47d92ab6aecefb28019e9f6c5458b325cadf2eac (patch)
treed4297794d6b2195b64cde59bca0e077c2481cbcd
parent811dd3e95a3e3a6691442bc9cab464a39bdd9be2 (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.c3
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)