Commit 9f179161 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] max2165: use DVBv5 parameters on set_params()

Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 35fea064
...@@ -151,7 +151,7 @@ static int max2165_set_bandwidth(struct max2165_priv *priv, u32 bw) ...@@ -151,7 +151,7 @@ static int max2165_set_bandwidth(struct max2165_priv *priv, u32 bw)
{ {
u8 val; u8 val;
if (bw == BANDWIDTH_8_MHZ) if (bw == 8000000)
val = priv->bb_filter_8mhz_cfg; val = priv->bb_filter_8mhz_cfg;
else else
val = priv->bb_filter_7mhz_cfg; val = priv->bb_filter_7mhz_cfg;
...@@ -261,35 +261,25 @@ static int max2165_set_params(struct dvb_frontend *fe, ...@@ -261,35 +261,25 @@ static int max2165_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params) struct dvb_frontend_parameters *params)
{ {
struct max2165_priv *priv = fe->tuner_priv; struct max2165_priv *priv = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dprintk("%s() frequency=%d (Hz)\n", __func__, params->frequency); switch (c->bandwidth_hz) {
if (fe->ops.info.type == FE_ATSC) { case 7000000:
return -EINVAL; case 8000000:
} else if (fe->ops.info.type == FE_OFDM) { priv->frequency = c->frequency;
dprintk("%s() OFDM\n", __func__); break;
switch (params->u.ofdm.bandwidth) { default:
case BANDWIDTH_6_MHZ: printk(KERN_INFO "MAX2165: bandwidth %d Hz not supported.\n",
return -EINVAL; c->bandwidth_hz);
case BANDWIDTH_7_MHZ:
case BANDWIDTH_8_MHZ:
priv->frequency = params->frequency;
priv->bandwidth = params->u.ofdm.bandwidth;
break;
default:
printk(KERN_ERR "MAX2165 bandwidth not set!\n");
return -EINVAL;
}
} else {
printk(KERN_ERR "MAX2165 modulation type not supported!\n");
return -EINVAL; return -EINVAL;
} }
dprintk("%s() frequency=%d\n", __func__, priv->frequency); dprintk("%s() frequency=%d\n", __func__, c->frequency);
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.i2c_gate_ctrl(fe, 1);
max2165_set_bandwidth(priv, priv->bandwidth); max2165_set_bandwidth(priv, c->bandwidth_hz);
ret = max2165_set_rf(priv, priv->frequency); ret = max2165_set_rf(priv, priv->frequency);
mdelay(50); mdelay(50);
max2165_debug_status(priv); max2165_debug_status(priv);
...@@ -370,7 +360,7 @@ static int max2165_init(struct dvb_frontend *fe) ...@@ -370,7 +360,7 @@ static int max2165_init(struct dvb_frontend *fe)
max2165_read_rom_table(priv); max2165_read_rom_table(priv);
max2165_set_bandwidth(priv, BANDWIDTH_8_MHZ); max2165_set_bandwidth(priv, 8000000);
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); fe->ops.i2c_gate_ctrl(fe, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment