Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92731
b: refs/heads/master
c: 3ff9a81
h: refs/heads/master
i:
  92729: d1694b1
  92727: 5b78b6d
v: v3
  • Loading branch information
Hartmut Hackmann authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent bf4a3c2 commit 1be2fe5
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: b1c54fe2aed3e2812f5b42916894f15e84b484b5
refs/heads/master: 3ff9a81b21c673fd91ad8456242ca68922f77ac4
13 changes: 12 additions & 1 deletion trunk/drivers/media/dvb/frontends/tda826x.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,32 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
struct tda826x_priv *priv = fe->tuner_priv;
int ret;
u32 div;
u32 ksyms;
u32 bandwidth;
u8 buf [11];
struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 11 };

dprintk("%s:\n", __func__);

div = (params->frequency + (1000-1)) / 1000;

/* BW = ((1 + RO) * SR/2 + 5) * 1.3 [SR in MSPS, BW in MHz] */
/* with R0 = 0.35 and some transformations: */
ksyms = params->u.qpsk.symbol_rate / 1000;
bandwidth = (878 * ksyms + 6500000) / 1000000 + 1;
if (bandwidth < 5)
bandwidth = 5;
else if (bandwidth > 36)
bandwidth = 36;

buf[0] = 0x00; // subaddress
buf[1] = 0x09; // powerdown RSSI + the magic value 1
if (!priv->has_loopthrough)
buf[1] |= 0x20; // power down loopthrough if not needed
buf[2] = (1<<5) | 0x0b; // 1Mhz + 0.45 VCO
buf[3] = div >> 7;
buf[4] = div << 1;
buf[5] = 0x77; // baseband cut-off 19 MHz
buf[5] = ((bandwidth - 5) << 3) | 7; /* baseband cut-off */
buf[6] = 0xfe; // baseband gain 9 db + no RF attenuation
buf[7] = 0x83; // charge pumps at high, tests off
buf[8] = 0x80; // recommended value 4 for AMPVCO + disable ports.
Expand Down

0 comments on commit 1be2fe5

Please sign in to comment.