Commit 04e3ece7 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] az6007: Driver cleanup

Remove commented test code, remove unused poweroff stuff, and
fix the copyright data.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b19280cf
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
* http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz * 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() * The original driver's license is GPL, as declared with MODULE_LICENSE()
* *
* Driver modifiyed by Mauro Carvalho Chehab <mchehab@redhat.com> in order * Copyright (c) 2010-2011 Mauro Carvalho Chehab <mchehab@redhat.com>
* to work with upstream drxk driver, and to fix some bugs. * 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 * 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 * it under the terms of the GNU General Public License as published by
...@@ -58,7 +59,6 @@ struct az6007_device_state { ...@@ -58,7 +59,6 @@ struct az6007_device_state {
/* Due to DRX-K - probably need changes */ /* Due to DRX-K - probably need changes */
int (*gate_ctrl) (struct dvb_frontend *, int); int (*gate_ctrl) (struct dvb_frontend *, int);
struct semaphore pll_mutex;
bool tuner_attached; bool tuner_attached;
unsigned char data[4096]; unsigned char data[4096];
...@@ -94,17 +94,11 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) ...@@ -94,17 +94,11 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable)
if (!st) if (!st)
return -EINVAL; return -EINVAL;
if (enable) { if (enable)
#if 0
down(&st->pll_mutex);
#endif
status = st->gate_ctrl(fe, 1); status = st->gate_ctrl(fe, 1);
} else { else
#if 0
status = st->gate_ctrl(fe, 0); status = st->gate_ctrl(fe, 0);
#endif
up(&st->pll_mutex);
}
return status; return status;
} }
...@@ -221,14 +215,6 @@ static int az6007_rc_query(struct dvb_usb_device *d, u32 * event, int *state) ...@@ -221,14 +215,6 @@ static int az6007_rc_query(struct dvb_usb_device *d, u32 * event, int *state)
return 0; 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]) static int az6007_read_mac_addr(struct dvb_usb_device *d, u8 mac[6])
{ {
int ret; int ret;
...@@ -246,6 +232,7 @@ static int az6007_led_on_off(struct usb_interface *intf, int onoff) ...@@ -246,6 +232,7 @@ static int az6007_led_on_off(struct usb_interface *intf, int onoff)
{ {
struct usb_device *udev = interface_to_usbdev(intf); struct usb_device *udev = interface_to_usbdev(intf);
int ret; int ret;
/* TS through */ /* TS through */
ret = az6007_write(udev, AZ6007_POWER, onoff, 0, NULL, 0); ret = az6007_write(udev, AZ6007_POWER, onoff, 0, NULL, 0);
if (ret < 0) if (ret < 0)
...@@ -257,8 +244,6 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -257,8 +244,6 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap)
{ {
struct az6007_device_state *st = adap->dev->priv; struct az6007_device_state *st = adap->dev->priv;
BUG_ON(!st);
deb_info("attaching demod drxk"); deb_info("attaching demod drxk");
adap->fe_adap[0].fe = dvb_attach(drxk_attach, &terratec_h7_drxk, adap->fe_adap[0].fe = dvb_attach(drxk_attach, &terratec_h7_drxk,
...@@ -267,8 +252,6 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -267,8 +252,6 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap)
return -EINVAL; return -EINVAL;
adap->fe_adap[0].fe->sec_priv = adap; 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; st->gate_ctrl = adap->fe_adap[0].fe->ops.i2c_gate_ctrl;
adap->fe_adap[0].fe->ops.i2c_gate_ctrl = drxk_gate_ctrl; adap->fe_adap[0].fe->ops.i2c_gate_ctrl = drxk_gate_ctrl;
...@@ -282,9 +265,8 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -282,9 +265,8 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap)
if (st->tuner_attached) if (st->tuner_attached)
return 0; return 0;
st->tuner_attached = true;
deb_info("attaching tuner mt2063"); deb_info("attaching tuner mt2063");
/* Attach mt2063 to DVB-C frontend */ /* Attach mt2063 to DVB-C frontend */
if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl) 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); adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
...@@ -296,6 +278,8 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -296,6 +278,8 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap)
if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl) 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); adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
st->tuner_attached = true;
return 0; return 0;
} }
...@@ -355,25 +339,9 @@ int az6007_power_ctrl(struct dvb_usb_device *d, int onoff) ...@@ -355,25 +339,9 @@ int az6007_power_ctrl(struct dvb_usb_device *d, int onoff)
az6007_write(udev, AZ6007_POWER, 0, 0, NULL, 0); az6007_write(udev, AZ6007_POWER, 0, 0, NULL, 0);
az6007_write(udev, AZ6007_TS_THROUGH, 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; 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 */ /* I2C */
static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
int num) int num)
...@@ -513,6 +481,8 @@ int az6007_identify_state(struct usb_device *udev, ...@@ -513,6 +481,8 @@ int az6007_identify_state(struct usb_device *udev,
return 0; return 0;
} }
static struct dvb_usb_device_properties az6007_properties;
static int az6007_usb_probe(struct usb_interface *intf, static int az6007_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
...@@ -589,7 +559,6 @@ static struct usb_driver az6007_usb_driver = { ...@@ -589,7 +559,6 @@ static struct usb_driver az6007_usb_driver = {
.name = "dvb_usb_az6007", .name = "dvb_usb_az6007",
.probe = az6007_usb_probe, .probe = az6007_usb_probe,
.disconnect = dvb_usb_device_exit, .disconnect = dvb_usb_device_exit,
/* .disconnect = az6007_usb_disconnect, */
.id_table = az6007_usb_table, .id_table = az6007_usb_table,
}; };
...@@ -619,6 +588,7 @@ module_init(az6007_usb_module_init); ...@@ -619,6 +588,7 @@ module_init(az6007_usb_module_init);
module_exit(az6007_usb_module_exit); module_exit(az6007_usb_module_exit);
MODULE_AUTHOR("Henry Wang <Henry.wang@AzureWave.com>"); 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_DESCRIPTION("Driver for AzureWave 6007 DVB-C/T USB2.0 and clones");
MODULE_VERSION("1.1"); MODULE_VERSION("1.1");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment