* http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz
* The original driver's license is GPL, as declared with MODULE_LICENSE()
*
- * Driver modifiyed by Mauro Carvalho Chehab <mchehab@redhat.com> in order
- * to work with upstream drxk driver, and to fix some bugs.
+ * Copyright (c) 2010-2011 Mauro Carvalho Chehab <mchehab@redhat.com>
+ * Driver modified by in order to work with upstream drxk driver, and
+ * tons of bugs got fixed.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/* Due to DRX-K - probably need changes */
int (*gate_ctrl) (struct dvb_frontend *, int);
- struct semaphore pll_mutex;
bool tuner_attached;
unsigned char data[4096];
if (!st)
return -EINVAL;
- if (enable) {
-#if 0
- down(&st->pll_mutex);
-#endif
+ if (enable)
status = st->gate_ctrl(fe, 1);
- } else {
-#if 0
+ else
status = st->gate_ctrl(fe, 0);
-#endif
- up(&st->pll_mutex);
- }
+
return status;
}
return 0;
}
-#if 0
-int az6007_power_ctrl(struct dvb_usb_device *d, int onoff)
-{
- u8 v = onoff;
- return az6007_write(d->udev, AZ6007_POWER, v , 3, NULL, 1);
-}
-#endif
-
static int az6007_read_mac_addr(struct dvb_usb_device *d, u8 mac[6])
{
int ret;
{
struct usb_device *udev = interface_to_usbdev(intf);
int ret;
+
/* TS through */
ret = az6007_write(udev, AZ6007_POWER, onoff, 0, NULL, 0);
if (ret < 0)
{
struct az6007_device_state *st = adap->dev->priv;
- BUG_ON(!st);
-
deb_info("attaching demod drxk");
adap->fe_adap[0].fe = dvb_attach(drxk_attach, &terratec_h7_drxk,
return -EINVAL;
adap->fe_adap[0].fe->sec_priv = adap;
- /* FIXME: do we need a pll semaphore? */
- sema_init(&st->pll_mutex, 1);
st->gate_ctrl = adap->fe_adap[0].fe->ops.i2c_gate_ctrl;
adap->fe_adap[0].fe->ops.i2c_gate_ctrl = drxk_gate_ctrl;
if (st->tuner_attached)
return 0;
- st->tuner_attached = true;
-
deb_info("attaching tuner mt2063");
+
/* Attach mt2063 to DVB-C frontend */
if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
+ st->tuner_attached = true;
+
return 0;
}
az6007_write(udev, AZ6007_POWER, 0, 0, NULL, 0);
az6007_write(udev, AZ6007_TS_THROUGH, 0, 0, NULL, 0);
-#if 0
- // Seems to be a poweroff sequence
- az6007_write(udev, 0xbc, 1, 3, NULL, 0);
- az6007_write(udev, 0xbc, 1, 4, NULL, 0);
- az6007_write(udev, 0xc0, 0, 3, NULL, 0);
- az6007_write(udev, 0xc0, 1, 3, NULL, 0);
- az6007_write(udev, 0xbc, 0, 1, NULL, 0);
-#endif
-
return 0;
}
-static struct dvb_usb_device_properties az6007_properties;
-
-static void az6007_usb_disconnect(struct usb_interface *intf)
-{
- dvb_usb_device_exit(intf);
-}
-
/* I2C */
static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
int num)
return 0;
}
+static struct dvb_usb_device_properties az6007_properties;
+
static int az6007_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
.name = "dvb_usb_az6007",
.probe = az6007_usb_probe,
.disconnect = dvb_usb_device_exit,
- /* .disconnect = az6007_usb_disconnect, */
.id_table = az6007_usb_table,
};
module_exit(az6007_usb_module_exit);
MODULE_AUTHOR("Henry Wang <Henry.wang@AzureWave.com>");
+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
MODULE_DESCRIPTION("Driver for AzureWave 6007 DVB-C/T USB2.0 and clones");
MODULE_VERSION("1.1");
MODULE_LICENSE("GPL");