Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124065
b: refs/heads/master
c: cf6efeb
h: refs/heads/master
i:
  124063: 0a6e847
v: v3
  • Loading branch information
Manu Abraham authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent e5da992 commit 50f1f44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 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: 6199ceef8bd28b79e0792423ca79cce8b224cd50
refs/heads/master: cf6efeb6705e9828291401f890dcb327a0ea52e7
13 changes: 12 additions & 1 deletion trunk/drivers/media/dvb/frontends/tda8261.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,25 @@ static int tda8261_set_state(struct dvb_frontend *fe,
* (to account for half channel spacing on either side)
*/
frequency = tstate->frequency;
if ((frequency < 950000) || (frequency > 2150000)) {
printk("%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",
__func__, config->step_size, div_tab[config->step_size], N, N);

buf[0] = (N >> 8) & 0xff;
buf[1] = N & 0xff;
buf[2] = (0x01 << 7) | ((ref_div[config->step_size] & 0x07) << 1);
buf[3] = 0xc0;

if (frequency < 1450000)
buf[3] = 0x00;
if (frequency < 2000000)
buf[3] = 0x40;
if (frequency < 2150000)
buf[3] = 0x80;

/* Set params */
if ((err = tda8261_write(state, buf)) < 0) {
printk("%s: I/O Error\n", __func__);
Expand Down

0 comments on commit 50f1f44

Please sign in to comment.