media: ov5640: fix auto controls values when switching to manual mode
authorHugues Fruchet <hugues.fruchet@st.com>
Tue, 11 Sep 2018 13:48:20 +0000 (09:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:42:27 +0000 (19:42 +0200)
[ Upstream commit a8f438c684eaa4cbe6c98828eb996d5ec53e24fb ]

When switching from auto to manual mode, V4L2 core is calling
g_volatile_ctrl() in manual mode in order to get the manual initial value.
Remove the manual mode check/return to not break this behaviour.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/media/i2c/ov5640.c

index 0366c8dc6ecf7a31d1fc345d743160034d64fffd..acf5c8a55bbd2dbe7f29bda15e522152aa9a356c 100644 (file)
@@ -1900,16 +1900,12 @@ static int ov5640_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
 
        switch (ctrl->id) {
        case V4L2_CID_AUTOGAIN:
-               if (!ctrl->val)
-                       return 0;
                val = ov5640_get_gain(sensor);
                if (val < 0)
                        return val;
                sensor->ctrls.gain->val = val;
                break;
        case V4L2_CID_EXPOSURE_AUTO:
-               if (ctrl->val == V4L2_EXPOSURE_MANUAL)
-                       return 0;
                val = ov5640_get_exposure(sensor);
                if (val < 0)
                        return val;