diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-02-06 16:11:09 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-02-06 16:12:16 +0100 |
commit | d4730ace0c7dbb64513e35b6fc5fd7e7f381e490 (patch) | |
tree | 18890c096cdd869a593c56de3257faa40af8e050 /drivers/media/common/tuners/tda827x.c | |
parent | HID: hyperv: Properly disconnect the input device (diff) | |
parent | Merge tag 'pm-fixes-for-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel... (diff) | |
download | linux-d4730ace0c7dbb64513e35b6fc5fd7e7f381e490.tar.xz linux-d4730ace0c7dbb64513e35b6fc5fd7e7f381e490.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into upstream-fixes
Sync with Linus' tree. This is necessary to have a base for
patch that fixes commit 35b4c01e29b ("power_supply: add "powers"
links to self-powered HID devices") which went in through Anton's
tree.
Diffstat (limited to 'drivers/media/common/tuners/tda827x.c')
-rw-r--r-- | drivers/media/common/tuners/tda827x.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/common/tuners/tda827x.c b/drivers/media/common/tuners/tda827x.c index e0d5b43772b8..a0d176267470 100644 --- a/drivers/media/common/tuners/tda827x.c +++ b/drivers/media/common/tuners/tda827x.c @@ -152,9 +152,9 @@ static int tuner_transfer(struct dvb_frontend *fe, return rc; } -static int tda827xo_set_params(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) +static int tda827xo_set_params(struct dvb_frontend *fe) { + struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct tda827x_priv *priv = fe->tuner_priv; u8 buf[14]; int rc; @@ -165,18 +165,16 @@ static int tda827xo_set_params(struct dvb_frontend *fe, u32 N; dprintk("%s:\n", __func__); - switch (params->u.ofdm.bandwidth) { - case BANDWIDTH_6_MHZ: + if (c->bandwidth_hz == 0) { + if_freq = 5000000; + } else if (c->bandwidth_hz <= 6000000) { if_freq = 4000000; - break; - case BANDWIDTH_7_MHZ: + } else if (c->bandwidth_hz <= 7000000) { if_freq = 4500000; - break; - default: /* 8 MHz or Auto */ + } else { /* 8 MHz */ if_freq = 5000000; - break; } - tuner_freq = params->frequency; + tuner_freq = c->frequency; i = 0; while (tda827x_table[i].lomax < tuner_freq) { @@ -220,8 +218,8 @@ static int tda827xo_set_params(struct dvb_frontend *fe, if (rc < 0) goto err; - priv->frequency = params->frequency; - priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0; + priv->frequency = c->frequency; + priv->bandwidth = c->bandwidth_hz; return 0; @@ -513,9 +511,9 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high, } } -static int tda827xa_set_params(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) +static int tda827xa_set_params(struct dvb_frontend *fe) { + struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct tda827x_priv *priv = fe->tuner_priv; struct tda827xa_data *frequency_map = tda827xa_dvbt; u8 buf[11]; @@ -531,22 +529,25 @@ static int tda827xa_set_params(struct dvb_frontend *fe, tda827xa_lna_gain(fe, 1, NULL); msleep(20); - switch (params->u.ofdm.bandwidth) { - case BANDWIDTH_6_MHZ: + if (c->bandwidth_hz == 0) { + if_freq = 5000000; + } else if (c->bandwidth_hz <= 6000000) { if_freq = 4000000; - break; - case BANDWIDTH_7_MHZ: + } else if (c->bandwidth_hz <= 7000000) { if_freq = 4500000; - break; - default: /* 8 MHz or Auto */ + } else { /* 8 MHz */ if_freq = 5000000; - break; } - tuner_freq = params->frequency; + tuner_freq = c->frequency; - if (fe->ops.info.type == FE_QAM) { + switch (c->delivery_system) { + case SYS_DVBC_ANNEX_A: + case SYS_DVBC_ANNEX_C: dprintk("%s select tda827xa_dvbc\n", __func__); frequency_map = tda827xa_dvbc; + break; + default: + break; } i = 0; @@ -645,9 +646,8 @@ static int tda827xa_set_params(struct dvb_frontend *fe, if (rc < 0) goto err; - priv->frequency = params->frequency; - priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0; - + priv->frequency = c->frequency; + priv->bandwidth = c->bandwidth_hz; return 0; |