forked from Minki/linux
media: dvb: convert tuner_info frequencies to Hz
Right now, satellite tuner drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal tuners capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing to hack the drivers in order to support such hybrid tuners. So, convert everything to specify tuner frequencies in Hz. Plese notice that a similar patch is also needed for frontends. Tested-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Acked-by: Michael Büsch <m@bues.ch> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
6706fe55af
commit
a3f90c75b8
@ -896,14 +896,31 @@ static int dvb_frontend_start(struct dvb_frontend *fe)
|
||||
static void dvb_frontend_get_frequency_limits(struct dvb_frontend *fe,
|
||||
u32 *freq_min, u32 *freq_max)
|
||||
{
|
||||
*freq_min = max(fe->ops.info.frequency_min, fe->ops.tuner_ops.info.frequency_min);
|
||||
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
||||
__u32 tuner_min = fe->ops.tuner_ops.info.frequency_min_hz;
|
||||
__u32 tuner_max = fe->ops.tuner_ops.info.frequency_max_hz;
|
||||
|
||||
/* If the standard is for satellite, convert frequencies to kHz */
|
||||
switch (c->delivery_system) {
|
||||
case SYS_DVBS:
|
||||
case SYS_DVBS2:
|
||||
case SYS_TURBO:
|
||||
case SYS_ISDBS:
|
||||
tuner_max /= kHz;
|
||||
tuner_min /= kHz;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
*freq_min = max(fe->ops.info.frequency_min, tuner_min);
|
||||
|
||||
if (fe->ops.info.frequency_max == 0)
|
||||
*freq_max = fe->ops.tuner_ops.info.frequency_max;
|
||||
else if (fe->ops.tuner_ops.info.frequency_max == 0)
|
||||
*freq_max = tuner_max;
|
||||
else if (tuner_max == 0)
|
||||
*freq_max = fe->ops.info.frequency_max;
|
||||
else
|
||||
*freq_max = min(fe->ops.info.frequency_max, fe->ops.tuner_ops.info.frequency_max);
|
||||
*freq_max = min(fe->ops.info.frequency_max, tuner_max);
|
||||
|
||||
if (*freq_min == 0 || *freq_max == 0)
|
||||
dev_warn(fe->dvb->device,
|
||||
|
@ -468,9 +468,9 @@ static int ascot2e_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops ascot2e_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Sony ASCOT2E",
|
||||
.frequency_min = 1000000,
|
||||
.frequency_max = 1200000000,
|
||||
.frequency_step = 25000,
|
||||
.frequency_min_hz = 1 * MHz,
|
||||
.frequency_max_hz = 1200 * MHz,
|
||||
.frequency_step_hz = 25 * kHz,
|
||||
},
|
||||
.init = ascot2e_init,
|
||||
.release = ascot2e_release,
|
||||
|
@ -533,10 +533,10 @@ static void cx24113_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops cx24113_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Conexant CX24113",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 125,
|
||||
.name = "Conexant CX24113",
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
.frequency_step_hz = 125 * kHz,
|
||||
},
|
||||
|
||||
.release = cx24113_release,
|
||||
|
@ -726,10 +726,10 @@ static void dib0070_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops dib0070_ops = {
|
||||
.info = {
|
||||
.name = "DiBcom DiB0070",
|
||||
.frequency_min = 45000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 1000,
|
||||
.name = "DiBcom DiB0070",
|
||||
.frequency_min_hz = 45 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 1 * kHz,
|
||||
},
|
||||
.release = dib0070_release,
|
||||
|
||||
|
@ -2578,9 +2578,9 @@ static int dib0090_set_params(struct dvb_frontend *fe)
|
||||
static const struct dvb_tuner_ops dib0090_ops = {
|
||||
.info = {
|
||||
.name = "DiBcom DiB0090",
|
||||
.frequency_min = 45000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 45 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 1 * kHz,
|
||||
},
|
||||
.release = dib0090_release,
|
||||
|
||||
@ -2593,9 +2593,9 @@ static const struct dvb_tuner_ops dib0090_ops = {
|
||||
static const struct dvb_tuner_ops dib0090_fw_ops = {
|
||||
.info = {
|
||||
.name = "DiBcom DiB0090",
|
||||
.frequency_min = 45000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 45 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 1 * kHz,
|
||||
},
|
||||
.release = dib0090_release,
|
||||
|
||||
|
@ -799,6 +799,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
|
||||
struct dvb_pll_priv *priv = NULL;
|
||||
int ret;
|
||||
const struct dvb_pll_desc *desc;
|
||||
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
||||
|
||||
b1 = kmalloc(1, GFP_KERNEL);
|
||||
if (!b1)
|
||||
@ -844,8 +845,19 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
|
||||
|
||||
strncpy(fe->ops.tuner_ops.info.name, desc->name,
|
||||
sizeof(fe->ops.tuner_ops.info.name));
|
||||
fe->ops.tuner_ops.info.frequency_min = desc->min;
|
||||
fe->ops.tuner_ops.info.frequency_max = desc->max;
|
||||
switch (c->delivery_system) {
|
||||
case SYS_DVBS:
|
||||
case SYS_DVBS2:
|
||||
case SYS_TURBO:
|
||||
case SYS_ISDBS:
|
||||
fe->ops.tuner_ops.info.frequency_min_hz = desc->min * kHz;
|
||||
fe->ops.tuner_ops.info.frequency_max_hz = desc->max * kHz;
|
||||
break;
|
||||
default:
|
||||
fe->ops.tuner_ops.info.frequency_min_hz = desc->min;
|
||||
fe->ops.tuner_ops.info.frequency_max_hz = desc->max;
|
||||
}
|
||||
|
||||
if (!desc->initdata)
|
||||
fe->ops.tuner_ops.init = NULL;
|
||||
if (!desc->sleepdata)
|
||||
|
@ -846,9 +846,9 @@ static int helene_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops helene_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Sony HELENE Ter tuner",
|
||||
.frequency_min = 1000000,
|
||||
.frequency_max = 1200000000,
|
||||
.frequency_step = 25000,
|
||||
.frequency_min_hz = 1 * MHz,
|
||||
.frequency_max_hz = 1200 * MHz,
|
||||
.frequency_step_hz = 25 * kHz,
|
||||
},
|
||||
.init = helene_init,
|
||||
.release = helene_release,
|
||||
@ -860,9 +860,9 @@ static const struct dvb_tuner_ops helene_tuner_ops = {
|
||||
static const struct dvb_tuner_ops helene_tuner_ops_s = {
|
||||
.info = {
|
||||
.name = "Sony HELENE Sat tuner",
|
||||
.frequency_min = 500000,
|
||||
.frequency_max = 2500000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 500 * MHz,
|
||||
.frequency_max_hz = 2500 * MHz,
|
||||
.frequency_step_hz = 1 * MHz,
|
||||
},
|
||||
.init = helene_init,
|
||||
.release = helene_release,
|
||||
|
@ -330,9 +330,9 @@ static int horus3a_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops horus3a_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Sony Horus3a",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
.frequency_step_hz = 1 * MHz,
|
||||
},
|
||||
.init = horus3a_init,
|
||||
.release = horus3a_release,
|
||||
|
@ -353,10 +353,10 @@ static void itd1000_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops itd1000_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Integrant ITD1000",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 125, /* kHz for QPSK frontends */
|
||||
.name = "Integrant ITD1000",
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
.frequency_step_hz = 125 * kHz,
|
||||
},
|
||||
|
||||
.release = itd1000_release,
|
||||
|
@ -256,8 +256,8 @@ static int ix2505v_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops ix2505v_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Sharp IX2505V (B0017)",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2175000
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2175 * MHz
|
||||
},
|
||||
.release = ix2505v_release,
|
||||
.set_params = ix2505v_set_params,
|
||||
|
@ -188,8 +188,8 @@ static int stb6000_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops stb6000_tuner_ops = {
|
||||
.info = {
|
||||
.name = "ST STB6000",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz
|
||||
},
|
||||
.release = stb6000_release,
|
||||
.sleep = stb6000_sleep,
|
||||
|
@ -527,9 +527,8 @@ static int stb6100_set_params(struct dvb_frontend *fe)
|
||||
static const struct dvb_tuner_ops stb6100_ops = {
|
||||
.info = {
|
||||
.name = "STB6100 Silicon Tuner",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 0,
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
|
||||
.init = stb6100_init,
|
||||
|
@ -371,9 +371,9 @@ static int stv6110_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
|
||||
static const struct dvb_tuner_ops stv6110_tuner_ops = {
|
||||
.info = {
|
||||
.name = "ST STV6110",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
.frequency_step_hz = 1 * MHz,
|
||||
},
|
||||
.init = stv6110_init,
|
||||
.release = stv6110_release,
|
||||
|
@ -347,10 +347,9 @@ static void stv6110x_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops stv6110x_ops = {
|
||||
.info = {
|
||||
.name = "STV6110(A) Silicon Tuner",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 0,
|
||||
.name = "STV6110(A) Silicon Tuner",
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
.release = stv6110x_release
|
||||
};
|
||||
|
@ -646,9 +646,8 @@ static int get_rf_strength(struct dvb_frontend *fe, u16 *st)
|
||||
static const struct dvb_tuner_ops tuner_ops = {
|
||||
.info = {
|
||||
.name = "ST STV6111",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 0
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
.set_params = set_params,
|
||||
.release = release,
|
||||
|
@ -1215,9 +1215,9 @@ static int get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
|
||||
static const struct dvb_tuner_ops tuner_ops = {
|
||||
.info = {
|
||||
.name = "NXP TDA18271C2D",
|
||||
.frequency_min = 47125000,
|
||||
.frequency_max = 865000000,
|
||||
.frequency_step = 62500
|
||||
.frequency_min_hz = 47125 * kHz,
|
||||
.frequency_max_hz = 865 * MHz,
|
||||
.frequency_step_hz = 62500
|
||||
},
|
||||
.init = init,
|
||||
.sleep = sleep,
|
||||
|
@ -231,9 +231,9 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
|
||||
info = &fe->ops.tuner_ops.info;
|
||||
|
||||
memcpy(info->name, config->name, sizeof(config->name));
|
||||
info->frequency_min = config->frequency_min;
|
||||
info->frequency_max = config->frequency_max;
|
||||
info->frequency_step = config->frequency_offst;
|
||||
info->frequency_min_hz = config->frequency_min;
|
||||
info->frequency_max_hz = config->frequency_max;
|
||||
info->frequency_step_hz = config->frequency_offst;
|
||||
|
||||
printk(KERN_DEBUG "%s: Attaching TDA665x (%s) tuner\n", __func__, info->name);
|
||||
|
||||
|
@ -163,10 +163,9 @@ static void tda8261_release(struct dvb_frontend *fe)
|
||||
static const struct dvb_tuner_ops tda8261_ops = {
|
||||
|
||||
.info = {
|
||||
.name = "TDA8261",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 0
|
||||
.name = "TDA8261",
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
|
||||
.set_params = tda8261_set_params,
|
||||
@ -190,7 +189,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe,
|
||||
fe->tuner_priv = state;
|
||||
fe->ops.tuner_ops = tda8261_ops;
|
||||
|
||||
fe->ops.tuner_ops.info.frequency_step = div_tab[config->step_size];
|
||||
fe->ops.tuner_ops.info.frequency_step_hz = div_tab[config->step_size] * kHz;
|
||||
|
||||
pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__);
|
||||
|
||||
|
@ -131,8 +131,8 @@ static int tda826x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops tda826x_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Philips TDA826X",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2175000
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2175 * MHz
|
||||
},
|
||||
.release = tda826x_release,
|
||||
.sleep = tda826x_sleep,
|
||||
|
@ -498,8 +498,8 @@ static int ts2020_read_signal_strength(struct dvb_frontend *fe,
|
||||
static const struct dvb_tuner_ops ts2020_tuner_ops = {
|
||||
.info = {
|
||||
.name = "TS2020",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz
|
||||
},
|
||||
.init = ts2020_init,
|
||||
.release = ts2020_release,
|
||||
|
@ -155,9 +155,9 @@ static int tua6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
static const struct dvb_tuner_ops tua6100_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Infineon TUA6100",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
.frequency_step_hz = 1 * MHz,
|
||||
},
|
||||
.release = tua6100_release,
|
||||
.sleep = tua6100_sleep,
|
||||
|
@ -443,8 +443,8 @@ static int zl10036_init(struct dvb_frontend *fe)
|
||||
static const struct dvb_tuner_ops zl10036_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Zarlink ZL10036",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2175000
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2175 * MHz
|
||||
},
|
||||
.init = zl10036_init,
|
||||
.release = zl10036_release,
|
||||
|
@ -610,9 +610,9 @@ static int e4000_dvb_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops e4000_dvb_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Elonics E4000",
|
||||
.frequency_min = 174000000,
|
||||
.frequency_max = 862000000,
|
||||
.name = "Elonics E4000",
|
||||
.frequency_min_hz = 174 * MHz,
|
||||
.frequency_max_hz = 862 * MHz,
|
||||
},
|
||||
|
||||
.init = e4000_dvb_init,
|
||||
|
@ -472,10 +472,10 @@ static int fc0011_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
|
||||
|
||||
static const struct dvb_tuner_ops fc0011_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Fitipower FC0011",
|
||||
.name = "Fitipower FC0011",
|
||||
|
||||
.frequency_min = 45000000,
|
||||
.frequency_max = 1000000000,
|
||||
.frequency_min_hz = 45 * MHz,
|
||||
.frequency_max_hz = 1000 * MHz,
|
||||
},
|
||||
|
||||
.release = fc0011_release,
|
||||
|
@ -415,11 +415,10 @@ exit:
|
||||
|
||||
static const struct dvb_tuner_ops fc0012_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Fitipower FC0012",
|
||||
.name = "Fitipower FC0012",
|
||||
|
||||
.frequency_min = 37000000, /* estimate */
|
||||
.frequency_max = 862000000, /* estimate */
|
||||
.frequency_step = 0,
|
||||
.frequency_min_hz = 37 * MHz, /* estimate */
|
||||
.frequency_max_hz = 862 * MHz, /* estimate */
|
||||
},
|
||||
|
||||
.release = fc0012_release,
|
||||
|
@ -574,11 +574,10 @@ exit:
|
||||
|
||||
static const struct dvb_tuner_ops fc0013_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Fitipower FC0013",
|
||||
.name = "Fitipower FC0013",
|
||||
|
||||
.frequency_min = 37000000, /* estimate */
|
||||
.frequency_max = 1680000000, /* CHECK */
|
||||
.frequency_step = 0,
|
||||
.frequency_min_hz = 37 * MHz, /* estimate */
|
||||
.frequency_max_hz = 1680 * MHz, /* CHECK */
|
||||
},
|
||||
|
||||
.release = fc0013_release,
|
||||
|
@ -355,9 +355,9 @@ static int fc2580_dvb_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops fc2580_dvb_tuner_ops = {
|
||||
.info = {
|
||||
.name = "FCI FC2580",
|
||||
.frequency_min = 174000000,
|
||||
.frequency_max = 862000000,
|
||||
.name = "FCI FC2580",
|
||||
.frequency_min_hz = 174 * MHz,
|
||||
.frequency_max_hz = 862 * MHz,
|
||||
},
|
||||
|
||||
.init = fc2580_dvb_init,
|
||||
|
@ -375,9 +375,9 @@ err:
|
||||
|
||||
static const struct dvb_tuner_ops it913x_tuner_ops = {
|
||||
.info = {
|
||||
.name = "ITE IT913X",
|
||||
.frequency_min = 174000000,
|
||||
.frequency_max = 862000000,
|
||||
.name = "ITE IT913X",
|
||||
.frequency_min_hz = 174 * MHz,
|
||||
.frequency_max_hz = 862 * MHz,
|
||||
},
|
||||
|
||||
.init = it913x_init,
|
||||
|
@ -569,9 +569,9 @@ err:
|
||||
|
||||
static const struct dvb_tuner_ops m88rs6000t_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Montage M88RS6000 Internal Tuner",
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.name = "Montage M88RS6000 Internal Tuner",
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
|
||||
.init = m88rs6000t_init,
|
||||
|
@ -377,10 +377,10 @@ static void max2165_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops max2165_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Maxim MAX2165",
|
||||
.frequency_min = 470000000,
|
||||
.frequency_max = 862000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "Maxim MAX2165",
|
||||
.frequency_min_hz = 470 * MHz,
|
||||
.frequency_max_hz = 862 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.release = max2165_release,
|
||||
|
@ -300,10 +300,10 @@ static int mc44s803_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops mc44s803_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Freescale MC44S803",
|
||||
.frequency_min = 48000000,
|
||||
.frequency_max = 1000000000,
|
||||
.frequency_step = 100000,
|
||||
.name = "Freescale MC44S803",
|
||||
.frequency_min_hz = 48 * MHz,
|
||||
.frequency_max_hz = 1000 * MHz,
|
||||
.frequency_step_hz = 100 * kHz,
|
||||
},
|
||||
|
||||
.release = mc44s803_release,
|
||||
|
@ -395,10 +395,10 @@ static void mt2060_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops mt2060_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Microtune MT2060",
|
||||
.frequency_min = 48000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "Microtune MT2060",
|
||||
.frequency_min_hz = 48 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.release = mt2060_release,
|
||||
|
@ -2200,10 +2200,9 @@ static int mt2063_get_bandwidth(struct dvb_frontend *fe, u32 *bw)
|
||||
static const struct dvb_tuner_ops mt2063_ops = {
|
||||
.info = {
|
||||
.name = "MT2063 Silicon Tuner",
|
||||
.frequency_min = 45000000,
|
||||
.frequency_max = 865000000,
|
||||
.frequency_step = 0,
|
||||
},
|
||||
.frequency_min_hz = 45 * MHz,
|
||||
.frequency_max_hz = 865 * MHz,
|
||||
},
|
||||
|
||||
.init = mt2063_init,
|
||||
.sleep = MT2063_Sleep,
|
||||
|
@ -235,10 +235,10 @@ static void mt2131_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops mt2131_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Microtune MT2131",
|
||||
.frequency_min = 48000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "Microtune MT2131",
|
||||
.frequency_min_hz = 48 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.release = mt2131_release,
|
||||
|
@ -304,10 +304,10 @@ static void mt2266_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops mt2266_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Microtune MT2266",
|
||||
.frequency_min = 174000000,
|
||||
.frequency_max = 862000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "Microtune MT2266",
|
||||
.frequency_min_hz = 174 * MHz,
|
||||
.frequency_max_hz = 862 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
.release = mt2266_release,
|
||||
.init = mt2266_init,
|
||||
|
@ -271,8 +271,8 @@ static const struct dvb_tuner_ops mxl301rf_ops = {
|
||||
.info = {
|
||||
.name = "MaxLinear MxL301RF",
|
||||
|
||||
.frequency_min = 93000000,
|
||||
.frequency_max = 803142857,
|
||||
.frequency_min_hz = 93 * MHz,
|
||||
.frequency_max_hz = 803 * MHz + 142857,
|
||||
},
|
||||
|
||||
.init = mxl301rf_init,
|
||||
|
@ -4075,10 +4075,10 @@ static void mxl5005s_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops mxl5005s_tuner_ops = {
|
||||
.info = {
|
||||
.name = "MaxLinear MXL5005S",
|
||||
.frequency_min = 48000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "MaxLinear MXL5005S",
|
||||
.frequency_min_hz = 48 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.release = mxl5005s_release,
|
||||
|
@ -186,8 +186,8 @@ static const struct dvb_tuner_ops qm1d1b0004_ops = {
|
||||
.info = {
|
||||
.name = "Sharp qm1d1b0004",
|
||||
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
|
||||
.init = qm1d1b0004_init,
|
||||
|
@ -388,8 +388,8 @@ static const struct dvb_tuner_ops qm1d1c0042_ops = {
|
||||
.info = {
|
||||
.name = "Sharp QM1D1C0042",
|
||||
|
||||
.frequency_min = 950000,
|
||||
.frequency_max = 2150000,
|
||||
.frequency_min_hz = 950 * MHz,
|
||||
.frequency_max_hz = 2150 * MHz,
|
||||
},
|
||||
|
||||
.init = qm1d1c0042_init,
|
||||
|
@ -394,10 +394,10 @@ static int qt1010_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops qt1010_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Quantek QT1010",
|
||||
.frequency_min = QT1010_MIN_FREQ,
|
||||
.frequency_max = QT1010_MAX_FREQ,
|
||||
.frequency_step = QT1010_STEP,
|
||||
.name = "Quantek QT1010",
|
||||
.frequency_min_hz = QT1010_MIN_FREQ,
|
||||
.frequency_max_hz = QT1010_MAX_FREQ,
|
||||
.frequency_step_hz = QT1010_STEP,
|
||||
},
|
||||
|
||||
.release = qt1010_release,
|
||||
|
@ -71,12 +71,14 @@ reg def meaning
|
||||
2f 00 ? not used?
|
||||
*/
|
||||
|
||||
#define QT1010_STEP 125000 /* 125 kHz used by Windows drivers,
|
||||
hw could be more precise but we don't
|
||||
know how to use */
|
||||
#define QT1010_MIN_FREQ 48000000 /* 48 MHz */
|
||||
#define QT1010_MAX_FREQ 860000000 /* 860 MHz */
|
||||
#define QT1010_OFFSET 1246000000 /* 1246 MHz */
|
||||
#define QT1010_STEP (125 * kHz) /*
|
||||
* used by Windows drivers,
|
||||
* hw could be more precise but we don't
|
||||
* know how to use
|
||||
*/
|
||||
#define QT1010_MIN_FREQ (48 * MHz)
|
||||
#define QT1010_MAX_FREQ (860 * MHz)
|
||||
#define QT1010_OFFSET (1246 * MHz)
|
||||
|
||||
#define QT1010_WR 0
|
||||
#define QT1010_RD 1
|
||||
|
@ -2297,9 +2297,9 @@ static void r820t_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops r820t_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Rafael Micro R820T",
|
||||
.frequency_min = 42000000,
|
||||
.frequency_max = 1002000000,
|
||||
.name = "Rafael Micro R820T",
|
||||
.frequency_min_hz = 42 * MHz,
|
||||
.frequency_max_hz = 1002 * MHz,
|
||||
},
|
||||
.init = r820t_init,
|
||||
.release = r820t_release,
|
||||
|
@ -387,9 +387,9 @@ static int si2157_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops si2157_ops = {
|
||||
.info = {
|
||||
.name = "Silicon Labs Si2141/Si2146/2147/2148/2157/2158",
|
||||
.frequency_min = 42000000,
|
||||
.frequency_max = 870000000,
|
||||
.name = "Silicon Labs Si2141/Si2146/2147/2148/2157/2158",
|
||||
.frequency_min_hz = 42 * MHz,
|
||||
.frequency_max_hz = 870 * MHz,
|
||||
},
|
||||
|
||||
.init = si2157_init,
|
||||
|
@ -175,11 +175,11 @@ static int tda18212_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops tda18212_tuner_ops = {
|
||||
.info = {
|
||||
.name = "NXP TDA18212",
|
||||
.name = "NXP TDA18212",
|
||||
|
||||
.frequency_min = 48000000,
|
||||
.frequency_max = 864000000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 48 * MHz,
|
||||
.frequency_max_hz = 864 * MHz,
|
||||
.frequency_step_hz = 1 * kHz,
|
||||
},
|
||||
|
||||
.set_params = tda18212_set_params,
|
||||
|
@ -269,11 +269,11 @@ static void tda18218_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops tda18218_tuner_ops = {
|
||||
.info = {
|
||||
.name = "NXP TDA18218",
|
||||
.name = "NXP TDA18218",
|
||||
|
||||
.frequency_min = 174000000,
|
||||
.frequency_max = 864000000,
|
||||
.frequency_step = 1000,
|
||||
.frequency_min_hz = 174 * MHz,
|
||||
.frequency_max_hz = 864 * MHz,
|
||||
.frequency_step_hz = 1 * kHz,
|
||||
},
|
||||
|
||||
.release = tda18218_release,
|
||||
|
@ -740,9 +740,9 @@ static int tda18250_sleep(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops tda18250_ops = {
|
||||
.info = {
|
||||
.name = "NXP TDA18250",
|
||||
.frequency_min = 42000000,
|
||||
.frequency_max = 870000000,
|
||||
.name = "NXP TDA18250",
|
||||
.frequency_min_hz = 42 * MHz,
|
||||
.frequency_max_hz = 870 * MHz,
|
||||
},
|
||||
|
||||
.init = tda18250_init,
|
||||
|
@ -1240,9 +1240,9 @@ static int tda18271_set_config(struct dvb_frontend *fe, void *priv_cfg)
|
||||
static const struct dvb_tuner_ops tda18271_tuner_ops = {
|
||||
.info = {
|
||||
.name = "NXP TDA18271HD",
|
||||
.frequency_min = 45000000,
|
||||
.frequency_max = 864000000,
|
||||
.frequency_step = 62500
|
||||
.frequency_min_hz = 45 * MHz,
|
||||
.frequency_max_hz = 864 * MHz,
|
||||
.frequency_step_hz = 62500
|
||||
},
|
||||
.init = tda18271_init,
|
||||
.sleep = tda18271_sleep,
|
||||
|
@ -816,9 +816,9 @@ static int tda827x_initial_sleep(struct dvb_frontend *fe)
|
||||
static const struct dvb_tuner_ops tda827xo_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Philips TDA827X",
|
||||
.frequency_min = 55000000,
|
||||
.frequency_max = 860000000,
|
||||
.frequency_step = 250000
|
||||
.frequency_min_hz = 55 * MHz,
|
||||
.frequency_max_hz = 860 * MHz,
|
||||
.frequency_step_hz = 250 * kHz
|
||||
},
|
||||
.release = tda827x_release,
|
||||
.init = tda827x_initial_init,
|
||||
@ -832,9 +832,9 @@ static const struct dvb_tuner_ops tda827xo_tuner_ops = {
|
||||
static const struct dvb_tuner_ops tda827xa_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Philips TDA827XA",
|
||||
.frequency_min = 44000000,
|
||||
.frequency_max = 906000000,
|
||||
.frequency_step = 62500
|
||||
.frequency_min_hz = 44 * MHz,
|
||||
.frequency_max_hz = 906 * MHz,
|
||||
.frequency_step_hz = 62500
|
||||
},
|
||||
.release = tda827x_release,
|
||||
.init = tda827x_init,
|
||||
|
@ -164,9 +164,9 @@ static int tua9001_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
|
||||
static const struct dvb_tuner_ops tua9001_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Infineon TUA9001",
|
||||
.frequency_min = 170000000,
|
||||
.frequency_max = 862000000,
|
||||
.name = "Infineon TUA9001",
|
||||
.frequency_min_hz = 170 * MHz,
|
||||
.frequency_max_hz = 862 * MHz,
|
||||
},
|
||||
|
||||
.init = tua9001_init,
|
||||
|
@ -1440,9 +1440,9 @@ unlock:
|
||||
static const struct dvb_tuner_ops xc2028_dvb_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Xceive XC3028",
|
||||
.frequency_min = 42000000,
|
||||
.frequency_max = 864000000,
|
||||
.frequency_step = 50000,
|
||||
.frequency_min_hz = 42 * MHz,
|
||||
.frequency_max_hz = 864 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.set_config = xc2028_set_config,
|
||||
|
@ -398,8 +398,8 @@ static int xc_set_rf_frequency(struct xc4000_priv *priv, u32 freq_hz)
|
||||
|
||||
dprintk(1, "%s(%u)\n", __func__, freq_hz);
|
||||
|
||||
if ((freq_hz > xc4000_tuner_ops.info.frequency_max) ||
|
||||
(freq_hz < xc4000_tuner_ops.info.frequency_min))
|
||||
if ((freq_hz > xc4000_tuner_ops.info.frequency_max_hz) ||
|
||||
(freq_hz < xc4000_tuner_ops.info.frequency_min_hz))
|
||||
return -EINVAL;
|
||||
|
||||
freq_code = (u16)(freq_hz / 15625);
|
||||
@ -1635,10 +1635,10 @@ static void xc4000_release(struct dvb_frontend *fe)
|
||||
|
||||
static const struct dvb_tuner_ops xc4000_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Xceive XC4000",
|
||||
.frequency_min = 1000000,
|
||||
.frequency_max = 1023000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "Xceive XC4000",
|
||||
.frequency_min_hz = 1 * MHz,
|
||||
.frequency_max_hz = 1023 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.release = xc4000_release,
|
||||
|
@ -460,8 +460,8 @@ static int xc_set_rf_frequency(struct xc5000_priv *priv, u32 freq_hz)
|
||||
|
||||
dprintk(1, "%s(%u)\n", __func__, freq_hz);
|
||||
|
||||
if ((freq_hz > xc5000_tuner_ops.info.frequency_max) ||
|
||||
(freq_hz < xc5000_tuner_ops.info.frequency_min))
|
||||
if ((freq_hz > xc5000_tuner_ops.info.frequency_max_hz) ||
|
||||
(freq_hz < xc5000_tuner_ops.info.frequency_min_hz))
|
||||
return -EINVAL;
|
||||
|
||||
freq_code = (u16)(freq_hz / 15625);
|
||||
@ -1350,10 +1350,10 @@ static int xc5000_set_config(struct dvb_frontend *fe, void *priv_cfg)
|
||||
|
||||
static const struct dvb_tuner_ops xc5000_tuner_ops = {
|
||||
.info = {
|
||||
.name = "Xceive XC5000",
|
||||
.frequency_min = 1000000,
|
||||
.frequency_max = 1023000000,
|
||||
.frequency_step = 50000,
|
||||
.name = "Xceive XC5000",
|
||||
.frequency_min_hz = 1 * MHz,
|
||||
.frequency_max_hz = 1023 * MHz,
|
||||
.frequency_step_hz = 50 * kHz,
|
||||
},
|
||||
|
||||
.release = xc5000_release,
|
||||
|
@ -465,9 +465,9 @@ static const struct dvb_tuner_ops mxl111sf_tuner_tuner_ops = {
|
||||
.info = {
|
||||
.name = "MaxLinear MxL111SF",
|
||||
#if 0
|
||||
.frequency_min = ,
|
||||
.frequency_max = ,
|
||||
.frequency_step = ,
|
||||
.frequency_min_hz = ,
|
||||
.frequency_max_hz = ,
|
||||
.frequency_step_hz = ,
|
||||
#endif
|
||||
},
|
||||
#if 0
|
||||
|
@ -52,6 +52,10 @@
|
||||
*/
|
||||
#define MAX_DELSYS 8
|
||||
|
||||
/* Helper definitions to be used at frontend drivers */
|
||||
#define kHz 1000UL
|
||||
#define MHz 1000000UL
|
||||
|
||||
/**
|
||||
* struct dvb_frontend_tune_settings - parameters to adjust frontend tuning
|
||||
*
|
||||
@ -73,22 +77,19 @@ struct dvb_frontend;
|
||||
* struct dvb_tuner_info - Frontend name and min/max ranges/bandwidths
|
||||
*
|
||||
* @name: name of the Frontend
|
||||
* @frequency_min: minimal frequency supported
|
||||
* @frequency_max: maximum frequency supported
|
||||
* @frequency_step: frequency step
|
||||
* @frequency_min_hz: minimal frequency supported in Hz
|
||||
* @frequency_max_hz: maximum frequency supported in Hz
|
||||
* @frequency_step_hz: frequency step in Hz
|
||||
* @bandwidth_min: minimal frontend bandwidth supported
|
||||
* @bandwidth_max: maximum frontend bandwidth supported
|
||||
* @bandwidth_step: frontend bandwidth step
|
||||
*
|
||||
* NOTE: frequency parameters are in Hz, for terrestrial/cable or kHz for
|
||||
* satellite.
|
||||
*/
|
||||
struct dvb_tuner_info {
|
||||
char name[128];
|
||||
|
||||
u32 frequency_min;
|
||||
u32 frequency_max;
|
||||
u32 frequency_step;
|
||||
u32 frequency_min_hz;
|
||||
u32 frequency_max_hz;
|
||||
u32 frequency_step_hz;
|
||||
|
||||
u32 bandwidth_min;
|
||||
u32 bandwidth_max;
|
||||
|
Loading…
Reference in New Issue
Block a user