diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2018-02-20 23:38:24 +0000 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2019-05-01 11:51:26 +0100 |
commit | 172d0ecdaf3d909dcdec8ed2db41913ceef3a883 (patch) | |
tree | efa0ce416803b45b784b7450f563cd2fdff79c1e | |
parent | 6c21bfbaf42d4f960a983e9d83777bbe72aa014c (diff) |
media: ov2680: remove stable delay and set LP-11 instead
Big delay was introduced to skip initial frames, that looks unnecessary and
overkill time wise. Instead when setting power up start for a few milliseconds
streaming which will set the clock lane into LP-11 mode.
Also need to move the stream_{enable/disable} to avoid forward declarations.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
-rw-r--r-- | drivers/media/i2c/ov2680.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index 03ee5b5c34ea..f1bae753eb11 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -498,6 +498,16 @@ static int ov2680_auto_exposure_disable(struct ov2680_dev *sensor) return ov2680_exposure_set(sensor, false); } +static int ov2680_stream_enable(struct ov2680_dev *sensor) +{ + return ov2680_write_reg(sensor, OV2680_REG_STREAM_CTRL, 1); +} + +static int ov2680_stream_disable(struct ov2680_dev *sensor) +{ + return ov2680_write_reg(sensor, OV2680_REG_STREAM_CTRL, 0); +} + static int ov2680_mode_set_direct(struct ov2680_dev *sensor) { int ret; @@ -514,7 +524,6 @@ static int ov2680_mode_set_direct(struct ov2680_dev *sensor) static int ov2680_mode_set(struct ov2680_dev *sensor) { - u32 wait4stable_ms; int ret; ret = ov2680_auto_gain_disable(sensor); @@ -537,12 +546,6 @@ static int ov2680_mode_set(struct ov2680_dev *sensor) if (ret < 0) return ret; - if (sensor->current_mode->id == OV2680_MODE_UXGA_1600_1200) - wait4stable_ms = 267; - else - wait4stable_ms = 600; - - msleep(wait4stable_ms); return 0; } @@ -589,6 +592,12 @@ static int ov2680_enable(struct ov2680_dev *sensor) goto disable; sensor->is_enabled = true; + + /* Set clock lane into LP-11 state */ + ov2680_stream_enable(sensor); + usleep_range(1000, 2000); + ov2680_stream_disable(sensor); + return 0; disable: @@ -621,16 +630,6 @@ static int ov2680_s_power(struct v4l2_subdev *sd, int on) return ret; } -static int ov2680_stream_enable(struct ov2680_dev *sensor) -{ - return ov2680_write_reg(sensor, OV2680_REG_STREAM_CTRL, 1); -} - -static int ov2680_stream_disable(struct ov2680_dev *sensor) -{ - return ov2680_write_reg(sensor, OV2680_REG_STREAM_CTRL, 0); -} - static int ov2680_g_frame_interval(struct v4l2_subdev *sd, struct v4l2_subdev_frame_interval *fi) { |