Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285476
b: refs/heads/master
c: e7e10de
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 7adaa4f commit 56c3b55
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 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: ab3eee078f450cab698d49563fa67ed83325b3c0
refs/heads/master: e7e10deb582ace0a4eb39965e898f5147ae81e79
5 changes: 3 additions & 2 deletions trunk/drivers/media/dvb/frontends/bsbe1.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,17 @@ static int alps_bsbe1_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra

static int alps_bsbe1_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
int ret;
u8 data[4];
u32 div;
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
struct i2c_adapter *i2c = fe->tuner_priv;

if ((params->frequency < 950000) || (params->frequency > 2150000))
if ((p->frequency < 950000) || (p->frequency > 2150000))
return -EINVAL;

div = params->frequency / 1000;
div = p->frequency / 1000;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x80 | ((div & 0x18000) >> 10) | 0x1;
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/media/dvb/frontends/bsru6.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,22 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32 ra

static int alps_bsru6_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
u8 buf[4];
u32 div;
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
struct i2c_adapter *i2c = fe->tuner_priv;

if ((params->frequency < 950000) || (params->frequency > 2150000))
if ((p->frequency < 950000) || (p->frequency > 2150000))
return -EINVAL;

div = (params->frequency + (125 - 1)) / 125; // round correctly
div = (p->frequency + (125 - 1)) / 125; /* round correctly */
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x80 | ((div & 0x18000) >> 10) | 4;
buf[3] = 0xC4;

if (params->frequency > 1530000)
if (p->frequency > 1530000)
buf[3] = 0xc0;

if (fe->ops.i2c_gate_ctrl)
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/media/dvb/frontends/tdhd1.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,23 @@ static struct tda1004x_config alps_tdhd1_204a_config = {

static int alps_tdhd1_204a_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct i2c_adapter *i2c = fe->tuner_priv;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
u32 div;

div = (params->frequency + 36166666) / 166666;
div = (p->frequency + 36166666) / 166666;

data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x85;

if (params->frequency >= 174000000 && params->frequency <= 230000000)
if (p->frequency >= 174000000 && p->frequency <= 230000000)
data[3] = 0x02;
else if (params->frequency >= 470000000 && params->frequency <= 823000000)
else if (p->frequency >= 470000000 && p->frequency <= 823000000)
data[3] = 0x0C;
else if (params->frequency > 823000000 && params->frequency <= 862000000)
else if (p->frequency > 823000000 && p->frequency <= 862000000)
data[3] = 0x8C;
else
return -EINVAL;
Expand Down

0 comments on commit 56c3b55

Please sign in to comment.