#include "lnbh24.h"
#include "lgdt330x.h"
#include "mt2131.h"
+#include "tda18271c2dd.h"
#include "drxk.h"
return status;
}
-struct dvb_frontend *tda18271c2dd_attach(struct dvb_frontend *fe,
- struct i2c_adapter *i2c, u8 adr);
-
static int tuner_attach_tda18271(struct ngene_channel *chan)
{
struct i2c_adapter *i2c;
if (chan->fe->ops.i2c_gate_ctrl)
chan->fe->ops.i2c_gate_ctrl(chan->fe, 0);
if (!fe) {
- printk("No TDA18271 found!\n");
+ printk(KERN_ERR "No TDA18271 found!\n");
return -ENODEV;
}
static int i2c_read(struct i2c_adapter *adapter, u8 adr, u8 *val)
{
struct i2c_msg msgs[1] = {{.addr = adr, .flags = I2C_M_RD,
- .buf = val, .len = 1 }};
+ .buf = val, .len = 1 } };
return (i2c_transfer(adapter, msgs, 1) == 1) ? 0 : -1;
}
struct i2c_msg msgs[2] = {{.addr = adr, .flags = 0,
.buf = msg, .len = 2},
{.addr = adr, .flags = I2C_M_RD,
- .buf = val, .len = 1}};
+ .buf = val, .len = 1} };
return (i2c_transfer(adapter, msgs, 2) == 2) ? 0 : -1;
}
if (i2c_read(i2c, 0x29+port, &val) < 0)
return 0;
- printk("DRXK@%02x\n", 0x29+port);
return 1;
}
static int demod_attach_drxk(struct ngene_channel *chan,
struct i2c_adapter *i2c)
{
- struct dvb_frontend *fe;
-
- chan->fe = fe = dvb_attach(drxk_attach,
+ chan->fe = dvb_attach(drxk_attach,
i2c, 0x29 + (chan->number^2),
&chan->fe2);
if (!chan->fe) {
- printk("No DRXK found!\n");
+ printk(KERN_ERR "No DRXK found!\n");
return -ENODEV;
}
- fe->sec_priv = chan;
- chan->gate_ctrl = fe->ops.i2c_gate_ctrl;
- fe->ops.i2c_gate_ctrl = drxk_gate_ctrl;
+ chan->fe->sec_priv = chan;
+ chan->gate_ctrl = chan->fe->ops.i2c_gate_ctrl;
+ chan->fe->ops.i2c_gate_ctrl = drxk_gate_ctrl;
return 0;
}
i2c = &chan->dev->channel[1].i2c_adapter;
if (port_has_stv0900(i2c, chan->number)) {
- chan->demod_type=0;
+ chan->demod_type = 0;
fe_conf = chan->dev->card_info->fe_config[chan->number];
/* demod found, attach it */
rc = demod_attach_stv0900(chan);
if (rc < 0 || chan->number < 2)
return rc;
-
+
/* demod #2: reprogram outputs DPN1 & DPN2 */
i2c_msg.addr = fe_conf->address;
i2c_msg.len = 3;
buf[0] = 0xf1;
- switch (chan->number)
- {
+ switch (chan->number) {
case 2:
buf[1] = 0x5c;
buf[2] = 0xc2;
return -EIO;
}
} else if (port_has_drxk(i2c, chan->number^2)) {
- chan->demod_type=1;
+ chan->demod_type = 1;
demod_attach_drxk(chan, i2c);
} else {
- printk("No demod found on chan %d\n", chan->number);
+ printk(KERN_ERR "No demod found on chan %d\n", chan->number);
}
return 0;
}
/****************************************************************************/
static pci_ers_result_t ngene_error_detected(struct pci_dev *dev,
- enum pci_channel_state state)
+ enum pci_channel_state state)
{
printk(KERN_ERR DEVICE_NAME ": PCI error\n");
if (state == pci_channel_io_perm_failure)
#include "ngene.h"
-static int one_adapter = 0;
+static int one_adapter;
module_param(one_adapter, int, 0444);
MODULE_PARM_DESC(one_adapter, "Use only one adapter.");
chan->ci_dev = NULL;
}
- if (chan->fe2) {
+ if (chan->fe2)
dvb_unregister_frontend(chan->fe2);
- }
+
if (chan->fe) {
dvb_unregister_frontend(chan->fe);
dvb_frontend_detach(chan->fe);
if (chan->fe2) {
if (dvb_register_frontend(adapter, chan->fe2) < 0)
goto err;
- chan->fe2->tuner_priv=chan->fe->tuner_priv;
- memcpy(&chan->fe2->ops.tuner_ops,
- &chan->fe->ops.tuner_ops,
- sizeof(struct dvb_tuner_ops));
+ chan->fe2->tuner_priv = chan->fe->tuner_priv;
+ memcpy(&chan->fe2->ops.tuner_ops,
+ &chan->fe->ops.tuner_ops,
+ sizeof(struct dvb_tuner_ops));
}
if (chan->has_demux) {