diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-audio.c | 47 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-audio.h | 2 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 2 |
3 files changed, 41 insertions, 10 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c index c29206fa3d1..52966414327 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c | |||
@@ -27,15 +27,6 @@ | |||
27 | #include <media/v4l2-common.h> | 27 | #include <media/v4l2-common.h> |
28 | 28 | ||
29 | 29 | ||
30 | struct pvr2_msp3400_handler { | ||
31 | struct pvr2_hdw *hdw; | ||
32 | struct pvr2_i2c_client *client; | ||
33 | struct pvr2_i2c_handler i2c_handler; | ||
34 | unsigned long stale_mask; | ||
35 | }; | ||
36 | |||
37 | |||
38 | |||
39 | struct routing_scheme { | 30 | struct routing_scheme { |
40 | const int *def; | 31 | const int *def; |
41 | unsigned int cnt; | 32 | unsigned int cnt; |
@@ -64,6 +55,17 @@ static const struct routing_scheme routing_schemes[] = { | |||
64 | }, | 55 | }, |
65 | }; | 56 | }; |
66 | 57 | ||
58 | |||
59 | struct pvr2_msp3400_handler { | ||
60 | struct pvr2_hdw *hdw; | ||
61 | struct pvr2_i2c_client *client; | ||
62 | struct pvr2_i2c_handler i2c_handler; | ||
63 | unsigned long stale_mask; | ||
64 | }; | ||
65 | |||
66 | |||
67 | |||
68 | |||
67 | /* This function selects the correct audio input source */ | 69 | /* This function selects the correct audio input source */ |
68 | static void set_stereo(struct pvr2_msp3400_handler *ctxt) | 70 | static void set_stereo(struct pvr2_msp3400_handler *ctxt) |
69 | { | 71 | { |
@@ -180,7 +182,32 @@ int pvr2_i2c_msp3400_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
180 | return !0; | 182 | return !0; |
181 | } | 183 | } |
182 | 184 | ||
183 | 185 | void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | |
186 | { | ||
187 | if (hdw->input_dirty) { | ||
188 | struct v4l2_routing route; | ||
189 | const struct routing_scheme *sp; | ||
190 | unsigned int sid = hdw->hdw_desc->signal_routing_scheme; | ||
191 | |||
192 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo"); | ||
193 | |||
194 | if ((sid < ARRAY_SIZE(routing_schemes)) && | ||
195 | ((sp = routing_schemes + sid) != NULL) && | ||
196 | (hdw->input_val >= 0) && | ||
197 | (hdw->input_val < sp->cnt)) { | ||
198 | route.input = sp->def[hdw->input_val]; | ||
199 | } else { | ||
200 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | ||
201 | "*** WARNING *** subdev msp3400 set_input:" | ||
202 | " Invalid routing scheme (%u)" | ||
203 | " and/or input (%d)", | ||
204 | sid, hdw->input_val); | ||
205 | return; | ||
206 | } | ||
207 | route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); | ||
208 | sd->ops->audio->s_routing(sd, &route); | ||
209 | } | ||
210 | } | ||
184 | 211 | ||
185 | /* | 212 | /* |
186 | Stuff for Emacs to see, in order to encourage consistent editing style: | 213 | Stuff for Emacs to see, in order to encourage consistent editing style: |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.h b/drivers/media/video/pvrusb2/pvrusb2-audio.h index f7f0a408a9b..c47c8de3ba0 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-audio.h +++ b/drivers/media/video/pvrusb2/pvrusb2-audio.h | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | int pvr2_i2c_msp3400_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); | 27 | int pvr2_i2c_msp3400_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); |
28 | 28 | ||
29 | #include "pvrusb2-hdw-internal.h" | ||
30 | void pvr2_msp3400_subdev_update(struct pvr2_hdw *, struct v4l2_subdev *); | ||
29 | #endif /* __PVRUSB2_AUDIO_H */ | 31 | #endif /* __PVRUSB2_AUDIO_H */ |
30 | 32 | ||
31 | /* | 33 | /* |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 7269110a3bc..ff7af062002 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "pvrusb2-fx2-cmd.h" | 38 | #include "pvrusb2-fx2-cmd.h" |
39 | #include "pvrusb2-wm8775.h" | 39 | #include "pvrusb2-wm8775.h" |
40 | #include "pvrusb2-video-v4l.h" | 40 | #include "pvrusb2-video-v4l.h" |
41 | #include "pvrusb2-audio.h" | ||
41 | 42 | ||
42 | #define TV_MIN_FREQ 55250000L | 43 | #define TV_MIN_FREQ 55250000L |
43 | #define TV_MAX_FREQ 850000000L | 44 | #define TV_MAX_FREQ 850000000L |
@@ -113,6 +114,7 @@ typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *, | |||
113 | static const pvr2_subdev_update_func pvr2_module_update_functions[] = { | 114 | static const pvr2_subdev_update_func pvr2_module_update_functions[] = { |
114 | [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_subdev_update, | 115 | [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_subdev_update, |
115 | [PVR2_CLIENT_ID_SAA7115] = pvr2_saa7115_subdev_update, | 116 | [PVR2_CLIENT_ID_SAA7115] = pvr2_saa7115_subdev_update, |
117 | [PVR2_CLIENT_ID_MSP3400] = pvr2_msp3400_subdev_update, | ||
116 | }; | 118 | }; |
117 | 119 | ||
118 | static const char *module_names[] = { | 120 | static const char *module_names[] = { |