diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-17 14:26:45 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-17 14:26:45 +0200 |
commit | 5ec4ec8d88daac3bf3f68769a7cac7db6f99c42a (patch) | |
tree | 1e0f6df8cc4c27f1e112373ece036aeb0e886a02 /linux/drivers/media/video/cx18/cx18-av-core.c | |
parent | bb3b040430255330d9572aa74f693efc7069ed38 (diff) | |
download | mediapointer-dvb-s2-5ec4ec8d88daac3bf3f68769a7cac7db6f99c42a.tar.gz mediapointer-dvb-s2-5ec4ec8d88daac3bf3f68769a7cac7db6f99c42a.tar.bz2 |
ivtv/cx18: ensure the default control values are correct
From: Hans Verkuil <hverkuil@xs4all.nl>
For several MPEG controls and the volume control the default as returned
by VIDIOC_QUERYCTRL was incorrect and did not match the actual initial
value.
This is now fixed for cx18 and ivtv.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-av-core.c')
-rw-r--r-- | linux/drivers/media/video/cx18/cx18-av-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-av-core.c b/linux/drivers/media/video/cx18/cx18-av-core.c index 3ccdf613b..124014253 100644 --- a/linux/drivers/media/video/cx18/cx18-av-core.c +++ b/linux/drivers/media/video/cx18/cx18-av-core.c @@ -80,6 +80,7 @@ static void log_video_status(struct cx18 *cx); static void cx18_av_initialize(struct cx18 *cx) { + struct cx18_av_state *state = &cx->av_state; u32 v; cx18_av_loadfw(cx); @@ -159,6 +160,8 @@ static void cx18_av_initialize(struct cx18 *cx) /* CxDevWrReg(CXADEC_SRC_COMB_CFG, 0x6628021F); */ /* } */ cx18_av_write4(cx, CXADEC_SRC_COMB_CFG, 0x6628021F); + state->default_volume = 228 - cx18_av_read(cx, 0x8d4); + state->default_volume = ((state->default_volume / 2) + 23) << 9; } /* ----------------------------------------------------------------------- */ @@ -559,6 +562,8 @@ int cx18_av_cmd(struct cx18 *cx, unsigned int cmd, void *arg) switch (qc->id) { case V4L2_CID_AUDIO_VOLUME: + return v4l2_ctrl_query_fill(qc, 0, 65535, + 65535 / 100, state->default_volume); case V4L2_CID_AUDIO_MUTE: case V4L2_CID_AUDIO_BALANCE: case V4L2_CID_AUDIO_BASS: |