Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285647
b: refs/heads/master
c: 669b67d
h: refs/heads/master
i:
  285645: 6708f42
  285643: 2c1f0c6
  285639: 0695ce3
  285631: 3abf507
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jan 5, 2012
1 parent 538f926 commit c6f78d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 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: d76f28f2c3f19f4e2043a220e92e3fc8ec73ba90
refs/heads/master: 669b67d95948fd735ec9e103f00aca5b8074530c
46 changes: 17 additions & 29 deletions trunk/drivers/media/common/tuners/mt2063.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,9 +2051,9 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe,
*/
#define MAX_SYMBOL_RATE_6MHz 5217391

static int mt2063_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
static int mt2063_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2063_state *state = fe->tuner_priv;
int status;
s32 pict_car = 0;
Expand All @@ -2065,37 +2065,25 @@ static int mt2063_set_params(struct dvb_frontend *fe,
s32 if_mid = 0;
s32 rcvr_mode = 0;

switch (fe->ops.info.type) {
case FE_OFDM:
switch (params->u.ofdm.bandwidth) {
case BANDWIDTH_6_MHZ:
ch_bw = 6000000;
break;
case BANDWIDTH_7_MHZ:
ch_bw = 7000000;
break;
case BANDWIDTH_8_MHZ:
ch_bw = 8000000;
break;
default:
return -EINVAL;
}
if (c->bandwidth_hz == 0)
return -EINVAL;
if (c->bandwidth_hz <= 6000000)
ch_bw = 6000000;
else if (c->bandwidth_hz <= 7000000)
ch_bw = 7000000;
else
ch_bw = 8000000;

switch (c->delivery_system) {
case SYS_DVBT:
rcvr_mode = MT2063_OFFAIR_COFDM;
pict_car = 36125000;
pict2chanb_vsb = -(ch_bw / 2);
pict2snd1 = 0;
pict2snd2 = 0;
break;
case FE_QAM:
/*
* Using a 8MHz bandwidth sometimes fail
* with 6MHz-spaced channels, due to inter-carrier
* interference. So, it is better to narrow-down the filter
*/
if (params->u.qam.symbol_rate <= MAX_SYMBOL_RATE_6MHz)
ch_bw = 6000000;
else
ch_bw = 8000000;
case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_C:
rcvr_mode = MT2063_CABLE_QAM;
pict_car = 36125000;
pict2snd1 = 0;
Expand All @@ -2115,12 +2103,12 @@ static int mt2063_set_params(struct dvb_frontend *fe,
if (status < 0)
return status;

status = MT2063_Tune(state, (params->frequency + (pict2chanb_vsb + (ch_bw / 2))));
status = MT2063_Tune(state, (c->frequency + (pict2chanb_vsb + (ch_bw / 2))));

if (status < 0)
return status;

state->frequency = params->frequency;
state->frequency = c->frequency;
return 0;
}

Expand Down

0 comments on commit c6f78d9

Please sign in to comment.