summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 21:43:26 -0600
committerMike Isely <isely@pobox.com>2009-03-06 21:43:26 -0600
commitc2d235d8b62f32064c7bf3762660e0b376c1b6f9 (patch)
tree1b188ca60f7ab16d1ac460f10d950858efff69ce /linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
parent0f16c4cd5b6c0c18492d34470bd380aa23d0f862 (diff)
downloadmediapointer-dvb-s2-c2d235d8b62f32064c7bf3762660e0b376c1b6f9.tar.gz
mediapointer-dvb-s2-c2d235d8b62f32064c7bf3762660e0b376c1b6f9.tar.bz2
pvrusb2: Tie in saa7115 sub-device handling
From: Mike Isely <isely@pobox.com> Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c64
1 files changed, 54 insertions, 10 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
index b1ff3803f..3c392e9a2 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
@@ -28,9 +28,10 @@
*/
#include "pvrusb2-video-v4l.h"
-#include "pvrusb2-i2c-cmd-v4l2.h"
+#include "pvrusb2-i2c-cmd-v4l2.h"
+
#include "pvrusb2-hdw-internal.h"
#include "pvrusb2-debug.h"
#include <linux/videodev2.h>
@@ -40,15 +41,6 @@
#include <linux/slab.h>
#include "compat.h"
-struct pvr2_v4l_decoder {
- struct pvr2_i2c_handler handler;
- struct pvr2_decoder_ctrl ctrl;
- struct pvr2_i2c_client *client;
- struct pvr2_hdw *hdw;
- unsigned long stale_mask;
-};
-
-
struct routing_scheme {
const int *def;
unsigned int cnt;
@@ -71,6 +63,16 @@ static const struct routing_scheme routing_schemes[] = {
},
};
+struct pvr2_v4l_decoder {
+ struct pvr2_i2c_handler handler;
+ struct pvr2_decoder_ctrl ctrl;
+ struct pvr2_i2c_client *client;
+ struct pvr2_hdw *hdw;
+ unsigned long stale_mask;
+};
+
+
+
static void set_input(struct pvr2_v4l_decoder *ctxt)
{
struct pvr2_hdw *hdw = ctxt->hdw;
@@ -246,6 +248,48 @@ int pvr2_i2c_decoder_v4l_setup(struct pvr2_hdw *hdw,
}
+void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
+{
+ if (hdw->srate_dirty) {
+ u32 val;
+ pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_audio %d",
+ hdw->srate_val);
+ switch (hdw->srate_val) {
+ default:
+ case V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000:
+ val = 48000;
+ break;
+ case V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100:
+ val = 44100;
+ break;
+ case V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000:
+ val = 32000;
+ break;
+ }
+ sd->ops->audio->s_clock_freq(sd, val);
+ }
+ 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 v4l2 set_input(%d)",
+ hdw->input_val);
+ 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 v4l2 set_input:"
+ " Invalid routing scheme (%u) and/or input (%d)",
+ sid, hdw->input_val);
+ return;
+ }
+ route.output = 0;
+ sd->ops->video->s_routing(sd, &route);
+ }
+}
/*