From 7727cd7e554fb6e6496e7f4bfa13e89d0fe56757 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Thu, 30 May 2019 09:12:55 -0700 Subject: driver: ov5693: don't update control range Don't update exposure control range after changing frame rate. This will limit the manaul exposure control for tuning tools. Bug 200497783 Change-Id: Ia83f70368460b981c60ad9b0541e538c0c24e7fa Signed-off-by: Frank Chen Reviewed-on: https://git-master.nvidia.com/r/2127940 Reviewed-by: Joshua Widen Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ian Kaszubski Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/media/i2c/ov5693.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 96cc9063e..5af906774 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -84,9 +84,6 @@ static struct regmap_config ov5693_regmap_config = { .val_bits = 8, }; -static void ov5693_update_ctrl_range(struct camera_common_data *s_data, - s32 frame_length); - static inline void ov5693_get_frame_length_regs(ov5693_reg *regs, u32 frame_length) { @@ -473,42 +470,6 @@ fail: return err; } -static void ov5693_update_ctrl_range(struct camera_common_data *s_data, - s32 frame_length) -{ - struct device *dev = s_data->dev; - struct v4l2_ctrl *ctrl = NULL; - int ctrl_ids[2] = {TEGRA_CAMERA_CID_EXPOSURE, - TEGRA_CAMERA_CID_EXPOSURE_SHORT}; - s32 max, min, def; - int i, j; - - for (i = 0; i < ARRAY_SIZE(ctrl_ids); i++) { - for (j = 0; j < s_data->numctrls; j++) { - if (s_data->ctrls[j]->id == ctrl_ids[i]) { - ctrl = s_data->ctrls[j]; - break; - } - } - - if (j == s_data->numctrls) { - dev_err(dev, "could not find ctrl %x\n", ctrl_ids[i]); - continue; - } - - max = frame_length - OV5693_MAX_COARSE_DIFF; - /* clamp the value in case above is negative */ - max = clamp_val(max, OV5693_MIN_EXPOSURE_COARSE, - OV5693_MAX_EXPOSURE_COARSE); - min = OV5693_MIN_EXPOSURE_COARSE; - def = clamp_val(OV5693_DEFAULT_EXPOSURE_COARSE, min, max); - if (__v4l2_ctrl_modify_range(ctrl, min, max, 1, def)) - dev_err(dev, "ctrl %x: range update failed\n", - ctrl_ids[i]); - } - -} - static int ov5693_set_frame_rate(struct tegracam_device *tc_dev, s64 val) { struct camera_common_data *s_data = tc_dev->s_data; @@ -540,7 +501,6 @@ static int ov5693_set_frame_rate(struct tegracam_device *tc_dev, s64 val) priv->frame_length = frame_length; - ov5693_update_ctrl_range(s_data, val); return 0; fail: @@ -965,8 +925,6 @@ static int ov5693_stop_streaming(struct tegracam_device *tc_dev) u32 frame_time; int err; - ov5693_update_ctrl_range(s_data, OV5693_MAX_FRAME_LENGTH); - mutex_lock(&priv->streaming_lock); err = ov5693_write_table(priv, mode_table[OV5693_MODE_STOP_STREAM]); -- cgit v1.2.2