diff options
author | Mike Isely <isely@pobox.com> | 2007-01-19 23:56:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:41 -0500 |
commit | 606cf9caeb3b908426757924bfdce85cb854aa81 (patch) | |
tree | f7236b01b9d8e3af4b12116a9c0ebe055f1ac60c /drivers | |
parent | 27c7b710a4010e10b14500c0b27bb4c2a806de1b (diff) |
V4L/DVB (5093): Pvrusb2: Emit VIDIOC_S_TUNER correctly
Audio mode changes are not private to the audio chip - other I2C
modules need to see this as well. And since the command in question
is VIDIOC_S_TUNER which is a standard v4l2 command, we really should
be broadcasting it out. This change sets up a broadcast pathway for
VIDIOC_S_TUNER and also eliminates the now redundant code from the
audio chip handler.
This fix enables stereo reception for the FM radio
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-audio.c | 10 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c | 15 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 23 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h | 1 |
4 files changed, 34 insertions, 15 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c index a45ede0a8cf1..379645e481c6 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c | |||
@@ -43,13 +43,6 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt) | |||
43 | 43 | ||
44 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo"); | 44 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo"); |
45 | 45 | ||
46 | if (hdw->input_val == PVR2_CVAL_INPUT_TV) { | ||
47 | struct v4l2_tuner vt; | ||
48 | memset(&vt,0,sizeof(vt)); | ||
49 | vt.audmode = hdw->audiomode_val; | ||
50 | pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_TUNER,&vt); | ||
51 | } | ||
52 | |||
53 | route.input = MSP_INPUT_DEFAULT; | 46 | route.input = MSP_INPUT_DEFAULT; |
54 | route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); | 47 | route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); |
55 | switch (hdw->input_val) { | 48 | switch (hdw->input_val) { |
@@ -77,8 +70,7 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt) | |||
77 | static int check_stereo(struct pvr2_msp3400_handler *ctxt) | 70 | static int check_stereo(struct pvr2_msp3400_handler *ctxt) |
78 | { | 71 | { |
79 | struct pvr2_hdw *hdw = ctxt->hdw; | 72 | struct pvr2_hdw *hdw = ctxt->hdw; |
80 | return (hdw->input_dirty || | 73 | return hdw->input_dirty; |
81 | hdw->audiomode_dirty); | ||
82 | } | 74 | } |
83 | 75 | ||
84 | 76 | ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c index 16fa075a1eec..49773764383b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c | |||
@@ -33,15 +33,17 @@ | |||
33 | #define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__) | 33 | #define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__) |
34 | 34 | ||
35 | #define OP_STANDARD 0 | 35 | #define OP_STANDARD 0 |
36 | #define OP_BCSH 1 | 36 | #define OP_AUDIOMODE 1 |
37 | #define OP_VOLUME 2 | 37 | #define OP_BCSH 2 |
38 | #define OP_FREQ 3 | 38 | #define OP_VOLUME 3 |
39 | #define OP_AUDIORATE 4 | 39 | #define OP_FREQ 4 |
40 | #define OP_SIZE 5 | 40 | #define OP_AUDIORATE 5 |
41 | #define OP_LOG 6 | 41 | #define OP_SIZE 6 |
42 | #define OP_LOG 7 | ||
42 | 43 | ||
43 | static const struct pvr2_i2c_op * const ops[] = { | 44 | static const struct pvr2_i2c_op * const ops[] = { |
44 | [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, | 45 | [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, |
46 | [OP_AUDIOMODE] = &pvr2_i2c_op_v4l2_audiomode, | ||
45 | [OP_BCSH] = &pvr2_i2c_op_v4l2_bcsh, | 47 | [OP_BCSH] = &pvr2_i2c_op_v4l2_bcsh, |
46 | [OP_VOLUME] = &pvr2_i2c_op_v4l2_volume, | 48 | [OP_VOLUME] = &pvr2_i2c_op_v4l2_volume, |
47 | [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, | 49 | [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, |
@@ -54,6 +56,7 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
54 | int id; | 56 | int id; |
55 | id = cp->client->driver->id; | 57 | id = cp->client->driver->id; |
56 | cp->ctl_mask = ((1 << OP_STANDARD) | | 58 | cp->ctl_mask = ((1 << OP_STANDARD) | |
59 | (1 << OP_AUDIOMODE) | | ||
57 | (1 << OP_BCSH) | | 60 | (1 << OP_BCSH) | |
58 | (1 << OP_VOLUME) | | 61 | (1 << OP_VOLUME) | |
59 | (1 << OP_FREQ) | | 62 | (1 << OP_FREQ) | |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index b1f6809625e8..c650e02ccd00 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | |||
@@ -140,6 +140,29 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume = { | |||
140 | }; | 140 | }; |
141 | 141 | ||
142 | 142 | ||
143 | static void set_audiomode(struct pvr2_hdw *hdw) | ||
144 | { | ||
145 | struct v4l2_tuner vt; | ||
146 | memset(&vt,0,sizeof(vt)); | ||
147 | vt.audmode = hdw->audiomode_val; | ||
148 | pvr2_i2c_core_cmd(hdw,VIDIOC_S_TUNER,&vt); | ||
149 | } | ||
150 | |||
151 | |||
152 | static int check_audiomode(struct pvr2_hdw *hdw) | ||
153 | { | ||
154 | return (hdw->input_dirty || | ||
155 | hdw->audiomode_dirty); | ||
156 | } | ||
157 | |||
158 | |||
159 | const struct pvr2_i2c_op pvr2_i2c_op_v4l2_audiomode = { | ||
160 | .check = check_audiomode, | ||
161 | .update = set_audiomode, | ||
162 | .name = "v4l2_audiomode", | ||
163 | }; | ||
164 | |||
165 | |||
143 | static void set_frequency(struct pvr2_hdw *hdw) | 166 | static void set_frequency(struct pvr2_hdw *hdw) |
144 | { | 167 | { |
145 | unsigned long fv; | 168 | unsigned long fv; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h index 6a9bb46d0654..c838df6167f9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h | |||
@@ -31,6 +31,7 @@ extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh; | |||
31 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume; | 31 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume; |
32 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency; | 32 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency; |
33 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size; | 33 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size; |
34 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_audiomode; | ||
34 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log; | 35 | extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log; |
35 | 36 | ||
36 | void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *,int); | 37 | void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *,int); |