1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

change output functions from pr_ to dev_

This commit is contained in:
Ralph Metzler 2017-08-25 23:30:58 +02:00
parent df4f23384b
commit 5074e28e10
6 changed files with 194 additions and 186 deletions

View File

@ -151,7 +151,6 @@ static int ddb_unredirect(struct ddb_port *port)
struct ddb_input *oredi, *iredi = 0; struct ddb_input *oredi, *iredi = 0;
struct ddb_output *iredo = 0; struct ddb_output *iredo = 0;
/*pr_info("DDBridge: unredirect %d.%d\n", port->dev->nr, port->nr);*/
mutex_lock(&redirect_lock); mutex_lock(&redirect_lock);
if (port->output->dma->running) { if (port->output->dma->running) {
mutex_unlock(&redirect_lock); mutex_unlock(&redirect_lock);
@ -445,7 +444,6 @@ static void ddb_output_start(struct ddb_output *output)
struct ddb *dev = output->port->dev; struct ddb *dev = output->port->dev;
u32 con = 0x11c, con2 = 0; u32 con = 0x11c, con2 = 0;
pr_info("Channel Base = %08x\n", output->regs);
if (output->dma) { if (output->dma) {
spin_lock_irq(&output->dma->lock); spin_lock_irq(&output->dma->lock);
output->dma->cbuf = 0; output->dma->cbuf = 0;
@ -781,7 +779,7 @@ static u32 ddb_input_avail(struct ddb_input *input)
off = (stat & 0x7ff) << 7; off = (stat & 0x7ff) << 7;
if (ctrl & 4) { if (ctrl & 4) {
pr_err("DDBridge: IA %d %d %08x\n", idx, off, ctrl); dev_err(dev->dev, "IA %d %d %08x\n", idx, off, ctrl);
ddbwritel(dev, stat, DMA_BUFFER_ACK(input->dma)); ddbwritel(dev, stat, DMA_BUFFER_ACK(input->dma));
return 0; return 0;
} }
@ -1061,7 +1059,8 @@ static int demod_attach_drxk(struct ddb_input *input)
i2c, 0x29 + (input->nr & 1), i2c, 0x29 + (input->nr & 1),
&dvb->fe2); &dvb->fe2);
if (!fe) { if (!fe) {
pr_err("DDBridge: No DRXK found!\n"); dev_err(input->port->dev->dev,
"No DRXK found!\n");
return -ENODEV; return -ENODEV;
} }
fe->sec_priv = input; fe->sec_priv = input;
@ -1085,7 +1084,8 @@ static int demod_attach_cxd2843(struct ddb_input *input, int par, int osc24)
fe = dvb->fe = dvb_attach(cxd2843_attach, i2c, &cfg); fe = dvb->fe = dvb_attach(cxd2843_attach, i2c, &cfg);
if (!dvb->fe) { if (!dvb->fe) {
pr_err("DDBridge: No cxd2837/38/43/54 found!\n"); dev_err(input->port->dev->dev,
"No cxd2837/38/43/54 found!\n");
return -ENODEV; return -ENODEV;
} }
fe->sec_priv = input; fe->sec_priv = input;
@ -1108,7 +1108,8 @@ static int demod_attach_stv0367dd(struct ddb_input *input)
&cfg, &cfg,
&dvb->fe2); &dvb->fe2);
if (!dvb->fe) { if (!dvb->fe) {
pr_err("DDBridge: No stv0367 found!\n"); dev_err(input->port->dev->dev,
"No stv0367 found!\n");
return -ENODEV; return -ENODEV;
} }
fe->sec_priv = input; fe->sec_priv = input;
@ -1129,7 +1130,8 @@ static int tuner_attach_tda18271(struct ddb_input *input)
if (dvb->fe->ops.i2c_gate_ctrl) if (dvb->fe->ops.i2c_gate_ctrl)
dvb->fe->ops.i2c_gate_ctrl(dvb->fe, 0); dvb->fe->ops.i2c_gate_ctrl(dvb->fe, 0);
if (!fe) { if (!fe) {
pr_err("DDBridge: No TDA18271 found!\n"); dev_err(input->port->dev->dev,
"No TDA18271 found!\n");
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
@ -1144,7 +1146,8 @@ static int tuner_attach_tda18212dd(struct ddb_input *input)
fe = dvb_attach(tda18212dd_attach, dvb->fe, i2c, fe = dvb_attach(tda18212dd_attach, dvb->fe, i2c,
(input->nr & 1) ? 0x63 : 0x60); (input->nr & 1) ? 0x63 : 0x60);
if (!fe) { if (!fe) {
pr_err("DDBridge: No TDA18212 found!\n"); dev_err(input->port->dev->dev,
"No TDA18212 found!\n");
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
@ -1169,7 +1172,8 @@ static int tuner_attach_tda18212(struct ddb_input *input)
cfg = (input->nr & 1) ? &tda18212_1 : &tda18212_0; cfg = (input->nr & 1) ? &tda18212_1 : &tda18212_0;
fe = dvb_attach(tda18212_attach, dvb->fe, i2c, cfg); fe = dvb_attach(tda18212_attach, dvb->fe, i2c, cfg);
if (!fe) { if (!fe) {
pr_err("DDBridge: No TDA18212 found!\n"); dev_err(input->port->dev->dev,
"No TDA18212 found!\n");
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
@ -1246,13 +1250,15 @@ static int demod_attach_stv0900(struct ddb_input *input, int type)
(input->nr & 1) ? STV090x_DEMODULATOR_1 (input->nr & 1) ? STV090x_DEMODULATOR_1
: STV090x_DEMODULATOR_0); : STV090x_DEMODULATOR_0);
if (!dvb->fe) { if (!dvb->fe) {
pr_err("DDBridge: No STV0900 found!\n"); dev_err(input->port->dev->dev,
"No STV0900 found!\n");
return -ENODEV; return -ENODEV;
} }
if (!dvb_attach(lnbh24_attach, dvb->fe, i2c, 0, if (!dvb_attach(lnbh24_attach, dvb->fe, i2c, 0,
0, (input->nr & 1) ? 0, (input->nr & 1) ?
(0x09 - type) : (0x0b - type))) { (0x09 - type) : (0x0b - type))) {
pr_err("DDBridge: No LNBH24 found!\n"); dev_err(input->port->dev->dev,
"No LNBH24 found!\n");
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
@ -1269,10 +1275,12 @@ static int tuner_attach_stv6110(struct ddb_input *input, int type)
ctl = dvb_attach(stv6110x_attach, dvb->fe, tunerconf, i2c); ctl = dvb_attach(stv6110x_attach, dvb->fe, tunerconf, i2c);
if (!ctl) { if (!ctl) {
pr_err("DDBridge: No STV6110X found!\n"); dev_err(input->port->dev->dev,
"No STV6110X found!\n");
return -ENODEV; return -ENODEV;
} }
pr_info("DDBridge: attach tuner input %d adr %02x\n", dev_info(input->port->dev->dev,
"attach tuner input %d adr %02x\n",
input->nr, tunerconf->addr); input->nr, tunerconf->addr);
feconf->tuner_init = ctl->tuner_init; feconf->tuner_init = ctl->tuner_init;
@ -1314,14 +1322,16 @@ static int demod_attach_stv0910(struct ddb_input *input, int type)
&cfg, (input->nr & 1)); &cfg, (input->nr & 1));
} }
if (!dvb->fe) { if (!dvb->fe) {
pr_err("DDBridge: No STV0910 found!\n"); dev_err(input->port->dev->dev,
"No STV0910 found!\n");
return -ENODEV; return -ENODEV;
} }
if (!dvb_attach(lnbh25_attach, dvb->fe, i2c, if (!dvb_attach(lnbh25_attach, dvb->fe, i2c,
((input->nr & 1) ? 0x0d : 0x0c))) { ((input->nr & 1) ? 0x0d : 0x0c))) {
if (!dvb_attach(lnbh25_attach, dvb->fe, i2c, if (!dvb_attach(lnbh25_attach, dvb->fe, i2c,
((input->nr & 1) ? 0x09 : 0x08))) { ((input->nr & 1) ? 0x09 : 0x08))) {
pr_err("DDBridge: No LNBH25 found!\n"); dev_err(input->port->dev->dev,
"No LNBH25 found!\n");
return -ENODEV; return -ENODEV;
} }
} }
@ -1339,7 +1349,8 @@ static int tuner_attach_stv6111(struct ddb_input *input, int type)
if (!fe) { if (!fe) {
fe = dvb_attach(stv6111_attach, dvb->fe, i2c, adr & ~4); fe = dvb_attach(stv6111_attach, dvb->fe, i2c, adr & ~4);
if (!fe) { if (!fe) {
pr_err("DDBridge: No STV6111 found at 0x%02x!\n", adr); dev_err(input->port->dev->dev,
"No STV6111 found at 0x%02x!\n", adr);
return -ENODEV; return -ENODEV;
} }
} }
@ -1351,17 +1362,16 @@ static int lnb_command(struct ddb *dev, u32 link, u32 lnb, u32 cmd)
u32 c, v = 0, tag = DDB_LINK_TAG(link); u32 c, v = 0, tag = DDB_LINK_TAG(link);
v = LNB_TONE & (dev->link[link].lnb.tone << (15 - lnb)); v = LNB_TONE & (dev->link[link].lnb.tone << (15 - lnb));
/*pr_info("lnb_control[%u] = %08x\n", lnb, cmd | v);*/
ddbwritel(dev, cmd | v, tag | LNB_CONTROL(lnb)); ddbwritel(dev, cmd | v, tag | LNB_CONTROL(lnb));
for (c = 0; c < 10; c++) { for (c = 0; c < 10; c++) {
v = ddbreadl(dev, tag | LNB_CONTROL(lnb)); v = ddbreadl(dev, tag | LNB_CONTROL(lnb));
/*pr_info("ctrl = %08x\n", v);*/
if ((v & LNB_BUSY) == 0) if ((v & LNB_BUSY) == 0)
break; break;
msleep(20); msleep(20);
} }
if (c == 10) if (c == 10)
pr_info("DDBridge: lnb_command lnb = %08x cmd = %08x\n", dev_info(dev->dev,
"lnb_command lnb = %08x cmd = %08x\n",
lnb, cmd); lnb, cmd);
return 0; return 0;
} }
@ -1654,7 +1664,8 @@ static int mxl_fw_read(void *priv, u8 *buf, u32 len)
struct ddb_link *link = priv; struct ddb_link *link = priv;
struct ddb *dev = link->dev; struct ddb *dev = link->dev;
pr_info("DDBridge: Read mxl_fw from link %u\n", link->nr); dev_info(dev->dev,
"Read mxl_fw from link %u\n", link->nr);
return ddbridge_flashread(dev, link->nr, buf, 0xc0000, len); return ddbridge_flashread(dev, link->nr, buf, 0xc0000, len);
} }
@ -1665,7 +1676,7 @@ static int lnb_init_fmode(struct ddb *dev, struct ddb_link *link, u32 fm)
if (link->lnb.fmode == fm) if (link->lnb.fmode == fm)
return 0; return 0;
pr_info("DDBridge: Set fmode link %u = %u\n", l, fm); dev_info(dev->dev, "Set fmode link %u = %u\n", l, fm);
mutex_lock(&link->lnb.lock); mutex_lock(&link->lnb.lock);
if (fm == 2 || fm == 1) { if (fm == 2 || fm == 1) {
if (fmode_sat >= 0) { if (fmode_sat >= 0) {
@ -1724,7 +1735,7 @@ static int fe_attach_mxl5xx(struct ddb_input *input)
tuner = 0; tuner = 0;
dvb->fe = dvb_attach(mxl5xx_attach, i2c, &cfg, demod, tuner); dvb->fe = dvb_attach(mxl5xx_attach, i2c, &cfg, demod, tuner);
if (!dvb->fe) { if (!dvb->fe) {
pr_err("DDBridge: No MXL5XX found!\n"); dev_err(dev->dev, "No MXL5XX found!\n");
return -ENODEV; return -ENODEV;
} }
if (input->nr < 4) { if (input->nr < 4) {
@ -2091,7 +2102,8 @@ static int port_has_encti(struct ddb_port *port)
int ret = i2c_read_reg(&port->i2c->adap, 0x20, 0, &val); int ret = i2c_read_reg(&port->i2c->adap, 0x20, 0, &val);
if (!ret) if (!ret)
pr_info("DDBridge: [0x20]=0x%02x\n", val); dev_info(port->dev->dev,
"[0x20]=0x%02x\n", val);
return ret ? 0 : 1; return ret ? 0 : 1;
} }
@ -2187,7 +2199,7 @@ static int init_xo2(struct ddb_port *port)
return res; return res;
if (data[0] != 0x01) { if (data[0] != 0x01) {
pr_info("DDBridge: Port %d: invalid XO2\n", port->nr); dev_info(dev->dev, "Port %d: invalid XO2\n", port->nr);
return -1; return -1;
} }
@ -2206,7 +2218,7 @@ static int init_xo2(struct ddb_port *port)
i2c_write_reg(i2c, 0x10, 0x09, xo2_speed); i2c_write_reg(i2c, 0x10, 0x09, xo2_speed);
if (dev->link[port->lnr].info->con_clock) { if (dev->link[port->lnr].info->con_clock) {
pr_info("DDBridge: Setting continuous clock for XO2\n"); dev_info(dev->dev, "Setting continuous clock for XO2\n");
i2c_write_reg(i2c, 0x10, 0x0a, 0x03); i2c_write_reg(i2c, 0x10, 0x0a, 0x03);
i2c_write_reg(i2c, 0x10, 0x0b, 0x03); i2c_write_reg(i2c, 0x10, 0x0b, 0x03);
} else { } else {
@ -2233,11 +2245,11 @@ static int init_xo2_ci(struct ddb_port *port)
return res; return res;
if (data[0] > 1) { if (data[0] > 1) {
pr_info("DDBridge: Port %d: invalid XO2 CI %02x\n", dev_info(dev->dev, "Port %d: invalid XO2 CI %02x\n",
port->nr, data[0]); port->nr, data[0]);
return -1; return -1;
} }
pr_info("DDBridge: Port %d: DuoFlex CI %u.%u\n", dev_info(dev->dev, "Port %d: DuoFlex CI %u.%u\n",
port->nr, data[0], data[1]); port->nr, data[0], data[1]);
i2c_read_reg(i2c, 0x10, 0x08, &val); i2c_read_reg(i2c, 0x10, 0x08, &val);
@ -2257,7 +2269,7 @@ static int init_xo2_ci(struct ddb_port *port)
usleep_range(2000, 3000); usleep_range(2000, 3000);
if (dev->link[port->lnr].info->con_clock) { if (dev->link[port->lnr].info->con_clock) {
pr_info("DDBridge: Setting continuous clock for DuoFLex CI\n"); dev_info(dev->dev, "Setting continuous clock for DuoFLex CI\n");
i2c_write_reg(i2c, 0x10, 0x0a, 0x03); i2c_write_reg(i2c, 0x10, 0x0a, 0x03);
i2c_write_reg(i2c, 0x10, 0x0b, 0x03); i2c_write_reg(i2c, 0x10, 0x0b, 0x03);
} else { } else {
@ -2366,13 +2378,13 @@ static void ddb_port_probe(struct ddb_port *port)
ddbwritel(dev, I2C_SPEED_400, ddbwritel(dev, I2C_SPEED_400,
port->i2c->regs + I2C_TIMING); port->i2c->regs + I2C_TIMING);
} else { } else {
pr_info("DDBridge: Port %d: Uninitialized DuoFlex\n", dev_info(dev->dev, "Port %d: Uninitialized DuoFlex\n",
port->nr); port->nr);
return; return;
} }
} else if (port_has_xo2(port, &type, &id)) { } else if (port_has_xo2(port, &type, &id)) {
ddbwritel(dev, I2C_SPEED_400, port->i2c->regs + I2C_TIMING); ddbwritel(dev, I2C_SPEED_400, port->i2c->regs + I2C_TIMING);
pr_info("DDBridge: XO2 ID %02x\n", id); dev_info(dev->dev, "XO2 ID %02x\n", id);
if (type == 2) { if (type == 2) {
port->name = "DuoFlex CI"; port->name = "DuoFlex CI";
port->class = DDB_PORT_CI; port->class = DDB_PORT_CI;
@ -2674,7 +2686,6 @@ static int slot_reset_xo2(struct dvb_ca_en50221 *ca, int slot)
{ {
struct ddb_ci *ci = ca->data; struct ddb_ci *ci = ca->data;
pr_info("DDBridge: %s\n", __func__);
write_creg(ci, 0x01, 0x01); write_creg(ci, 0x01, 0x01);
write_creg(ci, 0x04, 0x04); write_creg(ci, 0x04, 0x04);
msleep(20); msleep(20);
@ -2688,7 +2699,6 @@ static int slot_shutdown_xo2(struct dvb_ca_en50221 *ca, int slot)
{ {
struct ddb_ci *ci = ca->data; struct ddb_ci *ci = ca->data;
pr_info("DDBridge: %s\n", __func__);
/*i2c_write_reg(i2c, adr, 0x03, 0x60);*/ /*i2c_write_reg(i2c, adr, 0x03, 0x60);*/
/*i2c_write_reg(i2c, adr, 0x00, 0xc0);*/ /*i2c_write_reg(i2c, adr, 0x00, 0xc0);*/
write_creg(ci, 0x10, 0xff); write_creg(ci, 0x10, 0xff);
@ -2700,7 +2710,6 @@ static int slot_ts_enable_xo2(struct dvb_ca_en50221 *ca, int slot)
{ {
struct ddb_ci *ci = ca->data; struct ddb_ci *ci = ca->data;
pr_info("DDBridge: %s\n", __func__);
write_creg(ci, 0x00, 0x10); write_creg(ci, 0x00, 0x10);
return 0; return 0;
} }
@ -2830,7 +2839,7 @@ static int ddb_port_attach(struct ddb_port *port)
break; break;
} }
if (ret < 0) if (ret < 0)
pr_err("DDBridge: port_attach on port %d failed\n", port->nr); dev_err(port->dev->dev, "port_attach on port %d failed\n", port->nr);
return ret; return ret;
} }
@ -2842,12 +2851,12 @@ static int ddb_ports_attach(struct ddb *dev)
dev->ns_num = dev->link[0].info->ns_num; dev->ns_num = dev->link[0].info->ns_num;
for (i = 0; i < dev->ns_num; i++) for (i = 0; i < dev->ns_num; i++)
dev->ns[i].nr = i; dev->ns[i].nr = i;
pr_info("DDBridge: %d netstream channels\n", dev->ns_num); dev_info(dev->dev, "%d netstream channels\n", dev->ns_num);
if (dev->port_num) { if (dev->port_num) {
ret = dvb_register_adapters(dev); ret = dvb_register_adapters(dev);
if (ret < 0) { if (ret < 0) {
pr_err("DDBridge: Registering adapters failed. Check DVB_MAX_ADAPTERS in config.\n"); dev_err(dev->dev, "Registering adapters failed. Check DVB_MAX_ADAPTERS in config.\n");
return ret; return ret;
} }
} }
@ -2932,14 +2941,14 @@ static void input_write_dvb(struct ddb_input *input,
while (dma->cbuf != ((dma->stat >> 11) & 0x1f) while (dma->cbuf != ((dma->stat >> 11) & 0x1f)
|| (4 & dma->ctrl)) { || (4 & dma->ctrl)) {
if (4 & dma->ctrl) { if (4 & dma->ctrl) {
/*pr_err("DDBridge: Overflow dma %d\n", dma->nr);*/ /*dev_err(dev->dev, "Overflow dma %d\n", dma->nr);*/
ack = 1; ack = 1;
} }
if (alt_dma) if (alt_dma)
dma_sync_single_for_cpu(dev->dev, dma2->pbuf[dma->cbuf], dma_sync_single_for_cpu(dev->dev, dma2->pbuf[dma->cbuf],
dma2->size, DMA_FROM_DEVICE); dma2->size, DMA_FROM_DEVICE);
#if 0 #if 0
pr_info("DDBridge: %02x %02x %02x %02x\n", dev_info(dev->dev, "%02x %02x %02x %02x\n",
dma2->vbuf[dma->cbuf][0], dma2->vbuf[dma->cbuf][1], dma2->vbuf[dma->cbuf][0], dma2->vbuf[dma->cbuf][1],
dma2->vbuf[dma->cbuf][2], dma2->vbuf[dma->cbuf][3]); dma2->vbuf[dma->cbuf][2], dma2->vbuf[dma->cbuf][3]);
#endif #endif
@ -2979,7 +2988,7 @@ static void input_tasklet(unsigned long data)
#if 0 #if 0
if (4 & dma->ctrl) if (4 & dma->ctrl)
pr_err("DDBridge: Overflow dma %d\n", dma->nr); dev_err(dev->dev, "Overflow dma %d\n", dma->nr);
#endif #endif
if (input->redi) if (input->redi)
input_write_dvb(input, input->redi); input_write_dvb(input, input->redi);
@ -3085,7 +3094,7 @@ static void ddb_dma_init(struct ddb_io *io, int nr, int out)
dma->div = INPUT_DMA_IRQ_DIV; dma->div = INPUT_DMA_IRQ_DIV;
} }
ddbwritel(io->port->dev, 0, DMA_BUFFER_ACK(dma)); ddbwritel(io->port->dev, 0, DMA_BUFFER_ACK(dma));
pr_info("DDBridge: init link %u, io %u, dma %u, dmaregs %08x bufregs %08x\n", dev_info(io->port->dev->dev, "init link %u, io %u, dma %u, dmaregs %08x bufregs %08x\n",
io->port->lnr, io->nr, nr, dma->regs, dma->bufregs); io->port->lnr, io->nr, nr, dma->regs, dma->bufregs);
} }
@ -3101,7 +3110,7 @@ static void ddb_input_init(struct ddb_port *port, int nr, int pnr, int anr)
rm = io_regmap(input, 1); rm = io_regmap(input, 1);
input->regs = DDB_LINK_TAG(port->lnr) | input->regs = DDB_LINK_TAG(port->lnr) |
(rm->input->base + rm->input->size * nr); (rm->input->base + rm->input->size * nr);
pr_info("DDBridge: init link %u, input %u, regs %08x\n", dev_info(dev->dev, "init link %u, input %u, regs %08x\n",
port->lnr, nr, input->regs); port->lnr, nr, input->regs);
if (dev->has_dma) { if (dev->has_dma) {
struct ddb_regmap *rm0 = io_regmap(input, 0); struct ddb_regmap *rm0 = io_regmap(input, 0);
@ -3111,7 +3120,7 @@ static void ddb_input_init(struct ddb_port *port, int nr, int pnr, int anr)
if (port->lnr) if (port->lnr)
dma_nr += 32 + (port->lnr - 1) * 8; dma_nr += 32 + (port->lnr - 1) * 8;
pr_info("DDBridge: init link %u, input %u, handler %u\n", dev_info(dev->dev, "init link %u, input %u, handler %u\n",
port->lnr, nr, dma_nr + base); port->lnr, nr, dma_nr + base);
dev->handler[0][dma_nr + base] = input_handler; dev->handler[0][dma_nr + base] = input_handler;
dev->handler_data[0][dma_nr + base] = (unsigned long) input; dev->handler_data[0][dma_nr + base] = (unsigned long) input;
@ -3131,7 +3140,7 @@ static void ddb_output_init(struct ddb_port *port, int nr)
rm = io_regmap(output, 1); rm = io_regmap(output, 1);
output->regs = DDB_LINK_TAG(port->lnr) | output->regs = DDB_LINK_TAG(port->lnr) |
(rm->output->base + rm->output->size * nr); (rm->output->base + rm->output->size * nr);
pr_info("DDBridge: init link %u, output %u, regs %08x\n", dev_info(dev->dev, "init link %u, output %u, regs %08x\n",
port->lnr, nr, output->regs); port->lnr, nr, output->regs);
if (dev->has_dma) { if (dev->has_dma) {
struct ddb_regmap *rm0 = io_regmap(output, 0); struct ddb_regmap *rm0 = io_regmap(output, 0);
@ -3210,7 +3219,7 @@ static void ddb_ports_init(struct ddb *dev)
port->name = "DuoFlex CI_B"; port->name = "DuoFlex CI_B";
port->i2c = dev->port[p - 1].i2c; port->i2c = dev->port[p - 1].i2c;
} }
pr_info("DDBridge: Port %u: Link %u, Link Port %u (TAB %u): %s\n", dev_info(dev->dev, "Port %u: Link %u, Link Port %u (TAB %u): %s\n",
port->pnr, port->lnr, port->nr, port->pnr, port->lnr, port->nr,
port->nr + 1, port->name); port->nr + 1, port->name);
@ -3507,8 +3516,6 @@ static irqreturn_t irq_thread(int irq, void *dev_id)
{ {
/* struct ddb *dev = (struct ddb *) dev_id; */ /* struct ddb *dev = (struct ddb *) dev_id; */
/*pr_info("DDBridge: %s\n", __func__);*/
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#endif #endif
@ -3576,7 +3583,7 @@ static int nsd_do_ioctl(struct file *file, unsigned int cmd, void *parg)
((ts->filter_mask & 3) << 2); ((ts->filter_mask & 3) << 2);
if (ddbreadl(dev, TS_CAPTURE_CONTROL) & 1) { if (ddbreadl(dev, TS_CAPTURE_CONTROL) & 1) {
pr_info("DDBridge: ts capture busy\n"); dev_info(dev->dev, "ts capture busy\n");
return -EBUSY; return -EBUSY;
} }
ddb_dvb_ns_input_start(input); ddb_dvb_ns_input_start(input);
@ -3609,10 +3616,8 @@ static int nsd_do_ioctl(struct file *file, unsigned int cmd, void *parg)
if (ctrl & 1) if (ctrl & 1)
return -EBUSY; return -EBUSY;
if (ctrl & (1 << 14)) { if (ctrl & (1 << 14))
/*pr_info("DDBridge: ts capture timeout\n");*/
return -EAGAIN; return -EAGAIN;
}
ddbcpyfrom(dev, dev->tsbuf, TS_CAPTURE_MEMORY, ddbcpyfrom(dev, dev->tsbuf, TS_CAPTURE_MEMORY,
TS_CAPTURE_LEN); TS_CAPTURE_LEN);
ts->len = ddbreadl(dev, TS_CAPTURE_RECEIVED) & 0x1fff; ts->len = ddbreadl(dev, TS_CAPTURE_RECEIVED) & 0x1fff;
@ -3624,10 +3629,8 @@ static int nsd_do_ioctl(struct file *file, unsigned int cmd, void *parg)
{ {
u32 ctrl = 0; u32 ctrl = 0;
/*pr_info("DDBridge: cancel ts capture: 0x%x\n", ctrl);*/
ddbwritel(dev, ctrl, TS_CAPTURE_CONTROL); ddbwritel(dev, ctrl, TS_CAPTURE_CONTROL);
ctrl = ddbreadl(dev, TS_CAPTURE_CONTROL); ctrl = ddbreadl(dev, TS_CAPTURE_CONTROL);
/*pr_info("DDBridge: control register is 0x%x\n", ctrl);*/
break; break;
} }
case NSD_STOP_GET_TS: case NSD_STOP_GET_TS:
@ -3639,10 +3642,10 @@ static int nsd_do_ioctl(struct file *file, unsigned int cmd, void *parg)
if (!input) if (!input)
return -EINVAL; return -EINVAL;
if (ctrl & 1) { if (ctrl & 1) {
pr_info("DDBridge: cannot stop ts capture, while it was neither finished nor canceled\n"); dev_info(dev->dev,
"cannot stop ts capture, while it was neither finished nor canceled\n");
return -EBUSY; return -EBUSY;
} }
/*pr_info("DDBridge: ts capture stopped\n");*/
ddb_dvb_ns_input_stop(input); ddb_dvb_ns_input_stop(input);
break; break;
} }
@ -4451,7 +4454,7 @@ static ssize_t redirect_store(struct device *device,
res = ddb_redirect(i, p); res = ddb_redirect(i, p);
if (res < 0) if (res < 0)
return res; return res;
pr_info("DDBridge: redirect: %02x, %02x\n", i, p); dev_info(device, "redirect: %02x, %02x\n", i, p);
return count; return count;
} }
@ -4476,7 +4479,7 @@ static ssize_t redirect2_store(struct device *device,
res = ddb_redirect(i, p); res = ddb_redirect(i, p);
if (res < 0) if (res < 0)
return res; return res;
pr_info("DDBridge: redirect: %02x, %02x\n", i, p); dev_info(device, "redirect: %02x, %02x\n", i, p);
return count; return count;
} }
#endif #endif
@ -4799,7 +4802,7 @@ static int ddb_device_create(struct ddb *dev)
dev, "ddbridge%d", dev->nr); dev, "ddbridge%d", dev->nr);
if (IS_ERR(dev->ddb_dev)) { if (IS_ERR(dev->ddb_dev)) {
res = PTR_ERR(dev->ddb_dev); res = PTR_ERR(dev->ddb_dev);
pr_info("DDBridge: Could not create ddbridge%d\n", dev->nr); dev_info(dev->dev, "Could not create ddbridge%d\n", dev->nr);
goto fail; goto fail;
} }
res = ddb_device_attrs_add(dev); res = ddb_device_attrs_add(dev);
@ -4833,7 +4836,7 @@ static void gtl_link_handler(unsigned long priv)
struct ddb *dev = (struct ddb *) priv; struct ddb *dev = (struct ddb *) priv;
u32 regs = dev->link[0].info->regmap->gtl->base; u32 regs = dev->link[0].info->regmap->gtl->base;
pr_info("DDBridge: GT link change: %u\n", dev_info(dev->dev, "GT link change: %u\n",
(1 & ddbreadl(dev, regs))); (1 & ddbreadl(dev, regs)));
} }
@ -4845,7 +4848,7 @@ static void link_tasklet(unsigned long data)
u32 l = link->nr; u32 l = link->nr;
s = ddbreadl(dev, tag | INTERRUPT_STATUS); s = ddbreadl(dev, tag | INTERRUPT_STATUS);
pr_info("DDBridge: gtl_irq %08x = %08x\n", tag | INTERRUPT_STATUS, s); dev_info(dev->dev, "gtl_irq %08x = %08x\n", tag | INTERRUPT_STATUS, s);
if (!s) if (!s)
return; return;
@ -4866,7 +4869,6 @@ static void gtl_irq_handler(unsigned long priv)
while ((s = ddbreadl(dev, tag | INTERRUPT_STATUS))) { while ((s = ddbreadl(dev, tag | INTERRUPT_STATUS))) {
ddbwritel(dev, s, tag | INTERRUPT_ACK); ddbwritel(dev, s, tag | INTERRUPT_ACK);
//pr_info("DDBridge: gtlirq %08x\n", s);
LINK_IRQ_HANDLE(l, 0); LINK_IRQ_HANDLE(l, 0);
LINK_IRQ_HANDLE(l, 1); LINK_IRQ_HANDLE(l, 1);
LINK_IRQ_HANDLE(l, 2); LINK_IRQ_HANDLE(l, 2);
@ -4885,7 +4887,7 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
(l - 1) * dev->link[0].info->regmap->gtl->size; (l - 1) * dev->link[0].info->regmap->gtl->size;
u32 id, subid, base = dev->link[0].info->regmap->irq_base_gtl; u32 id, subid, base = dev->link[0].info->regmap->irq_base_gtl;
pr_info("DDBridge: Checking GT link %u: regs = %08x\n", l, regs); dev_info(dev->dev, "Checking GT link %u: regs = %08x\n", l, regs);
spin_lock_init(&link->lock); spin_lock_init(&link->lock);
mutex_init(&link->lnb.lock); mutex_init(&link->lnb.lock);
@ -4916,7 +4918,8 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
subid & 0xffff, subid >> 16); subid & 0xffff, subid >> 16);
if (link->info->type != DDB_OCTOPUS_MAX_CT && if (link->info->type != DDB_OCTOPUS_MAX_CT &&
link->info->type != DDB_OCTOPUS_MAX) { link->info->type != DDB_OCTOPUS_MAX) {
pr_info("DDBridge: Detected GT link but found invalid ID %08x. You might have to update (flash) the add-on card first.", dev_info(dev->dev,
"Detected GT link but found invalid ID %08x. You might have to update (flash) the add-on card first.",
id); id);
return -1; return -1;
} }
@ -4934,12 +4937,12 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
dev->link[l].ids.subvendor = subid & 0xffff; dev->link[l].ids.subvendor = subid & 0xffff;
dev->link[l].ids.subdevice = subid >> 16; dev->link[l].ids.subdevice = subid >> 16;
pr_info("DDBridge: GTL %s\n", dev->link[l].info->name); dev_info(dev->dev, "GTL %s\n", dev->link[l].info->name);
pr_info("DDBridge: GTL HW %08x REGMAP %08x\n", dev_info(dev->dev, "GTL HW %08x REGMAP %08x\n",
dev->link[l].ids.hwid, dev->link[l].ids.hwid,
dev->link[l].ids.regmapid); dev->link[l].ids.regmapid);
pr_info("DDBridge: GTL ID %08x\n", dev_info(dev->dev, "GTL ID %08x\n",
ddbreadl(dev, DDB_LINK_TAG(l) | 8)); ddbreadl(dev, DDB_LINK_TAG(l) | 8));
tasklet_init(&link->tasklet, link_tasklet, (unsigned long) link); tasklet_init(&link->tasklet, link_tasklet, (unsigned long) link);
@ -4970,7 +4973,7 @@ static void tempmon_setfan(struct ddb_link *link)
if ((ddblreadl(link, TEMPMON_CONTROL) & if ((ddblreadl(link, TEMPMON_CONTROL) &
TEMPMON_CONTROL_OVERTEMP) != 0) { TEMPMON_CONTROL_OVERTEMP) != 0) {
pr_info("DDBridge: Over temperature condition\n"); dev_info(link->dev->dev, "Over temperature condition\n");
link->OverTemperatureError = 1; link->OverTemperatureError = 1;
} }
temp = (ddblreadl(link, TEMPMON_SENSOR0) >> 8) & 0xFF; temp = (ddblreadl(link, TEMPMON_SENSOR0) >> 8) & 0xFF;
@ -5031,7 +5034,7 @@ static int tempmon_init(struct ddb_link *link, int FirstTime)
((ddblreadl(link, TEMPMON_CONTROL) & ((ddblreadl(link, TEMPMON_CONTROL) &
TEMPMON_CONTROL_OVERTEMP) != 0); TEMPMON_CONTROL_OVERTEMP) != 0);
if (link->OverTemperatureError) { if (link->OverTemperatureError) {
pr_info("DDBridge: Over temperature condition\n"); dev_info(dev->dev, "Over temperature condition\n");
status = -1; status = -1;
} }
tempmon_setfan(link); tempmon_setfan(link);
@ -5068,7 +5071,8 @@ static int ddb_init_boards(struct ddb *dev)
info = link->info; info = link->info;
if (!info) if (!info)
continue; continue;
pr_info("DDBridge: link %u vendor %04x device %04x subvendor %04x subdevice %04x\n", dev_info(dev->dev,
"link %u vendor %04x device %04x subvendor %04x subdevice %04x\n",
l, l,
dev->link[l].ids.vendor, dev->link[l].ids.device, dev->link[l].ids.vendor, dev->link[l].ids.device,
dev->link[l].ids.subvendor, dev->link[l].ids.subdevice); dev->link[l].ids.subvendor, dev->link[l].ids.subdevice);
@ -5112,7 +5116,8 @@ int ddb_init(struct ddb *dev)
goto fail; goto fail;
ddb_ports_init(dev); ddb_ports_init(dev);
if (ddb_buffers_alloc(dev) < 0) { if (ddb_buffers_alloc(dev) < 0) {
pr_info("DDBridge: Could not allocate buffer memory\n"); dev_info(dev->dev,
"Could not allocate buffer memory\n");
goto fail2; goto fail2;
} }
if (ddb_ports_attach(dev) < 0) if (ddb_ports_attach(dev) < 0)
@ -5131,14 +5136,14 @@ int ddb_init(struct ddb *dev)
fail3: fail3:
ddb_ports_detach(dev); ddb_ports_detach(dev);
pr_err("DDBridge: fail3\n"); dev_err(dev->dev, "fail3\n");
ddb_ports_release(dev); ddb_ports_release(dev);
fail2: fail2:
pr_err("DDBridge: fail2\n"); dev_err(dev->dev, "fail2\n");
ddb_buffers_free(dev); ddb_buffers_free(dev);
ddb_i2c_release(dev); ddb_i2c_release(dev);
fail: fail:
pr_err("DDBridge: fail1\n"); dev_err(dev->dev, "fail1\n");
return -1; return -1;
} }

View File

@ -36,7 +36,7 @@ static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
stat = wait_for_completion_timeout(&i2c->completion, HZ); stat = wait_for_completion_timeout(&i2c->completion, HZ);
val = ddbreadl(dev, i2c->regs + I2C_COMMAND); val = ddbreadl(dev, i2c->regs + I2C_COMMAND);
if (stat == 0) { if (stat == 0) {
pr_err("DDBridge: I2C timeout, card %d, port %d, link %u\n", dev_err(dev->dev, "I2C timeout, card %d, port %d, link %u\n",
dev->nr, i2c->nr, i2c->link); dev->nr, i2c->nr, i2c->link);
#if 1 #if 1
{ {

View File

@ -107,22 +107,22 @@ static int __devinit ddb_irq_msi(struct ddb *dev, int nr)
#endif #endif
if (stat >= 1) { if (stat >= 1) {
dev->msi = stat; dev->msi = stat;
pr_info("DDBridge: using %d MSI interrupt(s)\n", dev_info(dev->dev, "using %d MSI interrupt(s)\n",
dev->msi); dev->msi);
} else } else
pr_info("DDBridge: MSI not available.\n"); dev_info(dev->dev, "MSI not available.\n");
#else #else
stat = pci_enable_msi_block(dev->pdev, nr); stat = pci_enable_msi_block(dev->pdev, nr);
if (stat == 0) { if (stat == 0) {
dev->msi = nr; dev->msi = nr;
pr_info("DDBridge: using %d MSI interrupts\n", nr); dev_info(dev->dev, "using %d MSI interrupts\n", nr);
} else if (stat == 1) { } else if (stat == 1) {
stat = pci_enable_msi(dev->pdev); stat = pci_enable_msi(dev->pdev);
dev->msi = 1; dev->msi = 1;
} }
if (stat < 0) if (stat < 0)
pr_info("DDBridge: MSI not available.\n"); dev_info(dev->dev, "MSI not available.\n");
#endif #endif
} }
#endif #endif
@ -134,7 +134,7 @@ static int __devinit ddb_irq_init2(struct ddb *dev)
int stat; int stat;
int irq_flag = IRQF_SHARED; int irq_flag = IRQF_SHARED;
pr_info("DDBridge: init type 2 IRQ hardware block\n"); dev_info(dev->dev, "init type 2 IRQ hardware block\n");
ddbwritel(dev, 0x00000000, INTERRUPT_V2_CONTROL); ddbwritel(dev, 0x00000000, INTERRUPT_V2_CONTROL);
ddbwritel(dev, 0x00000000, INTERRUPT_V2_ENABLE_1); ddbwritel(dev, 0x00000000, INTERRUPT_V2_ENABLE_1);
@ -254,19 +254,19 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
dev->link[0].dev = dev; dev->link[0].dev = dev;
dev->link[0].info = get_ddb_info(id->vendor, id->device, dev->link[0].info = get_ddb_info(id->vendor, id->device,
id->subvendor, pdev->subsystem_device); id->subvendor, pdev->subsystem_device);
pr_info("DDBridge: device name: %s\n", dev->link[0].info->name); dev_info(dev->dev, "device name: %s\n", dev->link[0].info->name);
dev->regs_len = pci_resource_len(dev->pdev, 0); dev->regs_len = pci_resource_len(dev->pdev, 0);
dev->regs = ioremap(pci_resource_start(dev->pdev, 0), dev->regs = ioremap(pci_resource_start(dev->pdev, 0),
pci_resource_len(dev->pdev, 0)); pci_resource_len(dev->pdev, 0));
if (!dev->regs) { if (!dev->regs) {
pr_err("DDBridge: not enough memory for register map\n"); dev_err(dev->dev, "not enough memory for register map\n");
stat = -ENOMEM; stat = -ENOMEM;
goto fail; goto fail;
} }
if (ddbreadl(dev, 0) == 0xffffffff) { if (ddbreadl(dev, 0) == 0xffffffff) {
pr_err("DDBridge: cannot read registers\n"); dev_err(dev->dev, "cannot read registers\n");
stat = -ENODEV; stat = -ENODEV;
goto fail; goto fail;
} }
@ -274,7 +274,7 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
dev->link[0].ids.hwid = ddbreadl(dev, 0); dev->link[0].ids.hwid = ddbreadl(dev, 0);
dev->link[0].ids.regmapid = ddbreadl(dev, 4); dev->link[0].ids.regmapid = ddbreadl(dev, 4);
pr_info("DDBridge: HW %08x REGMAP %08x\n", dev_info(dev->dev, "HW %08x REGMAP %08x\n",
dev->link[0].ids.hwid, dev->link[0].ids.regmapid); dev->link[0].ids.hwid, dev->link[0].ids.regmapid);
if (dev->link[0].info->ns_num) { if (dev->link[0].info->ns_num) {
@ -300,11 +300,11 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
ddb_irq_exit(dev); ddb_irq_exit(dev);
fail0: fail0:
pr_err("DDBridge: fail0\n"); dev_err(dev->dev, "fail0\n");
if (dev->msi) if (dev->msi)
pci_disable_msi(dev->pdev); pci_disable_msi(dev->pdev);
fail: fail:
pr_err("DDBridge: fail\n"); dev_err(dev->dev, "fail\n");
ddb_unmap(dev); ddb_unmap(dev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
@ -353,7 +353,7 @@ static __init int module_init_ddbridge(void)
{ {
int stat = -1; int stat = -1;
pr_info("DDBridge: Digital Devices PCIE bridge driver " pr_info("Digital Devices PCIE bridge driver "
DDBRIDGE_VERSION DDBRIDGE_VERSION
", Copyright (C) 2010-17 Digital Devices GmbH\n"); ", Copyright (C) 2010-17 Digital Devices GmbH\n");
if (ddb_class_create() < 0) if (ddb_class_create() < 0)

View File

@ -188,7 +188,7 @@ void ddbridge_mod_output_stop(struct ddb_output *output)
ddbwritel(dev, 0, CHANNEL_CONTROL(output->nr)); ddbwritel(dev, 0, CHANNEL_CONTROL(output->nr));
#endif #endif
mod_busy(dev, output->nr); mod_busy(dev, output->nr);
pr_info("DDBridge: mod_output_stop %d.%d\n", dev->nr, output->nr); dev_info(dev->dev, "mod_output_stop %d.%d\n", dev->nr, output->nr);
} }
static void mod_set_incs(struct ddb_output *output) static void mod_set_incs(struct ddb_output *output)
@ -223,8 +223,10 @@ static void mod_calc_rateinc(struct ddb_mod *mod)
{ {
u32 ri; u32 ri;
pr_info("DDBridge: ibitrate %llu\n", mod->ibitrate); dev_info(mod->port->dev->dev,
pr_info("DDBridge: obitrate %llu\n", mod->obitrate); "ibitrate %llu\n", mod->ibitrate);
dev_info(mod->port->dev->dev,
"obitrate %llu\n", mod->obitrate);
if (mod->ibitrate != 0) { if (mod->ibitrate != 0) {
u64 d = mod->obitrate - mod->ibitrate; u64 d = mod->obitrate - mod->ibitrate;
@ -237,7 +239,8 @@ static void mod_calc_rateinc(struct ddb_mod *mod)
} else } else
ri = 0; ri = 0;
mod->rate_inc = ri; mod->rate_inc = ri;
pr_info("DDBridge: ibr=%llu, obr=%llu, ri=0x%06x\n", dev_info(mod->port->dev->dev,
"ibr=%llu, obr=%llu, ri=0x%06x\n",
mod->ibitrate >> 32, mod->obitrate >> 32, ri); mod->ibitrate >> 32, mod->obitrate >> 32, ri);
} }
@ -369,7 +372,7 @@ int ddbridge_mod_output_start(struct ddb_output *output)
if (checkLF <= 1) if (checkLF <= 1)
return -EINVAL; return -EINVAL;
pr_info("DDBridge: KF=%u LF=%u Output=%u mod=%u\n", dev_info(dev->dev, "KF=%u LF=%u Output=%u mod=%u\n",
KF, LF, Output, mod->modulation); KF, LF, Output, mod->modulation);
ddbwritel(dev, KF, CHANNEL_KF(Channel)); ddbwritel(dev, KF, CHANNEL_KF(Channel));
ddbwritel(dev, LF, CHANNEL_LF(Channel)); ddbwritel(dev, LF, CHANNEL_LF(Channel));
@ -400,7 +403,7 @@ int ddbridge_mod_output_start(struct ddb_output *output)
if (mod_SendChannelCommand(dev, Channel, if (mod_SendChannelCommand(dev, Channel,
CHANNEL_CONTROL_CMD_UNMUTE)) CHANNEL_CONTROL_CMD_UNMUTE))
return -EINVAL; return -EINVAL;
pr_info("DDBridge: mod_output_start %d.%d ctrl=%08x\n", dev_info(dev->dev, "mod_output_start %d.%d ctrl=%08x\n",
dev->nr, output->nr, mod->Control); dev->nr, output->nr, mod->Control);
return 0; return 0;
} }
@ -500,7 +503,7 @@ static int mod_fsm_setup(struct ddb *dev, u32 FrequencyPlan,
if (MaxUsedChannels == 0) if (MaxUsedChannels == 0)
MaxUsedChannels = (Capacity & FSM_CAPACITY_CUR) >> 16; MaxUsedChannels = (Capacity & FSM_CAPACITY_CUR) >> 16;
pr_info("DDBridge: max used chan = %u\n", MaxUsedChannels); dev_info(dev->dev, "max used chan = %u\n", MaxUsedChannels);
if (MaxUsedChannels <= 1) if (MaxUsedChannels <= 1)
ddbwritel(dev, FSM_GAIN_N1, FSM_GAIN); ddbwritel(dev, FSM_GAIN_N1, FSM_GAIN);
else if (MaxUsedChannels <= 2) else if (MaxUsedChannels <= 2)
@ -680,7 +683,7 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
mod_si598_readreg(dev, 11, &Data[4]); mod_si598_readreg(dev, 11, &Data[4]);
mod_si598_readreg(dev, 12, &Data[5]); mod_si598_readreg(dev, 12, &Data[5]);
pr_info("DDBridge: Data = %02x %02x %02x %02x %02x %02x\n", dev_info(dev->dev, "Data = %02x %02x %02x %02x %02x %02x\n",
Data[0], Data[1], Data[2], Data[3], Data[4], Data[5]); Data[0], Data[1], Data[2], Data[3], Data[4], Data[5]);
RFreq = (((u64)Data[1] & 0x3F) << 32) | ((u64)Data[2] << 24) | RFreq = (((u64)Data[1] & 0x3F) << 32) | ((u64)Data[2] << 24) |
((u64)Data[3] << 16) | ((u64)Data[4] << 8) | ((u64)Data[3] << 16) | ((u64)Data[4] << 8) |
@ -694,13 +697,13 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
((u32)(Data[1] & 0xE0) >> 6)) + 1; ((u32)(Data[1] & 0xE0) >> 6)) + 1;
fDCO = fOut * (u64)(HSDiv * N); fDCO = fOut * (u64)(HSDiv * N);
m_fXtal = fDCO << 28; m_fXtal = fDCO << 28;
pr_info("DDBridge: fxtal %016llx rfreq %016llx\n", dev_info(dev->dev, "fxtal %016llx rfreq %016llx\n",
m_fXtal, RFreq); m_fXtal, RFreq);
m_fXtal += RFreq >> 1; m_fXtal += RFreq >> 1;
m_fXtal = div64_u64(m_fXtal, RFreq); m_fXtal = div64_u64(m_fXtal, RFreq);
pr_info("DDBridge: fOut = %d fXtal = %d fDCO = %d HDIV = %2d, N = %3d\n", dev_info(dev->dev, "fOut = %d fXtal = %d fDCO = %d HDIV = %2d, N = %3d\n",
(u32) fOut, (u32) m_fXtal, (u32) fDCO, (u32) HSDiv, N); (u32) fOut, (u32) m_fXtal, (u32) fDCO, (u32) HSDiv, N);
} }
@ -711,7 +714,7 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
if (Div < MinDiv) if (Div < MinDiv)
Div = Div + 1; Div = Div + 1;
pr_info("DDBridge: fOut = %u MinDiv = %llu MaxDiv = %llu StartDiv = %llu\n", dev_info(dev->dev, "fOut = %u MinDiv = %llu MaxDiv = %llu StartDiv = %llu\n",
fOut, MinDiv, MaxDiv, Div); fOut, MinDiv, MaxDiv, Div);
if (Div <= 11) { if (Div <= 11) {
@ -730,7 +733,7 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
if (N > 128) if (N > 128)
break; break;
} }
pr_info("DDBridge: %3d: %llu %llu %llu %u\n", dev_info(dev->dev, "%3d: %llu %llu %llu %u\n",
retry, Div, HSDiv * N, HSDiv, N); retry, Div, HSDiv * N, HSDiv, N);
if (HSDiv * N < MinDiv) if (HSDiv * N < MinDiv)
Div = Div + 2; Div = Div + 2;
@ -741,7 +744,7 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
retry = retry - 1; retry = retry - 1;
} }
if (retry == 0) { if (retry == 0) {
pr_err("DDBridge: FAIL\n"); dev_err(dev->dev, "FAIL\n");
return -EINVAL; return -EINVAL;
} }
} }
@ -756,16 +759,16 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
fDCO = (u64)fOut * (u64)N * (u64)HSDiv; fDCO = (u64)fOut * (u64)N * (u64)HSDiv;
pr_info("DDBridge: fdco %16llx\n", fDCO); dev_info(dev->dev, "fdco %16llx\n", fDCO);
RFreq = fDCO<<28; RFreq = fDCO<<28;
pr_info("DDBridge: %16llx %16llx\n", fDCO, RFreq); dev_info(dev->dev, "%16llx %16llx\n", fDCO, RFreq);
fxtal = m_fXtal; fxtal = m_fXtal;
do_div(RFreq, fxtal); do_div(RFreq, fxtal);
pr_info("DDBridge: %16llx %d\n", RFreq, fxtal); dev_info(dev->dev, "%16llx %d\n", RFreq, fxtal);
RF = RFreq; RF = RFreq;
pr_info("DDBridge: fOut = %u fXtal = %llu fDCO = %llu HSDIV = %llu, N = %u, RFreq = %llu\n", dev_info(dev->dev, "fOut = %u fXtal = %llu fDCO = %llu HSDIV = %llu, N = %u, RFreq = %llu\n",
fOut, m_fXtal, fDCO, HSDiv, N, RFreq); fOut, m_fXtal, fDCO, HSDiv, N, RFreq);
Data[0] = (u8)(((HSDiv - 4) << 5) | ((N - 1) >> 2)); Data[0] = (u8)(((HSDiv - 4) << 5) | ((N - 1) >> 2));
@ -775,7 +778,7 @@ static int mod_set_si598(struct ddb *dev, u32 freq)
Data[4] = (u8)((RF >> 8) & 0xFF); Data[4] = (u8)((RF >> 8) & 0xFF);
Data[5] = (u8)((RF) & 0xFF); Data[5] = (u8)((RF) & 0xFF);
pr_info("DDBridge: Data = %02x %02x %02x %02x %02x %02x\n", dev_info(dev->dev, "Data = %02x %02x %02x %02x %02x %02x\n",
Data[0], Data[1], Data[2], Data[3], Data[4], Data[5]); Data[0], Data[1], Data[2], Data[3], Data[4], Data[5]);
mod_si598_writereg(dev, 7, Data[0]); mod_si598_writereg(dev, 7, Data[0]);
mod_si598_writereg(dev, 8, Data[1]); mod_si598_writereg(dev, 8, Data[1]);
@ -909,11 +912,11 @@ static int mod_init_dac_input(struct ddb *dev)
} }
if (Sample1 == 0xFF || Sample2 == 0xFF) { if (Sample1 == 0xFF || Sample2 == 0xFF) {
pr_err("DDBridge: No valid window found\n"); dev_err(dev->dev, "No valid window found\n");
return -EINVAL; return -EINVAL;
} }
pr_err("DDBridge: Window = %d - %d\n", Sample1, Sample2); dev_err(dev->dev, "Window = %d - %d\n", Sample1, Sample2);
for (Sample = Sample1; Sample < Sample2; Sample += 1) { for (Sample = Sample1; Sample < Sample2; Sample += 1) {
if (SetTable[Sample] < HldTable[Sample]) { if (SetTable[Sample] < HldTable[Sample]) {
@ -924,15 +927,15 @@ static int mod_init_dac_input(struct ddb *dev)
} }
} }
pr_info("DDBridge: Select Sample %d\n", SelectSample); dev_info(dev->dev, "Select Sample %d\n", SelectSample);
if (SelectSample == 0xFF) { if (SelectSample == 0xFF) {
pr_err("DDBridge: No valid sample found\n"); dev_err(dev->dev, "No valid sample found\n");
return -EINVAL; return -EINVAL;
} }
if (HldTable[SelectSample] + SetTable[SelectSample] < 8) { if (HldTable[SelectSample] + SetTable[SelectSample] < 8) {
pr_err("DDBridge: Too high jitter\n"); dev_err(dev->dev, "Too high jitter\n");
return -EINVAL; return -EINVAL;
} }
@ -947,10 +950,10 @@ static int mod_init_dac_input(struct ddb *dev)
mod_read_dac_register(dev, 0x06, &ReadSeek); mod_read_dac_register(dev, 0x06, &ReadSeek);
Seek &= ReadSeek; Seek &= ReadSeek;
if ((Seek & 0x01) == 0) { if ((Seek & 0x01) == 0) {
pr_err("DDBridge: Insufficient timing margin\n"); dev_err(dev->dev, "Insufficient timing margin\n");
return -EINVAL; return -EINVAL;
} }
pr_info("DDBridge: Done\n"); dev_info(dev->dev, "Done\n");
return 0; return 0;
} }
@ -1007,7 +1010,7 @@ static int mod_set_dac_clock(struct ddb *dev, u32 Frequency)
ddbwritel(dev, DAC_CONTROL_RESET, DAC_CONTROL); ddbwritel(dev, DAC_CONTROL_RESET, DAC_CONTROL);
msleep(20); msleep(20);
if (mod_set_si598(dev, Frequency)) { if (mod_set_si598(dev, Frequency)) {
pr_err("DDBridge: mod_set_si598 failed\n"); dev_err(dev->dev, "mod_set_si598 failed\n");
return -1; return -1;
} }
msleep(50); msleep(50);
@ -1022,7 +1025,7 @@ static int mod_set_dac_clock(struct ddb *dev, u32 Frequency)
break; break;
msleep(100); msleep(100);
} }
pr_info("DDBridge: mod_set_dac_clock OK\n"); dev_info(dev->dev, "mod_set_dac_clock OK\n");
return hr; return hr;
} }
@ -1128,18 +1131,18 @@ static int set_base_frequency(struct ddb *dev, u32 freq)
u32 UP2Frequency = 1896; u32 UP2Frequency = 1896;
u32 down, freq10; u32 down, freq10;
pr_info("DDBridge: set base to %u\n", freq); dev_info(dev->dev, "set base to %u\n", freq);
dev->mod_base.frequency = freq; dev->mod_base.frequency = freq;
freq /= 1000000; freq /= 1000000;
freq10 = dev->mod_base.flat_start + 4; freq10 = dev->mod_base.flat_start + 4;
down = freq + 9 * 8 + freq10 + UP1Frequency + UP2Frequency; down = freq + 9 * 8 + freq10 + UP1Frequency + UP2Frequency;
if ((freq10 + 9 * 8) > (dev->mod_base.flat_end - 4)) { if ((freq10 + 9 * 8) > (dev->mod_base.flat_end - 4)) {
pr_err("DDBridge: Frequency out of range %d\n", freq10); dev_err(dev->dev, "Frequency out of range %d\n", freq10);
return -EINVAL; return -EINVAL;
} }
if (down % 8) { if (down % 8) {
pr_err("DDBridge: Invalid Frequency %d\n", down); dev_err(dev->dev, "Invalid Frequency %d\n", down);
return -EINVAL; return -EINVAL;
} }
return mod_set_down(dev, down, 8, Ext); return mod_set_down(dev, down, 8, Ext);
@ -1168,12 +1171,12 @@ static int mod_init_1(struct ddb *dev, u32 Frequency)
stat = -EINVAL; stat = -EINVAL;
goto fail; goto fail;
} }
pr_info("DDBridge: srate = %d\n", flash->DataSet[0].Symbolrate * 1000); dev_info(dev->dev, "srate = %d\n", flash->DataSet[0].Symbolrate * 1000);
mod_output_enable(dev, 0); mod_output_enable(dev, 0);
stat = mod_set_dac_clock(dev, flash->DataSet[0].DACFrequency * 1000); stat = mod_set_dac_clock(dev, flash->DataSet[0].DACFrequency * 1000);
if (stat < 0) { if (stat < 0) {
pr_err("DDBridge: setting DAC clock failed\n"); dev_err(dev->dev, "setting DAC clock failed\n");
goto fail; goto fail;
} }
mod_set_dac_current(dev, 512, 512); mod_set_dac_current(dev, 512, 512);
@ -1190,17 +1193,17 @@ static int mod_init_1(struct ddb *dev, u32 Frequency)
FrequencyCH10 = flash->DataSet[0].FlatStart + 4; FrequencyCH10 = flash->DataSet[0].FlatStart + 4;
DownFrequency = Frequency + 9 * 8 + FrequencyCH10 + DownFrequency = Frequency + 9 * 8 + FrequencyCH10 +
UP1Frequency + UP2Frequency; UP1Frequency + UP2Frequency;
pr_info("DDBridge: CH10 = %d, Down = %d\n", dev_info(dev->dev, "CH10 = %d, Down = %d\n",
FrequencyCH10, DownFrequency); FrequencyCH10, DownFrequency);
if ((FrequencyCH10 + 9 * 8) > (flash->DataSet[0].FlatEnd - 4)) { if ((FrequencyCH10 + 9 * 8) > (flash->DataSet[0].FlatEnd - 4)) {
pr_err("DDBridge: Frequency out of range %d\n", FrequencyCH10); dev_err(dev->dev, "Frequency out of range %d\n", FrequencyCH10);
stat = -EINVAL; stat = -EINVAL;
goto fail; goto fail;
} }
if (DownFrequency % 8 != 0) { if (DownFrequency % 8 != 0) {
pr_err("DDBridge: Invalid Frequency %d\n", DownFrequency); dev_err(dev->dev, "Invalid Frequency %d\n", DownFrequency);
stat = -EINVAL; stat = -EINVAL;
goto fail; goto fail;
} }
@ -1229,7 +1232,7 @@ static int mod_init_1(struct ddb *dev, u32 Frequency)
flash->DataSet[0].PostScaleQ); flash->DataSet[0].PostScaleQ);
mod_pre_eq_gain(dev, flash->DataSet[0].PreScale); mod_pre_eq_gain(dev, flash->DataSet[0].PreScale);
/*mod_pre_eq_gain(dev, 0x0680);*/ /*mod_pre_eq_gain(dev, 0x0680);*/
pr_info("DDBridge: prescaler %04x\n", flash->DataSet[0].PreScale); dev_info(dev->dev, "prescaler %04x\n", flash->DataSet[0].PreScale);
mod_set_channelsumshift(dev, 2); mod_set_channelsumshift(dev, 2);
mod_output_enable(dev, 1); mod_output_enable(dev, 1);
@ -1353,7 +1356,7 @@ void ddbridge_mod_rate_handler(unsigned long data)
case CM_ADJUST: case CM_ADJUST:
if (InPacketDiff < mod->MinInputPackets) { if (InPacketDiff < mod->MinInputPackets) {
pr_info("DDBridge: PCR Adjust reset IN: %u Min: %u\n", dev_info(dev->dev, "PCR Adjust reset IN: %u Min: %u\n",
InPacketDiff, mod->MinInputPackets); InPacketDiff, mod->MinInputPackets);
mod->InPacketsSum = 0; mod->InPacketsSum = 0;
mod->OutPacketsSum = 0; mod->OutPacketsSum = 0;
@ -1394,7 +1397,7 @@ void ddbridge_mod_rate_handler(unsigned long data)
mod->PCRIncrement += PCRIncrementDiff; mod->PCRIncrement += PCRIncrementDiff;
pcr = ConvertPCR(mod->PCRIncrement); pcr = ConvertPCR(mod->PCRIncrement);
pr_info("DDBridge: outl %016llx\n", pcr); dev_info(dev->dev, "outl %016llx\n", pcr);
ddbwritel(dev, pcr & 0xffffffff, ddbwritel(dev, pcr & 0xffffffff,
CHANNEL_PCR_ADJUST_OUTL(output->nr)); CHANNEL_PCR_ADJUST_OUTL(output->nr));
ddbwritel(dev, (pcr >> 32) & 0xffffffff, ddbwritel(dev, (pcr >> 32) & 0xffffffff,
@ -1421,9 +1424,9 @@ void ddbridge_mod_rate_handler(unsigned long data)
spin_unlock(&dma->lock); spin_unlock(&dma->lock);
pr_info("DDBridge: chan %d out %016llx in %016llx indiff %08x\n", dev_info(dev->dev, "chan %d out %016llx in %016llx indiff %08x\n",
chan, OutPackets, InPackets, InPacketDiff); chan, OutPackets, InPackets, InPacketDiff);
pr_info("DDBridge: cnt %d pcra %016llx pcraext %08x pcraextfrac %08x pcrcorr %08x pcri %016llx\n", dev_info(dev->dev, "cnt %d pcra %016llx pcraext %08x pcraextfrac %08x pcrcorr %08x pcri %016llx\n",
mod->StateCounter, PCRAdjust, PCRAdjustExt, mod->StateCounter, PCRAdjust, PCRAdjustExt,
PCRAdjustExtFrac, PCRCorr, mod->PCRIncrement); PCRAdjustExtFrac, PCRCorr, mod->PCRIncrement);
} }
@ -1440,7 +1443,7 @@ static int mod3_set_base_frequency(struct ddb *dev, u32 frequency)
tmp = frequency; tmp = frequency;
tmp <<= 33; tmp <<= 33;
tmp = div64_s64(tmp, 4915200000); tmp = div64_s64(tmp, 4915200000);
pr_info("set base frequency = %u regs = 0x%08llx\n", frequency, tmp); dev_info(dev->dev, "set base frequency = %u regs = 0x%08llx\n", frequency, tmp);
ddbwritel(dev, (u32) tmp, RFDAC_FCW); ddbwritel(dev, (u32) tmp, RFDAC_FCW);
return 0; return 0;
} }
@ -1456,7 +1459,7 @@ static void mod3_set_cfcw(struct ddb_mod *mod, u32 f)
tmp = ((s64) (freq - dcf)) << 32; tmp = ((s64) (freq - dcf)) << 32;
tmp = div64_s64(tmp, srdac); tmp = div64_s64(tmp, srdac);
cfcw = (u32) tmp; cfcw = (u32) tmp;
pr_info("f=%u cfcw = %08x nr = %u\n", f, cfcw, mod->port->nr); dev_info(dev->dev, "f=%u cfcw = %08x nr = %u\n", f, cfcw, mod->port->nr);
ddbwritel(dev, cfcw, SDR_CHANNEL_CFCW(mod->port->nr)); ddbwritel(dev, cfcw, SDR_CHANNEL_CFCW(mod->port->nr));
} }
@ -1634,7 +1637,7 @@ static int mod_init_2(struct ddb *dev, u32 Frequency)
status = mod_fsm_setup(dev, 0, 0); status = mod_fsm_setup(dev, 0, 0);
if (status) { if (status) {
pr_err("FSM setup failed!\n"); dev_err(dev->dev, "FSM setup failed!\n");
return -1; return -1;
} }
for (i = 0; i < streams; i++) { for (i = 0; i < streams; i++) {
@ -1709,7 +1712,7 @@ static int rfdac_init(struct ddb *dev)
} }
if (tmp & 0x80) if (tmp & 0x80)
return -1; return -1;
pr_info("sync %d:%08x\n", i, tmp); dev_info(dev->dev, "sync %d:%08x\n", i, tmp);
ddbwritel(dev, RFDAC_CMD_RESET, RFDAC_CONTROL); ddbwritel(dev, RFDAC_CMD_RESET, RFDAC_CONTROL);
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
msleep(20); msleep(20);
@ -1719,7 +1722,7 @@ static int rfdac_init(struct ddb *dev)
} }
if (tmp & 0x80) if (tmp & 0x80)
return -1; return -1;
pr_info("sync %d:%08x\n", i, tmp); dev_info(dev->dev, "sync %d:%08x\n", i, tmp);
ddbwritel(dev, RFDAC_CMD_SETUP, RFDAC_CONTROL); ddbwritel(dev, RFDAC_CMD_SETUP, RFDAC_CONTROL);
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
msleep(20); msleep(20);
@ -1729,7 +1732,7 @@ static int rfdac_init(struct ddb *dev)
} }
if (tmp & 0x80) if (tmp & 0x80)
return -1; return -1;
pr_info("sync %d:%08x\n", i, tmp); dev_info(dev->dev, "sync %d:%08x\n", i, tmp);
ddbwritel(dev, 0x01, JESD204B_BASE); ddbwritel(dev, 0x01, JESD204B_BASE);
for (i = 0; i < 400; i++) { for (i = 0; i < 400; i++) {
msleep(20); msleep(20);
@ -1737,7 +1740,7 @@ static int rfdac_init(struct ddb *dev)
if ((tmp & 0xc0000000) == 0xc0000000) if ((tmp & 0xc0000000) == 0xc0000000)
break; break;
} }
pr_info("sync %d:%08x\n", i, tmp); dev_info(dev->dev, "sync %d:%08x\n", i, tmp);
if ((tmp & 0xc0000000) != 0xc0000000) if ((tmp & 0xc0000000) != 0xc0000000)
return -1; return -1;
return 0; return 0;
@ -1750,12 +1753,12 @@ static int mod_init_3(struct ddb *dev, u32 Frequency)
ret = mod_setup_max2871(dev, max2871_sdr); ret = mod_setup_max2871(dev, max2871_sdr);
if (ret) if (ret)
pr_err("DDBridge: PLL setup failed\n"); dev_err(dev->dev, "PLL setup failed\n");
ret = rfdac_init(dev); ret = rfdac_init(dev);
if (ret) if (ret)
ret = rfdac_init(dev); ret = rfdac_init(dev);
if (ret) if (ret)
pr_err("DDBridge: RFDAC setup failed\n"); dev_err(dev->dev, "RFDAC setup failed\n");
for (i = 0; i < streams; i++) { for (i = 0; i < streams; i++) {
struct ddb_mod *mod = &dev->mod[i]; struct ddb_mod *mod = &dev->mod[i];

View File

@ -197,7 +197,7 @@ static int ns_set_ci(struct dvbnss *nss, u8 ci)
if (ciport < 0) if (ciport < 0)
return -EINVAL; return -EINVAL;
pr_info("DDBridge: input %d.%d to ci %d at port %d\n", dev_info(dev->dev, "DDBridge: input %d.%d to ci %d at port %d\n",
input->port->lnr, input->nr, ci, ciport); input->port->lnr, input->nr, ci, ciport);
ddbwritel(dev, (input->port->lnr << 21) | (input->nr << 16) | 0x1c, ddbwritel(dev, (input->port->lnr << 21) | (input->nr << 16) | 0x1c,
TS_CONTROL(dev->port[ciport].output)); TS_CONTROL(dev->port[ciport].output));

View File

@ -100,9 +100,9 @@ static int __init octonet_probe(struct platform_device *pdev)
dev->link[0].ids.device, dev->link[0].ids.device,
0xdd01, 0xffff); 0xdd01, 0xffff);
#endif #endif
pr_info("DDBridge: HW %08x REGMAP %08x\n", dev_info(dev->dev, "DDBridge: HW %08x REGMAP %08x\n",
dev->link[0].ids.hwid, dev->link[0].ids.regmapid); dev->link[0].ids.hwid, dev->link[0].ids.regmapid);
pr_info("DDBridge: MAC %08x DEVID %08x\n", dev_info(dev->dev, "DDBridge: MAC %08x DEVID %08x\n",
dev->link[0].ids.mac, dev->link[0].ids.devid); dev->link[0].ids.mac, dev->link[0].ids.devid);
ddbwritel(dev, 0, ETHER_CONTROL); ddbwritel(dev, 0, ETHER_CONTROL);