summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 21:48:09 -0600
committerMike Isely <isely@pobox.com>2009-03-06 21:48:09 -0600
commitddf32a4802df1c4720de90d6214b270395af4ded (patch)
tree384577a4a56bde54926de5ede17557565e562310 /linux
parentc2d235d8b62f32064c7bf3762660e0b376c1b6f9 (diff)
downloadmediapointer-dvb-s2-ddf32a4802df1c4720de90d6214b270395af4ded.tar.gz
mediapointer-dvb-s2-ddf32a4802df1c4720de90d6214b270395af4ded.tar.bz2
pvrusb2: Make audio sample rate update into a sub-device broadcast
From: Mike Isely <isely@pobox.com> The pvrusb2 driver had previously been using i2c module specific calls to set the sample rate (a long long time ago this was needed). These days it is safe to use a broadcast so let's just broadcast this when communicating audio sample rate to sub-devices. Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c20
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c18
2 files changed, 20 insertions, 18 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 2c31969c5..e671f7e81 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -3007,6 +3007,26 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_fmt, &fmt);
}
+ 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;
+ }
+ v4l2_device_call_all(&hdw->v4l2_dev, 0,
+ audio, s_clock_freq, val);
+ }
+
/* Unable to set crop parameters; there is apparently no equivalent
for VIDIOC_S_CROP */
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
index 3c392e9a2..6a0e207e6 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
@@ -250,24 +250,6 @@ 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;