diff options
author | Sooman Jeong <sm5.jeong@samsung.com> | 2017-12-13 22:28:14 +0900 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2018-06-15 21:00:00 +0900 |
commit | b4e7d35bad8e74b6799f4a270cb8186d221820c4 (patch) | |
tree | 9fed02d97822f9a5e7d15b254b445fcf1024a9ed | |
parent | 4953ce5eb87396cd531a60dc87304d5fd7c7cff7 (diff) | |
download | linux-artik7-b4e7d35bad8e74b6799f4a270cb8186d221820c4.tar.gz linux-artik7-b4e7d35bad8e74b6799f4a270cb8186d221820c4.tar.bz2 linux-artik7-b4e7d35bad8e74b6799f4a270cb8186d221820c4.zip |
media: ov5640: add s_power sequence on setting stream
This patch adds s_power call on set stream callback since
the VIP sub-system of s5p4418 or s5p6818 does not have
separate s_power call sequence.
Also, 100ms sleep was added right before enabling stream
to guarantee stabilization time for MIPI CSI to be ready.
This change is a part of customizing ov5640 sensor driver
for the ARTIK modules which use s5p4418 or s5p6868 AP.
Change-Id: I8061ac6e9f4928eafc17687d2ba4f726464de09e
Signed-off-by: Sooman Jeong <sm5.jeong@samsung.com>
-rw-r--r-- | drivers/media/i2c/ov5640.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index aae9164b5143..2ad9410edfe6 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1634,6 +1634,8 @@ static int ov5640_set_power(struct ov5640_dev *sensor, bool on) if (ret) goto power_off; + msleep(100); + return 0; } @@ -2252,6 +2254,12 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&sensor->lock); + if (enable == 1) { + mutex_unlock(&sensor->lock); + ov5640_s_power(&sensor->sd, 1); + mutex_lock(&sensor->lock); + } + if (sensor->streaming == !enable) { if (enable && sensor->pending_mode_change) { ret = ov5640_set_mode(sensor, sensor->current_mode); @@ -2263,6 +2271,12 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable) if (!ret) sensor->streaming = enable; } + + if (enable == 0) { + mutex_unlock(&sensor->lock); + ov5640_s_power(&sensor->sd, 0); + mutex_lock(&sensor->lock); + } out: mutex_unlock(&sensor->lock); return ret; |