From 275b2e283b139bee19e7de5929d01484b8e3ee51 Mon Sep 17 00:00:00 2001 From: Pantelis Koukousoulas Date: Wed, 27 Dec 2006 23:05:19 -0300 Subject: 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 Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c') diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c index 05121666b9ba..93b8d077c11e 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c @@ -39,6 +39,7 @@ #define OP_AUDIORATE 4 #define OP_SIZE 5 #define OP_LOG 6 +#define OP_RADIO 7 static const struct pvr2_i2c_op * const ops[] = { [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, @@ -47,6 +48,7 @@ static const struct pvr2_i2c_op * const ops[] = { [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, [OP_SIZE] = &pvr2_i2c_op_v4l2_size, [OP_LOG] = &pvr2_i2c_op_v4l2_log, + [OP_RADIO] = &pvr2_i2c_op_v4l2_radio, }; void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) @@ -58,7 +60,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) (1 << OP_VOLUME) | (1 << OP_FREQ) | (1 << OP_SIZE) | - (1 << OP_LOG)); + (1 << OP_LOG) | + (1 << OP_RADIO)); if (id == I2C_DRIVERID_MSP3400) { if (pvr2_i2c_msp3400_setup(hdw,cp)) { -- cgit v1.2.3