]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6855): xc2028: select DTV78 firmware if tuning 7MHz VHF / 8MHz UHF
authorChris Pascoe <c.pascoe@itee.uq.edu.au>
Sun, 2 Dec 2007 13:07:06 +0000 (10:07 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:04:01 +0000 (19:04 -0200)
It seems that the DTV78 firmware is intended for use in locations where
VHF channels have 7MHz bandwidth and UHF channels have 8MHz bandwidth.
If we switch to DTV78 firmware when we detect this condition, we can
avoid firmware reloads when switching between VHF and UHF transponders.

Place the state for this in the control structure so that card drivers
can hint to us to use DTV78 firmware from the first tuning attempt.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tuner-xc2028.c
drivers/media/video/tuner-xc2028.h

index 63a6fca1f8cfb91bdc4157f10a785577fcc30283..0565edd224bcb01db161f46b149420236efd0d32 100644 (file)
@@ -998,20 +998,27 @@ static int xc2028_set_params(struct dvb_frontend *fe,
                return -EINVAL;
        }
 
-       /* FIXME:
-         There are two Scodes that will never be selected:
-               DTV78 ZARLINK456, DTV78 DIBCOM52
-         When it should opt for DTV78 instead of DTV7 or DTV8?
-       */
        switch (bw) {
        case BANDWIDTH_8_MHZ:
-               type |= DTV8 | F8MHZ;
+               if (p->frequency < 470000000)
+                       priv->ctrl.vhfbw7 = 0;
+               else
+                       priv->ctrl.uhfbw8 = 1;
+               type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
+               type |= F8MHZ;
                break;
        case BANDWIDTH_7_MHZ:
-               type |= DTV7 | F8MHZ;
+               if (p->frequency < 470000000)
+                       priv->ctrl.vhfbw7 = 1;
+               else
+                       priv->ctrl.uhfbw8 = 0;
+               type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
+               type |= F8MHZ;
                break;
        case BANDWIDTH_6_MHZ:
-               type |= DTV6 ;
+               type |= DTV6;
+               priv->ctrl.vhfbw7 = 0;
+               priv->ctrl.uhfbw8 = 0;
                break;
        default:
                tuner_err("error: bandwidth not supported.\n");
index 1fe8b195960c47e76a2526f83b8eac6d477cbc3c..7462629b98fd2743321a57da7ccdf77c8935fb0c 100644 (file)
@@ -30,6 +30,8 @@ struct xc2028_ctrl {
        unsigned int            mts   :1;
        unsigned int            d2633 :1;
        unsigned int            input1:1;
+       unsigned int            vhfbw7:1;
+       unsigned int            uhfbw8:1;
        unsigned int            demod;
 };