Commit f5156b06 authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (5043): Pvrusb2: video standard broadcast fix for radio mode

Ensure we don't accidentally broadcast the standard while in radio mode.
Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 98752102
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#define OP_AUDIORATE 4 #define OP_AUDIORATE 4
#define OP_SIZE 5 #define OP_SIZE 5
#define OP_LOG 6 #define OP_LOG 6
#define OP_RADIO 7
static const struct pvr2_i2c_op * const ops[] = { static const struct pvr2_i2c_op * const ops[] = {
[OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard,
...@@ -48,7 +47,6 @@ static const struct pvr2_i2c_op * const ops[] = { ...@@ -48,7 +47,6 @@ static const struct pvr2_i2c_op * const ops[] = {
[OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency,
[OP_SIZE] = &pvr2_i2c_op_v4l2_size, [OP_SIZE] = &pvr2_i2c_op_v4l2_size,
[OP_LOG] = &pvr2_i2c_op_v4l2_log, [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) void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
...@@ -60,8 +58,7 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) ...@@ -60,8 +58,7 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
(1 << OP_VOLUME) | (1 << OP_VOLUME) |
(1 << OP_FREQ) | (1 << OP_FREQ) |
(1 << OP_SIZE) | (1 << OP_SIZE) |
(1 << OP_LOG) | (1 << OP_LOG));
(1 << OP_RADIO));
if (id == I2C_DRIVERID_MSP3400) { if (id == I2C_DRIVERID_MSP3400) {
if (pvr2_i2c_msp3400_setup(hdw,cp)) { if (pvr2_i2c_msp3400_setup(hdw,cp)) {
......
...@@ -28,18 +28,21 @@ ...@@ -28,18 +28,21 @@
static void set_standard(struct pvr2_hdw *hdw) static void set_standard(struct pvr2_hdw *hdw)
{ {
pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_standard");
if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
pvr2_i2c_core_cmd(hdw,AUDC_SET_RADIO,NULL);
} else {
v4l2_std_id vs; v4l2_std_id vs;
vs = hdw->std_mask_cur; vs = hdw->std_mask_cur;
pvr2_trace(PVR2_TRACE_CHIPS,
"i2c v4l2 set_standard(0x%llx)",(long long unsigned)vs);
pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs); pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs);
}
} }
static int check_standard(struct pvr2_hdw *hdw) static int check_standard(struct pvr2_hdw *hdw)
{ {
return hdw->std_dirty != 0; return (hdw->input_dirty != 0) || (hdw->std_dirty != 0);
} }
...@@ -50,32 +53,6 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard = { ...@@ -50,32 +53,6 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard = {
}; };
static void set_radio(struct pvr2_hdw *hdw)
{
pvr2_trace(PVR2_TRACE_CHIPS,
"i2c v4l2 set_radio()");
if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
pvr2_i2c_core_cmd(hdw,AUDC_SET_RADIO,NULL);
} else {
set_standard(hdw);
}
}
static int check_radio(struct pvr2_hdw *hdw)
{
return hdw->input_dirty != 0;
}
const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio = {
.check = check_radio,
.update = set_radio,
.name = "v4l2_radio",
};
static void set_bcsh(struct pvr2_hdw *hdw) static void set_bcsh(struct pvr2_hdw *hdw)
{ {
struct v4l2_control ctrl; struct v4l2_control ctrl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment