summaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/tuner-simple.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-24 16:03:05 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 11:52:22 +0100
commit249fa0b01c82f497efa15cb98081183e8938985f (patch)
tree74339d23b7581f8a3a00d1586cf632b802fb87cf /drivers/media/common/tuners/tuner-simple.c
parent[media] budget: use DVBv5 parameters on set_params() (diff)
downloadlinux-249fa0b01c82f497efa15cb98081183e8938985f.tar.xz
linux-249fa0b01c82f497efa15cb98081183e8938985f.zip
[media] dvb: remove dvb_frontend_parameters from calc_regs()
The calc_regs() callback is used by a few frontends (mt352, nxt200x, digitv and zl10353). On all places it is called, the parameters are set by DVBv5 way. So, just use the DVBv5 struct and remove the extra parameter. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tuner-simple.c')
-rw-r--r--drivers/media/common/tuners/tuner-simple.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index e6342dbb2cf7..1dad5fbb4de0 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -884,7 +884,6 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
}
static int simple_dvb_calc_regs(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params,
u8 *buf, int buf_len)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -896,28 +895,14 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
if (buf_len < 5)
return -EINVAL;
- switch (delsys) {
- case SYS_DVBT:
- case SYS_DVBT2:
- if (params->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
- bw = 6000000;
- if (params->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
- bw = 7000000;
- if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
- bw = 8000000;
- break;
- default:
- break;
- }
- frequency = simple_dvb_configure(fe, buf+1, delsys, params->frequency, bw);
+ frequency = simple_dvb_configure(fe, buf+1, delsys, c->frequency, bw);
if (frequency == 0)
return -EINVAL;
buf[0] = priv->i2c_props.addr;
priv->frequency = frequency;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ?
- params->u.ofdm.bandwidth : 0;
+ priv->bandwidth = c->bandwidth_hz;
return 5;
}
@@ -1044,7 +1029,17 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency)
static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
{
struct tuner_simple_priv *priv = fe->tuner_priv;
- *bandwidth = priv->bandwidth;
+ switch (priv->bandwidth) {
+ case 6000000:
+ *bandwidth = BANDWIDTH_6_MHZ;
+ break;
+ case 7000000:
+ *bandwidth = BANDWIDTH_7_MHZ;
+ break;
+ case 8000000:
+ *bandwidth = BANDWIDTH_8_MHZ;
+ break;
+ }
return 0;
}