]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (11166): pvrusb2: Implement status fetching from sub-devices
authorMike Isely <isely@pobox.com>
Sat, 7 Mar 2009 03:08:17 +0000 (00:08 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:34 +0000 (12:43 -0300)
Implement status fetching operations in terms of calling out to
sub-device(s).

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-i2c-track.c

index 4e50e7bc57453921fee8b64bc39e4f1c88664ce6..d619e807a33922037724fa643f34b4bce3cafe26 100644 (file)
@@ -4816,7 +4816,21 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
 
 void pvr2_hdw_status_poll(struct pvr2_hdw *hdw)
 {
+       struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
+       memset(vtp, 0, sizeof(*vtp));
        pvr2_i2c_core_status_poll(hdw);
+       /* Note: There apparently is no replacement for VIDIOC_CROPCAP
+          using v4l2-subdev - therefore we can't support that AT ALL right
+          now.  (Of course, no sub-drivers seem to implement it either.
+          But now it's a a chicken and egg problem...) */
+       v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, g_tuner,
+                            &hdw->tuner_signal_info);
+       pvr2_trace(PVR2_TRACE_CHIPS, "client status poll"
+                  " type=%u strength=%u audio=0x%x cap=0x%x"
+                  " low=%u hi=%u",
+                  vtp->type,
+                  vtp->signal, vtp->rxsubchans, vtp->capability,
+                  vtp->rangelow, vtp->rangehigh);
 }
 
 
index 3387897ed8977313de0c94da7105422bdca9578e..7ca1b660cbe40a393d75dbf390a5c178f65aa9cc 100644 (file)
@@ -112,20 +112,12 @@ void pvr2_i2c_core_status_poll(struct pvr2_hdw *hdw)
 {
        struct pvr2_i2c_client *cp;
        mutex_lock(&hdw->i2c_list_lock); do {
-               struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
-               memset(vtp,0,sizeof(*vtp));
                list_for_each_entry(cp, &hdw->i2c_clients, list) {
                        if (!cp->detected_flag) continue;
                        if (!cp->status_poll) continue;
                        cp->status_poll(cp);
                }
                hdw->tuner_signal_stale = 0;
-               pvr2_trace(PVR2_TRACE_CHIPS,"i2c status poll"
-                          " type=%u strength=%u audio=0x%x cap=0x%x"
-                          " low=%u hi=%u",
-                          vtp->type,
-                          vtp->signal,vtp->rxsubchans,vtp->capability,
-                          vtp->rangelow,vtp->rangehigh);
        } while (0); mutex_unlock(&hdw->i2c_list_lock);
 }