Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285474
b: refs/heads/master
c: 5918288
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 4b38e8e commit 53a8736
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 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: b738ae160a9991d133671873f68c2ccffe524d12
refs/heads/master: 5918288a422b8bbc0ebfd541d6cb9ed2c43b0b76
28 changes: 15 additions & 13 deletions trunk/drivers/media/dvb/frontends/tua6100.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static int tua6100_sleep(struct dvb_frontend *fe)
static int tua6100_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tua6100_priv *priv = fe->tuner_priv;
u32 div;
u32 prediv;
Expand All @@ -85,36 +86,37 @@ static int tua6100_set_params(struct dvb_frontend *fe,
#define _ri 4000000

// setup register 0
if (params->frequency < 2000000) {
if (c->frequency < 2000000)
reg0[1] = 0x03;
} else {
else
reg0[1] = 0x07;
}

// setup register 1
if (params->frequency < 1630000) {
if (c->frequency < 1630000)
reg1[1] = 0x2c;
} else {
else
reg1[1] = 0x0c;
}

if (_P == 64)
reg1[1] |= 0x40;
if (params->frequency >= 1525000)
if (c->frequency >= 1525000)
reg1[1] |= 0x80;

// register 2
reg2[1] = (_R >> 8) & 0x03;
reg2[2] = _R;
if (params->frequency < 1455000) {
if (c->frequency < 1455000)
reg2[1] |= 0x1c;
} else if (params->frequency < 1630000) {
else if (c->frequency < 1630000)
reg2[1] |= 0x0c;
} else {
else
reg2[1] |= 0x1c;
}

// The N divisor ratio (note: params->frequency is in kHz, but we need it in Hz)
prediv = (params->frequency * _R) / (_ri / 1000);
/*
* The N divisor ratio (note: c->frequency is in kHz, but we
* need it in Hz)
*/
prediv = (c->frequency * _R) / (_ri / 1000);
div = prediv / _P;
reg1[1] |= (div >> 9) & 0x03;
reg1[2] = div >> 1;
Expand Down

0 comments on commit 53a8736

Please sign in to comment.