Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331024
b: refs/heads/master
c: eb2e265
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Mauro Carvalho Chehab committed Sep 18, 2012
1 parent cba59a2 commit 6bff7ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 542f6a52b63359227bbc39e8436a1d7156602d86
refs/heads/master: eb2e2652457e407ff617a4412120e924398e7545
28 changes: 14 additions & 14 deletions trunk/drivers/media/dvb-frontends/tda8261.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int tda8261_read(struct tda8261_state *state, u8 *buf)
struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD,.buf = buf, .len = 1 };

if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1)
printk("%s: read error, err=%d\n", __func__, err);
pr_err("%s: read error, err=%d\n", __func__, err);

return err;
}
Expand All @@ -55,7 +55,7 @@ static int tda8261_write(struct tda8261_state *state, u8 *buf)
struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = 4 };

if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1)
printk("%s: write error, err=%d\n", __func__, err);
pr_err("%s: write error, err=%d\n", __func__, err);

return err;
}
Expand All @@ -69,11 +69,11 @@ static int tda8261_get_status(struct dvb_frontend *fe, u32 *status)
*status = 0;

if ((err = tda8261_read(state, &result)) < 0) {
printk("%s: I/O Error\n", __func__);
pr_err("%s: I/O Error\n", __func__);
return err;
}
if ((result >> 6) & 0x01) {
printk("%s: Tuner Phase Locked\n", __func__);
pr_debug("%s: Tuner Phase Locked\n", __func__);
*status = 1;
}

Expand All @@ -98,7 +98,7 @@ static int tda8261_get_state(struct dvb_frontend *fe,
tstate->bandwidth = 40000000; /* FIXME! need to calculate Bandwidth */
break;
default:
printk("%s: Unknown parameter (param=%d)\n", __func__, param);
pr_err("%s: Unknown parameter (param=%d)\n", __func__, param);
err = -EINVAL;
break;
}
Expand All @@ -124,11 +124,11 @@ static int tda8261_set_state(struct dvb_frontend *fe,
*/
frequency = tstate->frequency;
if ((frequency < 950000) || (frequency > 2150000)) {
printk("%s: Frequency beyond limits, frequency=%d\n", __func__, frequency);
pr_warn("%s: Frequency beyond limits, frequency=%d\n", __func__, frequency);
return -EINVAL;
}
N = (frequency + (div_tab[config->step_size] - 1)) / div_tab[config->step_size];
printk("%s: Step size=%d, Divider=%d, PG=0x%02x (%d)\n",
pr_debug("%s: Step size=%d, Divider=%d, PG=0x%02x (%d)\n",
__func__, config->step_size, div_tab[config->step_size], N, N);

buf[0] = (N >> 8) & 0xff;
Expand All @@ -144,25 +144,25 @@ static int tda8261_set_state(struct dvb_frontend *fe,

/* Set params */
if ((err = tda8261_write(state, buf)) < 0) {
printk("%s: I/O Error\n", __func__);
pr_err("%s: I/O Error\n", __func__);
return err;
}
/* sleep for some time */
printk("%s: Waiting to Phase LOCK\n", __func__);
pr_debug("%s: Waiting to Phase LOCK\n", __func__);
msleep(20);
/* check status */
if ((err = tda8261_get_status(fe, &status)) < 0) {
printk("%s: I/O Error\n", __func__);
pr_err("%s: I/O Error\n", __func__);
return err;
}
if (status == 1) {
printk("%s: Tuner Phase locked: status=%d\n", __func__, status);
pr_debug("%s: Tuner Phase locked: status=%d\n", __func__, status);
state->frequency = frequency; /* cache successful state */
} else {
printk("%s: No Phase lock: status=%d\n", __func__, status);
pr_debug("%s: No Phase lock: status=%d\n", __func__, status);
}
} else {
printk("%s: Unknown parameter (param=%d)\n", __func__, param);
pr_err("%s: Unknown parameter (param=%d)\n", __func__, param);
return -EINVAL;
}

Expand Down Expand Up @@ -214,7 +214,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe,

// printk("%s: Attaching %s TDA8261 8PSK/QPSK tuner\n",
// __func__, fe->ops.tuner_ops.tuner_name);
printk("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__);
pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__);

return fe;

Expand Down

0 comments on commit 6bff7ac

Please sign in to comment.