Commit c6f56e7d authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] dvb: don't use DVBv3 bandwidth macros

Every frontend now uses DVBv5 way. So, let's not use the DVBv3
macros internally anymore.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 88ab898f
...@@ -150,20 +150,18 @@ static int mt2266_set_params(struct dvb_frontend *fe) ...@@ -150,20 +150,18 @@ static int mt2266_set_params(struct dvb_frontend *fe)
case 6000000: case 6000000:
mt2266_writeregs(priv, mt2266_init_6mhz, mt2266_writeregs(priv, mt2266_init_6mhz,
sizeof(mt2266_init_6mhz)); sizeof(mt2266_init_6mhz));
priv->bandwidth = BANDWIDTH_6_MHZ;
break; break;
case 8000000: case 8000000:
mt2266_writeregs(priv, mt2266_init_8mhz, mt2266_writeregs(priv, mt2266_init_8mhz,
sizeof(mt2266_init_8mhz)); sizeof(mt2266_init_8mhz));
priv->bandwidth = BANDWIDTH_8_MHZ;
break; break;
case 7000000: case 7000000:
default: default:
mt2266_writeregs(priv, mt2266_init_7mhz, mt2266_writeregs(priv, mt2266_init_7mhz,
sizeof(mt2266_init_7mhz)); sizeof(mt2266_init_7mhz));
priv->bandwidth = BANDWIDTH_7_MHZ;
break; break;
} }
priv->bandwidth = c->bandwidth_hz;
if (band == MT2266_VHF && priv->band == MT2266_UHF) { if (band == MT2266_VHF && priv->band == MT2266_UHF) {
dprintk("Switch from UHF to VHF"); dprintk("Switch from UHF to VHF");
......
...@@ -625,7 +625,6 @@ static int mxl5007t_set_params(struct dvb_frontend *fe) ...@@ -625,7 +625,6 @@ static int mxl5007t_set_params(struct dvb_frontend *fe)
enum mxl5007t_mode mode; enum mxl5007t_mode mode;
int ret; int ret;
u32 freq = c->frequency; u32 freq = c->frequency;
u32 band = BANDWIDTH_6_MHZ;
switch (delsys) { switch (delsys) {
case SYS_ATSC: case SYS_ATSC:
...@@ -645,10 +644,8 @@ static int mxl5007t_set_params(struct dvb_frontend *fe) ...@@ -645,10 +644,8 @@ static int mxl5007t_set_params(struct dvb_frontend *fe)
break; break;
case 7000000: case 7000000:
bw = MxL_BW_7MHz; bw = MxL_BW_7MHz;
band = BANDWIDTH_7_MHZ;
case 8000000: case 8000000:
bw = MxL_BW_8MHz; bw = MxL_BW_8MHz;
band = BANDWIDTH_8_MHZ;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -672,7 +669,7 @@ static int mxl5007t_set_params(struct dvb_frontend *fe) ...@@ -672,7 +669,7 @@ static int mxl5007t_set_params(struct dvb_frontend *fe)
goto fail; goto fail;
state->frequency = freq; state->frequency = freq;
state->bandwidth = band; state->bandwidth = c->bandwidth_hz;
fail: fail:
mutex_unlock(&state->lock); mutex_unlock(&state->lock);
......
...@@ -934,7 +934,6 @@ static int tda18271_set_params(struct dvb_frontend *fe) ...@@ -934,7 +934,6 @@ static int tda18271_set_params(struct dvb_frontend *fe)
u32 delsys = c->delivery_system; u32 delsys = c->delivery_system;
u32 bw = c->bandwidth_hz; u32 bw = c->bandwidth_hz;
u32 freq = c->frequency; u32 freq = c->frequency;
u32 band = BANDWIDTH_6_MHZ;
struct tda18271_priv *priv = fe->tuner_priv; struct tda18271_priv *priv = fe->tuner_priv;
struct tda18271_std_map *std_map = &priv->std; struct tda18271_std_map *std_map = &priv->std;
struct tda18271_std_map_item *map; struct tda18271_std_map_item *map;
...@@ -953,10 +952,8 @@ static int tda18271_set_params(struct dvb_frontend *fe) ...@@ -953,10 +952,8 @@ static int tda18271_set_params(struct dvb_frontend *fe)
map = &std_map->dvbt_6; map = &std_map->dvbt_6;
} else if (bw <= 7000000) { } else if (bw <= 7000000) {
map = &std_map->dvbt_7; map = &std_map->dvbt_7;
band = BANDWIDTH_7_MHZ;
} else { } else {
map = &std_map->dvbt_8; map = &std_map->dvbt_8;
band = BANDWIDTH_8_MHZ;
} }
break; break;
case SYS_DVBC_ANNEX_B: case SYS_DVBC_ANNEX_B:
...@@ -968,10 +965,8 @@ static int tda18271_set_params(struct dvb_frontend *fe) ...@@ -968,10 +965,8 @@ static int tda18271_set_params(struct dvb_frontend *fe)
map = &std_map->qam_6; map = &std_map->qam_6;
} else if (bw <= 7000000) { } else if (bw <= 7000000) {
map = &std_map->qam_7; map = &std_map->qam_7;
band = BANDWIDTH_7_MHZ;
} else { } else {
map = &std_map->qam_8; map = &std_map->qam_8;
band = BANDWIDTH_8_MHZ;
} }
break; break;
default: default:
...@@ -990,7 +985,7 @@ static int tda18271_set_params(struct dvb_frontend *fe) ...@@ -990,7 +985,7 @@ static int tda18271_set_params(struct dvb_frontend *fe)
priv->if_freq = map->if_freq; priv->if_freq = map->if_freq;
priv->frequency = freq; priv->frequency = freq;
priv->bandwidth = band; priv->bandwidth = bw;
fail: fail:
return ret; return ret;
} }
......
...@@ -158,7 +158,6 @@ static int tda827xo_set_params(struct dvb_frontend *fe) ...@@ -158,7 +158,6 @@ static int tda827xo_set_params(struct dvb_frontend *fe)
struct tda827x_priv *priv = fe->tuner_priv; struct tda827x_priv *priv = fe->tuner_priv;
u8 buf[14]; u8 buf[14];
int rc; int rc;
u32 band;
struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
.buf = buf, .len = sizeof(buf) }; .buf = buf, .len = sizeof(buf) };
...@@ -168,16 +167,12 @@ static int tda827xo_set_params(struct dvb_frontend *fe) ...@@ -168,16 +167,12 @@ static int tda827xo_set_params(struct dvb_frontend *fe)
dprintk("%s:\n", __func__); dprintk("%s:\n", __func__);
if (c->bandwidth_hz == 0) { if (c->bandwidth_hz == 0) {
if_freq = 5000000; if_freq = 5000000;
band = BANDWIDTH_8_MHZ;
} else if (c->bandwidth_hz <= 6000000) { } else if (c->bandwidth_hz <= 6000000) {
if_freq = 4000000; if_freq = 4000000;
band = BANDWIDTH_6_MHZ;
} else if (c->bandwidth_hz <= 7000000) { } else if (c->bandwidth_hz <= 7000000) {
if_freq = 4500000; if_freq = 4500000;
band = BANDWIDTH_7_MHZ;
} else { /* 8 MHz */ } else { /* 8 MHz */
if_freq = 5000000; if_freq = 5000000;
band = BANDWIDTH_8_MHZ;
} }
tuner_freq = c->frequency; tuner_freq = c->frequency;
...@@ -224,7 +219,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe) ...@@ -224,7 +219,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe)
goto err; goto err;
priv->frequency = c->frequency; priv->frequency = c->frequency;
priv->bandwidth = band; priv->bandwidth = c->bandwidth_hz;
return 0; return 0;
...@@ -522,7 +517,6 @@ static int tda827xa_set_params(struct dvb_frontend *fe) ...@@ -522,7 +517,6 @@ static int tda827xa_set_params(struct dvb_frontend *fe)
struct tda827x_priv *priv = fe->tuner_priv; struct tda827x_priv *priv = fe->tuner_priv;
struct tda827xa_data *frequency_map = tda827xa_dvbt; struct tda827xa_data *frequency_map = tda827xa_dvbt;
u8 buf[11]; u8 buf[11];
u32 band;
struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
.buf = buf, .len = sizeof(buf) }; .buf = buf, .len = sizeof(buf) };
...@@ -537,16 +531,12 @@ static int tda827xa_set_params(struct dvb_frontend *fe) ...@@ -537,16 +531,12 @@ static int tda827xa_set_params(struct dvb_frontend *fe)
if (c->bandwidth_hz == 0) { if (c->bandwidth_hz == 0) {
if_freq = 5000000; if_freq = 5000000;
band = BANDWIDTH_8_MHZ;
} else if (c->bandwidth_hz <= 6000000) { } else if (c->bandwidth_hz <= 6000000) {
if_freq = 4000000; if_freq = 4000000;
band = BANDWIDTH_6_MHZ;
} else if (c->bandwidth_hz <= 7000000) { } else if (c->bandwidth_hz <= 7000000) {
if_freq = 4500000; if_freq = 4500000;
band = BANDWIDTH_7_MHZ;
} else { /* 8 MHz */ } else { /* 8 MHz */
if_freq = 5000000; if_freq = 5000000;
band = BANDWIDTH_8_MHZ;
} }
tuner_freq = c->frequency; tuner_freq = c->frequency;
...@@ -652,7 +642,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe) ...@@ -652,7 +642,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe)
goto err; goto err;
priv->frequency = c->frequency; priv->frequency = c->frequency;
priv->bandwidth = band; priv->bandwidth = c->bandwidth_hz;
return 0; return 0;
......
...@@ -1028,17 +1028,7 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency) ...@@ -1028,17 +1028,7 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency)
static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
{ {
struct tuner_simple_priv *priv = fe->tuner_priv; struct tuner_simple_priv *priv = fe->tuner_priv;
switch (priv->bandwidth) { *bandwidth = 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; return 0;
} }
......
...@@ -1139,7 +1139,6 @@ static int xc4000_set_params(struct dvb_frontend *fe) ...@@ -1139,7 +1139,6 @@ static int xc4000_set_params(struct dvb_frontend *fe)
dprintk(1, "%s() VSB modulation\n", __func__); dprintk(1, "%s() VSB modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_AIR; priv->rf_mode = XC_RF_MODE_AIR;
priv->freq_hz = c->frequency - 1750000; priv->freq_hz = c->frequency - 1750000;
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6; priv->video_standard = XC4000_DTV6;
type = DTV6; type = DTV6;
break; break;
...@@ -1147,7 +1146,6 @@ static int xc4000_set_params(struct dvb_frontend *fe) ...@@ -1147,7 +1146,6 @@ static int xc4000_set_params(struct dvb_frontend *fe)
dprintk(1, "%s() QAM modulation\n", __func__); dprintk(1, "%s() QAM modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_CABLE; priv->rf_mode = XC_RF_MODE_CABLE;
priv->freq_hz = c->frequency - 1750000; priv->freq_hz = c->frequency - 1750000;
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6; priv->video_standard = XC4000_DTV6;
type = DTV6; type = DTV6;
break; break;
...@@ -1156,26 +1154,21 @@ static int xc4000_set_params(struct dvb_frontend *fe) ...@@ -1156,26 +1154,21 @@ static int xc4000_set_params(struct dvb_frontend *fe)
dprintk(1, "%s() OFDM\n", __func__); dprintk(1, "%s() OFDM\n", __func__);
if (bw == 0) { if (bw == 0) {
if (c->frequency < 400000000) { if (c->frequency < 400000000) {
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->freq_hz = c->frequency - 2250000; priv->freq_hz = c->frequency - 2250000;
} else { } else {
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->freq_hz = c->frequency - 2750000; priv->freq_hz = c->frequency - 2750000;
} }
priv->video_standard = XC4000_DTV7_8; priv->video_standard = XC4000_DTV7_8;
type = DTV78; type = DTV78;
} else if (bw <= 6000000) { } else if (bw <= 6000000) {
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6; priv->video_standard = XC4000_DTV6;
priv->freq_hz = c->frequency - 1750000; priv->freq_hz = c->frequency - 1750000;
type = DTV6; type = DTV6;
} else if (bw <= 7000000) { } else if (bw <= 7000000) {
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->video_standard = XC4000_DTV7; priv->video_standard = XC4000_DTV7;
priv->freq_hz = c->frequency - 2250000; priv->freq_hz = c->frequency - 2250000;
type = DTV7; type = DTV7;
} else { } else {
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->video_standard = XC4000_DTV8; priv->video_standard = XC4000_DTV8;
priv->freq_hz = c->frequency - 2750000; priv->freq_hz = c->frequency - 2750000;
type = DTV8; type = DTV8;
...@@ -1195,6 +1188,8 @@ static int xc4000_set_params(struct dvb_frontend *fe) ...@@ -1195,6 +1188,8 @@ static int xc4000_set_params(struct dvb_frontend *fe)
if (check_firmware(fe, type, 0, priv->if_khz) != 0) if (check_firmware(fe, type, 0, priv->if_khz) != 0)
goto fail; goto fail;
priv->bandwidth = c->bandwidth_hz;
ret = xc_set_signal_source(priv, priv->rf_mode); ret = xc_set_signal_source(priv, priv->rf_mode);
if (ret != 0) { if (ret != 0) {
printk(KERN_ERR "xc4000: xc_set_signal_source(%d) failed\n", printk(KERN_ERR "xc4000: xc_set_signal_source(%d) failed\n",
...@@ -1591,7 +1586,7 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe, ...@@ -1591,7 +1586,7 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
break; break;
case 1: case 1:
/* new tuner instance */ /* new tuner instance */
priv->bandwidth = BANDWIDTH_6_MHZ; priv->bandwidth = 6000000;
/* set default configuration */ /* set default configuration */
priv->if_khz = 4560; priv->if_khz = 4560;
priv->default_pm = 0; priv->default_pm = 0;
......
...@@ -650,14 +650,12 @@ static int xc5000_set_params(struct dvb_frontend *fe) ...@@ -650,14 +650,12 @@ static int xc5000_set_params(struct dvb_frontend *fe)
dprintk(1, "%s() VSB modulation\n", __func__); dprintk(1, "%s() VSB modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_AIR; priv->rf_mode = XC_RF_MODE_AIR;
priv->freq_hz = freq - 1750000; priv->freq_hz = freq - 1750000;
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = DTV6; priv->video_standard = DTV6;
break; break;
case SYS_DVBC_ANNEX_B: case SYS_DVBC_ANNEX_B:
dprintk(1, "%s() QAM modulation\n", __func__); dprintk(1, "%s() QAM modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_CABLE; priv->rf_mode = XC_RF_MODE_CABLE;
priv->freq_hz = freq - 1750000; priv->freq_hz = freq - 1750000;
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = DTV6; priv->video_standard = DTV6;
break; break;
case SYS_DVBT: case SYS_DVBT:
...@@ -665,17 +663,14 @@ static int xc5000_set_params(struct dvb_frontend *fe) ...@@ -665,17 +663,14 @@ static int xc5000_set_params(struct dvb_frontend *fe)
dprintk(1, "%s() OFDM\n", __func__); dprintk(1, "%s() OFDM\n", __func__);
switch (bw) { switch (bw) {
case 6000000: case 6000000:
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = DTV6; priv->video_standard = DTV6;
priv->freq_hz = freq - 1750000; priv->freq_hz = freq - 1750000;
break; break;
case 7000000: case 7000000:
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->video_standard = DTV7; priv->video_standard = DTV7;
priv->freq_hz = freq - 2250000; priv->freq_hz = freq - 2250000;
break; break;
case 8000000: case 8000000:
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->video_standard = DTV8; priv->video_standard = DTV8;
priv->freq_hz = freq - 2750000; priv->freq_hz = freq - 2750000;
break; break;
...@@ -689,17 +684,14 @@ static int xc5000_set_params(struct dvb_frontend *fe) ...@@ -689,17 +684,14 @@ static int xc5000_set_params(struct dvb_frontend *fe)
dprintk(1, "%s() QAM modulation\n", __func__); dprintk(1, "%s() QAM modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_CABLE; priv->rf_mode = XC_RF_MODE_CABLE;
if (bw <= 6000000) { if (bw <= 6000000) {
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = DTV6; priv->video_standard = DTV6;
priv->freq_hz = freq - 1750000; priv->freq_hz = freq - 1750000;
b = 6; b = 6;
} else if (bw <= 7000000) { } else if (bw <= 7000000) {
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->video_standard = DTV7; priv->video_standard = DTV7;
priv->freq_hz = freq - 2250000; priv->freq_hz = freq - 2250000;
b = 7; b = 7;
} else { } else {
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->video_standard = DTV7_8; priv->video_standard = DTV7_8;
priv->freq_hz = freq - 2750000; priv->freq_hz = freq - 2750000;
b = 8; b = 8;
...@@ -745,6 +737,8 @@ static int xc5000_set_params(struct dvb_frontend *fe) ...@@ -745,6 +737,8 @@ static int xc5000_set_params(struct dvb_frontend *fe)
if (debug) if (debug)
xc_debug_dump(priv); xc_debug_dump(priv);
priv->bandwidth = bw;
return 0; return 0;
} }
...@@ -1126,7 +1120,7 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, ...@@ -1126,7 +1120,7 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
break; break;
case 1: case 1:
/* new tuner instance */ /* new tuner instance */
priv->bandwidth = BANDWIDTH_6_MHZ; priv->bandwidth = 6000000;
fe->tuner_priv = priv; fe->tuner_priv = priv;
break; break;
default: default:
......
...@@ -279,7 +279,6 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe) ...@@ -279,7 +279,6 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
struct mxl111sf_tuner_state *state = fe->tuner_priv; struct mxl111sf_tuner_state *state = fe->tuner_priv;
int ret; int ret;
u8 bw; u8 bw;
u32 band = BANDWIDTH_6_MHZ;
mxl_dbg("()"); mxl_dbg("()");
...@@ -297,11 +296,9 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe) ...@@ -297,11 +296,9 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
break; break;
case 7000000: case 7000000:
bw = 7; bw = 7;
band = BANDWIDTH_7_MHZ;
break; break;
case 8000000: case 8000000:
bw = 8; bw = 8;
band = BANDWIDTH_8_MHZ;
break; break;
default: default:
err("%s: bandwidth not set!", __func__); err("%s: bandwidth not set!", __func__);
...@@ -317,7 +314,7 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe) ...@@ -317,7 +314,7 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
goto fail; goto fail;
state->frequency = c->frequency; state->frequency = c->frequency;
state->bandwidth = band; state->bandwidth = c->bandwidth_hz;
fail: fail:
return ret; return ret;
} }
......
...@@ -98,7 +98,7 @@ struct dib3000_state { ...@@ -98,7 +98,7 @@ struct dib3000_state {
int timing_offset; int timing_offset;
int timing_offset_comp_done; int timing_offset_comp_done;
fe_bandwidth_t last_tuned_bw; u32 last_tuned_bw;
u32 last_tuned_freq; u32 last_tuned_freq;
}; };
......
...@@ -635,12 +635,7 @@ static int dvb_pll_set_params(struct dvb_frontend *fe) ...@@ -635,12 +635,7 @@ static int dvb_pll_set_params(struct dvb_frontend *fe)
} }
priv->frequency = frequency; priv->frequency = frequency;
if (c->bandwidth_hz <= 6000000) priv->bandwidth = c->bandwidth_hz;
priv->bandwidth = BANDWIDTH_6_MHZ;
else if (c->bandwidth_hz <= 7000000)
priv->bandwidth = BANDWIDTH_7_MHZ;
if (c->bandwidth_hz <= 8000000)
priv->bandwidth = BANDWIDTH_8_MHZ;
return 0; return 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