V4L/DVB (5636): Integrate all users of the fmd1216 tuner with dvb-pll
[linux-2.6-block.git] / drivers / media / dvb / dvb-usb / cxusb.c
index 15d12fce34df871e8ffaed1b4c39b7566fa97d82..88aeb2512212add051908c1090a177cc611bca52 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "cx22702.h"
 #include "lgdt330x.h"
-#include "lgh06xf.h"
 #include "mt352.h"
 #include "mt352_priv.h"
 #include "zl10353.h"
@@ -355,14 +354,8 @@ static struct mt352_config cxusb_mt352_config = {
 /* Callbacks for DVB USB */
 static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
 {
-       u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 };
-       adap->pll_addr = 0x61;
-       memcpy(adap->pll_init, bpll, 4);
-       adap->pll_desc = &dvb_pll_fmd1216me;
-
-       adap->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
-       adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
-
+       dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
+                  &dvb_pll_fmd1216me);
        return 0;
 }
 
@@ -388,7 +381,8 @@ static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
 
 static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
 {
-       dvb_attach(lgh06xf_attach, adap->fe, &adap->dev->i2c_adap);
+       dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
+                  &dvb_pll_lg_tdvs_h06xf);
        return 0;
 }
 
@@ -469,9 +463,9 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev,
            fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) {
 
                fw->data[BLUEBIRD_01_ID_OFFSET + 2] =
-                       udev->descriptor.idProduct + 1;
+                       le16_to_cpu(udev->descriptor.idProduct) + 1;
                fw->data[BLUEBIRD_01_ID_OFFSET + 3] =
-                       udev->descriptor.idProduct >> 8;
+                       le16_to_cpu(udev->descriptor.idProduct) >> 8;
 
                return usb_cypress_load_firmware(udev, fw, CYPRESS_FX2);
        }