Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285472
b: refs/heads/master
c: b09cf61
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 86c58ee commit dfea0d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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: a0a9ff7f58c99bad8a57d5cafaa29b86cfda6186
refs/heads/master: b09cf61dfe444810bbcf0b247a81146d4ef07218
24 changes: 13 additions & 11 deletions trunk/drivers/media/video/saa7134/saa7134-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ static int mt352_avermedia_xc3028_init(struct dvb_frontend *fe)
static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u8 off[] = { 0x00, 0xf1};
u8 on[] = { 0x00, 0x71};
struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
Expand All @@ -196,7 +197,7 @@ static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
/* set frequency (mt2050) */
f.tuner = 0;
f.type = V4L2_TUNER_DIGITAL_TV;
f.frequency = params->frequency / 1000 * 16 / 1000;
f.frequency = c->frequency / 1000 * 16 / 1000;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
i2c_transfer(&dev->i2c_adap, &msg, 1);
Expand Down Expand Up @@ -289,6 +290,7 @@ static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,

static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct saa7134_dev *dev = fe->dvb->priv;
struct tda1004x_state *state = fe->demodulator_priv;
u8 addr = state->config->tuner_address;
Expand All @@ -299,7 +301,7 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
u8 band, cp, filter;

/* determine charge pump */
tuner_frequency = params->frequency + 36166000;
tuner_frequency = c->frequency + 36166000;
if (tuner_frequency < 87000000)
return -EINVAL;
else if (tuner_frequency < 130000000)
Expand All @@ -324,28 +326,28 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
return -EINVAL;

/* determine band */
if (params->frequency < 49000000)
if (c->frequency < 49000000)
return -EINVAL;
else if (params->frequency < 161000000)
else if (c->frequency < 161000000)
band = 1;
else if (params->frequency < 444000000)
else if (c->frequency < 444000000)
band = 2;
else if (params->frequency < 861000000)
else if (c->frequency < 861000000)
band = 4;
else
return -EINVAL;

/* setup PLL filter */
switch (params->u.ofdm.bandwidth) {
case BANDWIDTH_6_MHZ:
switch (c->bandwidth_hz) {
case 6000000:
filter = 0;
break;

case BANDWIDTH_7_MHZ:
case 7000000:
filter = 0;
break;

case BANDWIDTH_8_MHZ:
case 8000000:
filter = 1;
break;

Expand All @@ -356,7 +358,7 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
/* calculate divisor
* ((36166000+((1000000/6)/2)) + Finput)/(1000000/6)
*/
tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000;
tuner_frequency = (((c->frequency / 1000) * 6) + 217496) / 1000;

/* setup tuner buffer */
tuner_buf[0] = (tuner_frequency >> 8) & 0x7f;
Expand Down

0 comments on commit dfea0d0

Please sign in to comment.