]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
V4L/DVB (11178): pvrusb2: Make audio sample rate update into a sub-device broadcast
authorMike Isely <isely@pobox.com>
Sat, 7 Mar 2009 03:48:09 +0000 (00:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:35 +0000 (12:43 -0300)
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.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c

index e92ea6af8bc0ab5729ad269a162744d141a27dfa..8a96f260af5b58bafb66fff8bbb1b7787854e6c5 100644 (file)
@@ -2983,6 +2983,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 */
 
index ad28c5d3ad83ff08871cb559b8bb67f14909fce8..1c9ed5e85c80cacc4f66e7872f930105b20666ee 100644 (file)
@@ -249,24 +249,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;