summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 21:52:06 -0600
committerMike Isely <isely@pobox.com>2009-03-06 21:52:06 -0600
commitce6fda6ed152e5f323c5c573de8db26e9549ebfb (patch)
treecd0b301d455eae3ee54b401d22f9191aa09131a2 /linux
parent24b1e380d582aa066f67e2561d2e8a49605e6399 (diff)
downloadmediapointer-dvb-s2-ce6fda6ed152e5f323c5c573de8db26e9549ebfb.tar.gz
mediapointer-dvb-s2-ce6fda6ed152e5f323c5c573de8db26e9549ebfb.tar.bz2
pvrusb2: Tie in msp3400 sub-device support
From: Mike Isely <isely@pobox.com> Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-audio.c47
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-audio.h2
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c2
3 files changed, 41 insertions, 10 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c
index a6e0896d9..6e63d56bd 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c
@@ -28,15 +28,6 @@
#include "compat.h"
-struct pvr2_msp3400_handler {
- struct pvr2_hdw *hdw;
- struct pvr2_i2c_client *client;
- struct pvr2_i2c_handler i2c_handler;
- unsigned long stale_mask;
-};
-
-
-
struct routing_scheme {
const int *def;
unsigned int cnt;
@@ -65,6 +56,17 @@ static const struct routing_scheme routing_schemes[] = {
},
};
+
+struct pvr2_msp3400_handler {
+ struct pvr2_hdw *hdw;
+ struct pvr2_i2c_client *client;
+ struct pvr2_i2c_handler i2c_handler;
+ unsigned long stale_mask;
+};
+
+
+
+
/* This function selects the correct audio input source */
static void set_stereo(struct pvr2_msp3400_handler *ctxt)
{
@@ -181,7 +183,32 @@ int pvr2_i2c_msp3400_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
return !0;
}
-
+void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
+{
+ if (hdw->input_dirty) {
+ struct v4l2_routing route;
+ const struct routing_scheme *sp;
+ unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
+
+ pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo");
+
+ if ((sid < ARRAY_SIZE(routing_schemes)) &&
+ ((sp = routing_schemes + sid) != NULL) &&
+ (hdw->input_val >= 0) &&
+ (hdw->input_val < sp->cnt)) {
+ route.input = sp->def[hdw->input_val];
+ } else {
+ pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+ "*** WARNING *** subdev msp3400 set_input:"
+ " Invalid routing scheme (%u)"
+ " and/or input (%d)",
+ sid, hdw->input_val);
+ return;
+ }
+ route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1);
+ sd->ops->audio->s_routing(sd, &route);
+ }
+}
/*
Stuff for Emacs to see, in order to encourage consistent editing style:
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h
index f7f0a408a..c47c8de3b 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h
@@ -26,6 +26,8 @@
int pvr2_i2c_msp3400_setup(struct pvr2_hdw *,struct pvr2_i2c_client *);
+#include "pvrusb2-hdw-internal.h"
+void pvr2_msp3400_subdev_update(struct pvr2_hdw *, struct v4l2_subdev *);
#endif /* __PVRUSB2_AUDIO_H */
/*
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index aa2db330c..2a5911d39 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -38,6 +38,7 @@
#include "pvrusb2-fx2-cmd.h"
#include "pvrusb2-wm8775.h"
#include "pvrusb2-video-v4l.h"
+#include "pvrusb2-audio.h"
#include "compat.h"
#define TV_MIN_FREQ 55250000L
@@ -114,6 +115,7 @@ typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *,
static const pvr2_subdev_update_func pvr2_module_update_functions[] = {
[PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_subdev_update,
[PVR2_CLIENT_ID_SAA7115] = pvr2_saa7115_subdev_update,
+ [PVR2_CLIENT_ID_MSP3400] = pvr2_msp3400_subdev_update,
};
static const char *module_names[] = {