Commit 5724c6ad authored by Hugues Fruchet's avatar Hugues Fruchet Committed by Greg Kroah-Hartman

media: ov5640: fix wrong binning value in exposure calculation

commit c2c3f42d upstream.

ov5640_set_mode_exposure_calc() is checking binning value but
binning value read is buggy, fix this.
Rename ov5640_binning_on() to ov5640_get_binning() as per other
similar functions.
Signed-off-by: default avatarHugues Fruchet <hugues.fruchet@st.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 644fefe4
...@@ -1384,7 +1384,7 @@ static int ov5640_set_ae_target(struct ov5640_dev *sensor, int target) ...@@ -1384,7 +1384,7 @@ static int ov5640_set_ae_target(struct ov5640_dev *sensor, int target)
return ov5640_write_reg(sensor, OV5640_REG_AEC_CTRL1F, fast_low); return ov5640_write_reg(sensor, OV5640_REG_AEC_CTRL1F, fast_low);
} }
static int ov5640_binning_on(struct ov5640_dev *sensor) static int ov5640_get_binning(struct ov5640_dev *sensor)
{ {
u8 temp; u8 temp;
int ret; int ret;
...@@ -1392,8 +1392,8 @@ static int ov5640_binning_on(struct ov5640_dev *sensor) ...@@ -1392,8 +1392,8 @@ static int ov5640_binning_on(struct ov5640_dev *sensor)
ret = ov5640_read_reg(sensor, OV5640_REG_TIMING_TC_REG21, &temp); ret = ov5640_read_reg(sensor, OV5640_REG_TIMING_TC_REG21, &temp);
if (ret) if (ret)
return ret; return ret;
temp &= 0xfe;
return temp ? 1 : 0; return temp & BIT(0);
} }
static int ov5640_set_binning(struct ov5640_dev *sensor, bool enable) static int ov5640_set_binning(struct ov5640_dev *sensor, bool enable)
...@@ -1479,7 +1479,7 @@ static int ov5640_set_mode_exposure_calc(struct ov5640_dev *sensor, ...@@ -1479,7 +1479,7 @@ static int ov5640_set_mode_exposure_calc(struct ov5640_dev *sensor,
if (ret < 0) if (ret < 0)
return ret; return ret;
prev_shutter = ret; prev_shutter = ret;
ret = ov5640_binning_on(sensor); ret = ov5640_get_binning(sensor);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ret && mode->id != OV5640_MODE_720P_1280_720 && if (ret && mode->id != OV5640_MODE_720P_1280_720 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment