diff options
author | Mike Isely <isely@pobox.com> | 2006-12-27 21:14:54 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:24 -0500 |
commit | f5156b06acaad13b74f72bf62025de7b76b1b8a4 (patch) | |
tree | 0fafb526df9a1d3f3a982b04aa1538ae9992104a /drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | |
parent | 98752102dccfd3f1bb3eac3d7833c9b38ac22fef (diff) |
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: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 98731c4f7df4..8d66ab144281 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | |||
@@ -28,18 +28,21 @@ | |||
28 | 28 | ||
29 | static void set_standard(struct pvr2_hdw *hdw) | 29 | static void set_standard(struct pvr2_hdw *hdw) |
30 | { | 30 | { |
31 | v4l2_std_id vs; | 31 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_standard"); |
32 | vs = hdw->std_mask_cur; | ||
33 | pvr2_trace(PVR2_TRACE_CHIPS, | ||
34 | "i2c v4l2 set_standard(0x%llx)",(long long unsigned)vs); | ||
35 | 32 | ||
36 | pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs); | 33 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { |
34 | pvr2_i2c_core_cmd(hdw,AUDC_SET_RADIO,NULL); | ||
35 | } else { | ||
36 | v4l2_std_id vs; | ||
37 | vs = hdw->std_mask_cur; | ||
38 | pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs); | ||
39 | } | ||
37 | } | 40 | } |
38 | 41 | ||
39 | 42 | ||
40 | static int check_standard(struct pvr2_hdw *hdw) | 43 | static int check_standard(struct pvr2_hdw *hdw) |
41 | { | 44 | { |
42 | return hdw->std_dirty != 0; | 45 | return (hdw->input_dirty != 0) || (hdw->std_dirty != 0); |
43 | } | 46 | } |
44 | 47 | ||
45 | 48 | ||
@@ -50,32 +53,6 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard = { | |||
50 | }; | 53 | }; |
51 | 54 | ||
52 | 55 | ||
53 | static void set_radio(struct pvr2_hdw *hdw) | ||
54 | { | ||
55 | pvr2_trace(PVR2_TRACE_CHIPS, | ||
56 | "i2c v4l2 set_radio()"); | ||
57 | |||
58 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { | ||
59 | pvr2_i2c_core_cmd(hdw,AUDC_SET_RADIO,NULL); | ||
60 | } else { | ||
61 | set_standard(hdw); | ||
62 | } | ||
63 | } | ||
64 | |||
65 | |||
66 | static int check_radio(struct pvr2_hdw *hdw) | ||
67 | { | ||
68 | return hdw->input_dirty != 0; | ||
69 | } | ||
70 | |||
71 | |||
72 | const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio = { | ||
73 | .check = check_radio, | ||
74 | .update = set_radio, | ||
75 | .name = "v4l2_radio", | ||
76 | }; | ||
77 | |||
78 | |||
79 | static void set_bcsh(struct pvr2_hdw *hdw) | 56 | static void set_bcsh(struct pvr2_hdw *hdw) |
80 | { | 57 | { |
81 | struct v4l2_control ctrl; | 58 | struct v4l2_control ctrl; |