summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vivid
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2018-06-29 12:40:41 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-04 15:18:33 +0300
commit83a729530a3a8a40dd529c72e4c3fe491d9bce68 (patch)
tree548cb2ae330084a703bce664ea9213aa3379aa35 /drivers/media/platform/vivid
parent9f84310d88304bb2f2b154ba740ecc3a6326c175 (diff)
downloadlinux-83a729530a3a8a40dd529c72e4c3fe491d9bce68.tar.xz
media: vivid: fix gain when autogain is on
In the vivid driver you want gain to continuous change while autogain is on. However, dev->jiffies_vid_cap doesn't actually change. It probably did in the past, but changes in the code caused this to be a fixed value that is only set when you start streaming. Replace it by jiffies, which is always changing. [mchehab@kernel.org: use jiffies_to_msecs() instead of dividing by HZ] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vivid')
-rw-r--r--drivers/media/platform/vivid/vivid-ctrls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c
index 6b0bfa091592..5429193fbb91 100644
--- a/drivers/media/platform/vivid/vivid-ctrls.c
+++ b/drivers/media/platform/vivid/vivid-ctrls.c
@@ -295,7 +295,7 @@ static int vivid_user_vid_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
switch (ctrl->id) {
case V4L2_CID_AUTOGAIN:
- dev->gain->val = dev->jiffies_vid_cap & 0xff;
+ dev->gain->val = (jiffies_to_msecs(jiffies) / 1000) & 0xff;
break;
}
return 0;