diff options
author | Pantelis Koukousoulas <pakt223@freemail.gr> | 2006-12-28 03:05:19 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 16:34:21 +0100 |
commit | 275b2e283b139bee19e7de5929d01484b8e3ee51 (patch) | |
tree | dbef39c440161762a14d119486dbc1fcd99c4455 /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | V4L/DVB (5074): Some fixes at stream waitqueue on vivi (diff) | |
download | linux-275b2e283b139bee19e7de5929d01484b8e3ee51.tar.xz linux-275b2e283b139bee19e7de5929d01484b8e3ee51.zip |
V4L/DVB (5034): Pvrusb2: Enable radio mode round #1
This is the logic that supports switching modes via e.g.,
echo radio > /sys/class/pvrusb2/sn-*/ctl_input/cur_val.
To do the mode switching we need to:
a) broadcast AUDC_SET_RADIO and
b) issue the CX2341X_ENC_MUTE_VIDEO command to the encoder.
The first is done by adding a new pvr2_i2c_op and having it trigger on
input change, the second by adding this command in pvr2_encoder_start()
and requesting an encoder restart on input change by setting
stale_subsys_mask appropriately.
The clues about AUDC_SET_RADIO and CX2341X_ENC_MUTE_VIDEO were kindly
provided by Hans Verkuil on the pvrusb2 mailing list. The idea to
implement mode switching this way (on input change) is due to Mike Isely.
Why AUDC_SET_RADIO/VIDIOC_S_STD are used for switching? I can 't be sure,
but I think this can be traced to a cornell student being the first to
implement radio support in ivtv "as a different standard". I think the
rest just evolved from there (it 's in the ivtv ML archives).
Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 503255cebc2e..5f6ab998bbe7 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -2260,6 +2260,13 @@ static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); } + if (hdw->input_dirty) { + /* pk: If input changes to or from radio, then the encoder + needs to be restarted (for ENC_MUTE_VIDEO to work) */ + stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_RUN); + } + + if (hdw->srate_dirty) { /* Write new sample rate into control structure since * the master copy is stale. We must track srate |