DVB: represent frequencies at tuner/frontend .info in Hz
Subsystems (43)
cover DVB: represent frequencies at tuner/frontend .info in Hz
This is a long standing issue that affect newer devices whose tuner and frontend are capable of supporting both satellite and non-satellite delivery standards.
Compile-tested only.
I intend to run some tests later this week with some random hardware, but I'd appreciate any tests and feedback, as it is not hard to break something, but we can't cook an omelet without breaking some eggs.
Mauro Carvalho Chehab (2):
media: dvb: convert tuner_info frequencies to Hz
media: dvb: represent min/max/step/tolerance freqs in Hz
drivers/media/common/siano/smsdvb-main.c | 6 +- drivers/media/dvb-core/dvb_frontend.c | 63 +++++++++++++++---- drivers/media/dvb-frontends/af9013.c | 7 +-- drivers/media/dvb-frontends/af9033.c | 7 +-- drivers/media/dvb-frontends/as102_fe.c | 6 +- drivers/media/dvb-frontends/ascot2e.c | 6 +- drivers/media/dvb-frontends/atbm8830.c | 6 +- drivers/media/dvb-frontends/au8522_dig.c | 6 +- drivers/media/dvb-frontends/bcm3510.c | 6 +- drivers/media/dvb-frontends/cx22700.c | 6 +- drivers/media/dvb-frontends/cx22702.c | 6 +- drivers/media/dvb-frontends/cx24110.c | 8 +-- drivers/media/dvb-frontends/cx24113.c | 8 +-- drivers/media/dvb-frontends/cx24116.c | 8 +-- drivers/media/dvb-frontends/cx24117.c | 8 +-- drivers/media/dvb-frontends/cx24120.c | 8 +-- drivers/media/dvb-frontends/cx24123.c | 8 +-- drivers/media/dvb-frontends/cxd2820r_t.c | 4 +- drivers/media/dvb-frontends/cxd2820r_t2.c | 4 +- drivers/media/dvb-frontends/cxd2841er.c | 9 ++- .../media/dvb-frontends/cxd2880/cxd2880_top.c | 6 +- drivers/media/dvb-frontends/dib0070.c | 8 +-- drivers/media/dvb-frontends/dib0090.c | 12 ++-- drivers/media/dvb-frontends/dib3000mb.c | 6 +- drivers/media/dvb-frontends/dib3000mc.c | 6 +- drivers/media/dvb-frontends/dib7000m.c | 6 +- drivers/media/dvb-frontends/dib7000p.c | 6 +- drivers/media/dvb-frontends/dib8000.c | 6 +- drivers/media/dvb-frontends/dib9000.c | 6 +- drivers/media/dvb-frontends/drx39xyj/drxj.c | 6 +- drivers/media/dvb-frontends/drxd_hard.c | 7 +-- drivers/media/dvb-frontends/drxk_hard.c | 8 +-- drivers/media/dvb-frontends/ds3000.c | 8 +-- drivers/media/dvb-frontends/dvb-pll.c | 16 ++++- drivers/media/dvb-frontends/dvb_dummy_fe.c | 24 +++---- drivers/media/dvb-frontends/gp8psk-fe.c | 6 +- drivers/media/dvb-frontends/helene.c | 12 ++-- drivers/media/dvb-frontends/horus3a.c | 6 +- drivers/media/dvb-frontends/itd1000.c | 8 +-- drivers/media/dvb-frontends/ix2505v.c | 8 +-- drivers/media/dvb-frontends/l64781.c | 7 +-- drivers/media/dvb-frontends/lg2160.c | 12 ++-- drivers/media/dvb-frontends/lgdt3305.c | 12 ++-- drivers/media/dvb-frontends/lgdt3306a.c | 6 +- drivers/media/dvb-frontends/lgdt330x.c | 12 ++-- drivers/media/dvb-frontends/lgs8gl5.c | 7 +-- drivers/media/dvb-frontends/lgs8gxx.c | 6 +- drivers/media/dvb-frontends/m88ds3103.c | 6 +- drivers/media/dvb-frontends/m88rs2000.c | 8 +-- drivers/media/dvb-frontends/mb86a16.c | 7 +-- drivers/media/dvb-frontends/mb86a20s.c | 6 +- drivers/media/dvb-frontends/mt312.c | 10 +-- drivers/media/dvb-frontends/mt352.c | 7 +-- drivers/media/dvb-frontends/mxl5xx.c | 6 +- drivers/media/dvb-frontends/nxt200x.c | 6 +- drivers/media/dvb-frontends/nxt6000.c | 6 +- drivers/media/dvb-frontends/or51132.c | 6 +- drivers/media/dvb-frontends/or51211.c | 8 +-- drivers/media/dvb-frontends/rtl2830.c | 4 +- drivers/media/dvb-frontends/rtl2832.c | 10 +-- drivers/media/dvb-frontends/s5h1409.c | 6 +- drivers/media/dvb-frontends/s5h1411.c | 6 +- drivers/media/dvb-frontends/s5h1420.c | 8 +-- drivers/media/dvb-frontends/s5h1432.c | 6 +- drivers/media/dvb-frontends/s921.c | 7 +-- drivers/media/dvb-frontends/si2165.c | 2 +- drivers/media/dvb-frontends/si21xx.c | 7 +-- drivers/media/dvb-frontends/sp8870.c | 6 +- drivers/media/dvb-frontends/sp887x.c | 6 +- drivers/media/dvb-frontends/stb0899_drv.c | 6 +- drivers/media/dvb-frontends/stb6000.c | 4 +- drivers/media/dvb-frontends/stb6100.c | 5 +- drivers/media/dvb-frontends/stv0288.c | 7 +-- drivers/media/dvb-frontends/stv0297.c | 6 +- drivers/media/dvb-frontends/stv0299.c | 7 +-- drivers/media/dvb-frontends/stv0367.c | 20 +++--- drivers/media/dvb-frontends/stv0900_core.c | 7 +-- drivers/media/dvb-frontends/stv090x.c | 6 +- drivers/media/dvb-frontends/stv0910.c | 6 +- drivers/media/dvb-frontends/stv6110.c | 6 +- drivers/media/dvb-frontends/stv6110x.c | 7 +-- drivers/media/dvb-frontends/stv6111.c | 5 +- drivers/media/dvb-frontends/tc90522.c | 10 +-- drivers/media/dvb-frontends/tda10021.c | 10 +-- drivers/media/dvb-frontends/tda10023.c | 6 +- drivers/media/dvb-frontends/tda10048.c | 6 +- drivers/media/dvb-frontends/tda1004x.c | 12 ++-- drivers/media/dvb-frontends/tda10071.c | 10 +-- drivers/media/dvb-frontends/tda10086.c | 6 +- drivers/media/dvb-frontends/tda18271c2dd.c | 6 +- drivers/media/dvb-frontends/tda665x.c | 6 +- drivers/media/dvb-frontends/tda8083.c | 7 +-- drivers/media/dvb-frontends/tda8261.c | 9 ++- drivers/media/dvb-frontends/tda826x.c | 4 +- drivers/media/dvb-frontends/ts2020.c | 4 +- drivers/media/dvb-frontends/tua6100.c | 6 +- drivers/media/dvb-frontends/ves1820.c | 6 +- drivers/media/dvb-frontends/ves1x93.c | 8 +-- drivers/media/dvb-frontends/zl10036.c | 8 +-- drivers/media/dvb-frontends/zl10353.c | 7 +-- drivers/media/firewire/firedtv-fe.c | 26 ++++---- drivers/media/pci/bt8xx/dst.c | 26 ++++---- drivers/media/pci/bt8xx/dvb-bt8xx.c | 8 +-- drivers/media/pci/ddbridge/ddbridge-mci.c | 6 +- drivers/media/pci/mantis/mantis_vp3030.c | 4 +- drivers/media/tuners/e4000.c | 6 +- drivers/media/tuners/fc0011.c | 6 +- drivers/media/tuners/fc0012.c | 7 +-- drivers/media/tuners/fc0013.c | 7 +-- drivers/media/tuners/fc2580.c | 6 +- drivers/media/tuners/it913x.c | 6 +- drivers/media/tuners/m88rs6000t.c | 6 +- drivers/media/tuners/max2165.c | 8 +-- drivers/media/tuners/mc44s803.c | 8 +-- drivers/media/tuners/mt2060.c | 8 +-- drivers/media/tuners/mt2063.c | 7 +-- drivers/media/tuners/mt2131.c | 8 +-- drivers/media/tuners/mt2266.c | 8 +-- drivers/media/tuners/mxl301rf.c | 4 +- drivers/media/tuners/mxl5005s.c | 8 +-- drivers/media/tuners/mxl5007t.c | 2 - drivers/media/tuners/qm1d1b0004.c | 4 +- drivers/media/tuners/qm1d1c0042.c | 4 +- drivers/media/tuners/qt1010.c | 8 +-- drivers/media/tuners/qt1010_priv.h | 14 +++-- drivers/media/tuners/r820t.c | 6 +- drivers/media/tuners/si2157.c | 6 +- drivers/media/tuners/tda18212.c | 8 +-- drivers/media/tuners/tda18218.c | 8 +-- drivers/media/tuners/tda18250.c | 6 +- drivers/media/tuners/tda18271-fe.c | 6 +- drivers/media/tuners/tda827x.c | 12 ++-- drivers/media/tuners/tua9001.c | 6 +- drivers/media/tuners/tuner-xc2028.c | 6 +- drivers/media/tuners/xc4000.c | 12 ++-- drivers/media/tuners/xc5000.c | 12 ++-- drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | 6 +- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | 6 +- drivers/media/usb/dvb-usb/af9005-fe.c | 6 +- drivers/media/usb/dvb-usb/cinergyT2-fe.c | 6 +- drivers/media/usb/dvb-usb/dtt200u-fe.c | 6 +- drivers/media/usb/dvb-usb/friio-fe.c | 11 ++-- drivers/media/usb/dvb-usb/vp702x-fe.c | 7 +-- drivers/media/usb/dvb-usb/vp7045-fe.c | 6 +- drivers/media/usb/ttusb-dec/ttusbdecfe.c | 12 ++-- include/media/dvb_frontend.h | 49 ++++++++++++--- 146 files changed, 621 insertions(+), 577 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 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.
--- drivers/media/dvb-core/dvb_frontend.c | 25 ++++++++++++++++--- drivers/media/dvb-frontends/ascot2e.c | 6 ++--- drivers/media/dvb-frontends/cx24113.c | 8 +++--- drivers/media/dvb-frontends/dib0070.c | 8 +++--- drivers/media/dvb-frontends/dib0090.c | 12 ++++----- drivers/media/dvb-frontends/dvb-pll.c | 16 ++++++++++-- drivers/media/dvb-frontends/helene.c | 12 ++++----- drivers/media/dvb-frontends/horus3a.c | 6 ++--- drivers/media/dvb-frontends/itd1000.c | 8 +++--- drivers/media/dvb-frontends/ix2505v.c | 4 +-- drivers/media/dvb-frontends/stb6000.c | 4 +-- drivers/media/dvb-frontends/stb6100.c | 5 ++-- drivers/media/dvb-frontends/stv6110.c | 6 ++--- drivers/media/dvb-frontends/stv6110x.c | 7 +++--- drivers/media/dvb-frontends/stv6111.c | 5 ++-- drivers/media/dvb-frontends/tda18271c2dd.c | 6 ++--- drivers/media/dvb-frontends/tda665x.c | 6 ++--- drivers/media/dvb-frontends/tda8261.c | 9 +++---- drivers/media/dvb-frontends/tda826x.c | 4 +-- drivers/media/dvb-frontends/ts2020.c | 4 +-- drivers/media/dvb-frontends/tua6100.c | 6 ++--- drivers/media/dvb-frontends/zl10036.c | 4 +-- drivers/media/tuners/e4000.c | 6 ++--- drivers/media/tuners/fc0011.c | 6 ++--- drivers/media/tuners/fc0012.c | 7 +++--- drivers/media/tuners/fc0013.c | 7 +++--- drivers/media/tuners/fc2580.c | 6 ++--- drivers/media/tuners/it913x.c | 6 ++--- drivers/media/tuners/m88rs6000t.c | 6 ++--- drivers/media/tuners/max2165.c | 8 +++--- drivers/media/tuners/mc44s803.c | 8 +++--- drivers/media/tuners/mt2060.c | 8 +++--- drivers/media/tuners/mt2063.c | 7 +++--- drivers/media/tuners/mt2131.c | 8 +++--- drivers/media/tuners/mt2266.c | 8 +++--- drivers/media/tuners/mxl301rf.c | 4 +-- drivers/media/tuners/mxl5005s.c | 8 +++--- drivers/media/tuners/qm1d1b0004.c | 4 +-- drivers/media/tuners/qm1d1c0042.c | 4 +-- drivers/media/tuners/qt1010.c | 8 +++--- drivers/media/tuners/qt1010_priv.h | 14 ++++++----- drivers/media/tuners/r820t.c | 6 ++--- drivers/media/tuners/si2157.c | 6 ++--- drivers/media/tuners/tda18212.c | 8 +++--- drivers/media/tuners/tda18218.c | 8 +++--- drivers/media/tuners/tda18250.c | 6 ++--- drivers/media/tuners/tda18271-fe.c | 6 ++--- drivers/media/tuners/tda827x.c | 12 ++++----- drivers/media/tuners/tua9001.c | 6 ++--- drivers/media/tuners/tuner-xc2028.c | 6 ++--- drivers/media/tuners/xc4000.c | 12 ++++----- drivers/media/tuners/xc5000.c | 12 ++++----- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | 6 ++--- include/media/dvb_frontend.h | 19 +++++++------- 54 files changed, 221 insertions(+), 196 deletions(-)
drivers/media/dvb-core/dvb_frontend.c +21 -4
@@ -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,
drivers/media/dvb-frontends/ascot2e.c +3 -3
@@ -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,
drivers/media/dvb-frontends/cx24113.c +4 -4
@@ -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,
drivers/media/dvb-frontends/dib0070.c +4 -4
@@ -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,
drivers/media/dvb-frontends/dib0090.c +6 -6
@@ -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,
drivers/media/dvb-frontends/dvb-pll.c +14 -2
@@ -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)
drivers/media/dvb-frontends/helene.c +6 -6
@@ -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,
drivers/media/dvb-frontends/horus3a.c +3 -3
@@ -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,
drivers/media/dvb-frontends/itd1000.c +4 -4
@@ -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,
drivers/media/dvb-frontends/ix2505v.c +2 -2
@@ -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,
drivers/media/dvb-frontends/stb6000.c +2 -2
@@ -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,
drivers/media/dvb-frontends/stb6100.c +2 -3
@@ -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,
drivers/media/dvb-frontends/stv6110.c +3 -3
@@ -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 * kHz, }, .init = stv6110_init, .release = stv6110_release,
drivers/media/dvb-frontends/stv6110x.c +3 -4
@@ -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 };
drivers/media/dvb-frontends/stv6111.c +2 -3
@@ -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,
drivers/media/dvb-frontends/tda18271c2dd.c +3 -3
@@ -1214,9 +1214,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,
drivers/media/dvb-frontends/tda665x.c +3 -3
@@ -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);
drivers/media/dvb-frontends/tda8261.c +4 -5
@@ -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];pr_info ("%s: Attaching TDA8261 8PSK/QPSK tuner\n" , __func__);
drivers/media/dvb-frontends/tda826x.c +2 -2
@@ -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,
drivers/media/dvb-frontends/ts2020.c +2 -2
@@ -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,
drivers/media/dvb-frontends/tua6100.c +3 -3
@@ -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 * kHz, }, .release = tua6100_release, .sleep = tua6100_sleep,
drivers/media/dvb-frontends/zl10036.c +2 -2
@@ -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,
drivers/media/tuners/e4000.c +3 -3
@@ -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,
drivers/media/tuners/fc0011.c +3 -3
@@ -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,
drivers/media/tuners/fc0012.c +3 -4
@@ -415,11 +415,10 @@ static int fc0012_get_rf_strength(struct dvb_frontend *fe, u16 *strength)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,
drivers/media/tuners/fc0013.c +3 -4
@@ -574,11 +574,10 @@ static int fc0013_get_rf_strength(struct dvb_frontend *fe, u16 *strength)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,
drivers/media/tuners/fc2580.c +3 -3
@@ -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,
drivers/media/tuners/it913x.c +3 -3
@@ -375,9 +375,9 @@ static int it913x_set_params(struct dvb_frontend *fe)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,
drivers/media/tuners/m88rs6000t.c +3 -3
@@ -569,9 +569,9 @@ static int m88rs6000t_get_rf_strength(struct dvb_frontend *fe, u16 *strength)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,
drivers/media/tuners/max2165.c +4 -4
@@ -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 * MHz, }, .release = max2165_release,
drivers/media/tuners/mc44s803.c +4 -4
@@ -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,
drivers/media/tuners/mt2060.c +4 -4
@@ -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,
drivers/media/tuners/mt2063.c +3 -4
@@ -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,
drivers/media/tuners/mt2131.c +4 -4
@@ -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,
drivers/media/tuners/mt2266.c +4 -4
@@ -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,
drivers/media/tuners/mxl301rf.c +2 -2
@@ -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,
drivers/media/tuners/mxl5005s.c +4 -4
@@ -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,
drivers/media/tuners/qm1d1b0004.c +2 -2
@@ -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,
drivers/media/tuners/qm1d1c0042.c +2 -2
@@ -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,
drivers/media/tuners/qt1010.c +4 -4
@@ -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,
drivers/media/tuners/qt1010_priv.h +8 -6
@@ -71,12 +71,14 @@ reg def meaning2f 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
drivers/media/tuners/r820t.c +3 -3
@@ -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,
drivers/media/tuners/si2157.c +3 -3
@@ -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,
drivers/media/tuners/tda18212.c +4 -4
@@ -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,
drivers/media/tuners/tda18218.c +4 -4
@@ -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,
drivers/media/tuners/tda18250.c +3 -3
@@ -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,
drivers/media/tuners/tda18271-fe.c +3 -3
@@ -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,
drivers/media/tuners/tda827x.c +6 -6
@@ -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,
drivers/media/tuners/tua9001.c +3 -3
@@ -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,
drivers/media/tuners/tuner-xc2028.c +3 -3
@@ -1440,9 +1440,9 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg)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,
drivers/media/tuners/xc4000.c +6 -6
@@ -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,
drivers/media/tuners/xc5000.c +6 -6
@@ -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,
drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c +3 -3
@@ -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
include/media/dvb_frontend.h +10 -9
@@ -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;
Signature · 1 line
2.17.1
Michael Ira Krufky
maintainerRe: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz
Quoted 10 lines · Mauro Carvalho Chehab
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.
Quoted 5 lines
So, convert everything to specify tuner frequencies in Hz.
Plese notice that a similar patch is also needed for frontends.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
I'm okay with the idea behind this, but I'm not sure I'm behind the way it's being done. What if, rather than changing every tuner range to HZ, instead, to add a new field to indicate the magnitude. This can be Hz, KHz, MHz, etc
This way, the ranges would remain unaltered, and userspace can remain unchanged. Although the patch as-is may solve a problem, it might be better to solve it with less impact.
-Mike Krufky
Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz
Em Thu, 5 Jul 2018 08:35:24 -0400
Michael Ira Krufky <[email protected]> escreveu:
Quoted 18 lines
Quoted 10 lines · Mauro Carvalho Chehab
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.
Quoted 5 lines
So, convert everything to specify tuner frequencies in Hz.
Plese notice that a similar patch is also needed for frontends.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Quoted 8 lines
I'm okay with the idea behind this, but I'm not sure I'm behind the way it's being done. What if, rather than changing every tuner range to HZ, instead, to add a new field to indicate the magnitude. This can be Hz, KHz, MHz, etc
This way, the ranges would remain unaltered, and userspace can remain unchanged. Although the patch as-is may solve a problem, it might be better to solve it with less impact.
With just those patches, userspace remains unchanged. Internally, the DVB core handles kHz conversion when needed, but it will keep exposing data from FE_GET_INFO on kHz for Satellite systems or in Hz for cable/terrestrial in a transparent way.
In the future, it could be interesting to change internally the frequencies to u64 and have some new ioctls (or dtv properties) that would always handle frequencies in Hz.
With those patches, doing such change should be really simple, as now the internal representation becomes independent from the external one (see patch 2/2).
Thanks,
Mauro
Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz
In reply to Mauro Carvalho ChehabQuoted 8 lines · On Wed, 4 Jul 2018 23:46:56 -0300 Mauro Carvalho Chehab…
drivers/media/tuners/fc0011.c +0
-0@@ -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 = {
drivers/media/tuners/fc0011.c static int fc0011_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) · line 481
Quoted 10 lines
drivers/media/tuners/fc0011.c +3
-3- .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,
What about a GHz definition for 1000 * MHz?
Signature · 1 line
Michael
Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz
Em Thu, 5 Jul 2018 21:16:06 +0200
Michael Büsch <[email protected]> escreveu:
Quoted 20 lines
Quoted 17 lines · On Wed, 4 Jul 2018 23:46:56 -0300 Mauro Carvalho Chehab…
drivers/media/tuners/fc0011.c +3
-3@@ -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, },
Quoted 5 lines
drivers/media/tuners/fc0011.c static int fc0011_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) · line 481
Quoted 1 line
drivers/media/tuners/fc0011.c +0
-0.release = fc0011_release,Acked-by Michael Büsch <[email protected]>What about a GHz definition for 1000 * MHz?
Not sure if it would be worth. The main goal of using the multiplier macros it so make easier to recognize values. Reading up to 4-5 digits is usually easy for humans.
In particular, my main goal is to make it easier to check if the values for each driver is OK for me, while writing the patch, and for reviewers to check if the values make sense.
Also, almost all DVB-T and DVB-C drivers use a max frequency around 850 MHz, and almost all DVB-S uses 2150 MHz. On both cases, it is better to write the values in MHz.
So, the only case where GHZ would be used, in practice would be on two drivers:
$ git grep "1000 \* MHz" drivers/media/tuners/fc0011.c: .frequency_max_hz = 1000 * MHz, drivers/media/tuners/mc44s803.c: .frequency_max_hz = 1000 * MHz,
Thanks,
Mauro
PATCH 2/2 media: dvb: represent min/max/step/tolerance freqs in Hz
In reply to Mauro Carvalho ChehabRight now, satellite frontend drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers.
However, the main problem is that universal frontends 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 frontends.
So, convert everything to specify frontend frequencies in Hz.
--- drivers/media/common/siano/smsdvb-main.c | 6 +- drivers/media/dvb-core/dvb_frontend.c | 72 ++++++++++++------- drivers/media/dvb-frontends/af9013.c | 7 +- drivers/media/dvb-frontends/af9033.c | 7 +- drivers/media/dvb-frontends/as102_fe.c | 6 +- drivers/media/dvb-frontends/atbm8830.c | 6 +- drivers/media/dvb-frontends/au8522_dig.c | 6 +- drivers/media/dvb-frontends/bcm3510.c | 6 +- drivers/media/dvb-frontends/cx22700.c | 6 +- drivers/media/dvb-frontends/cx22702.c | 6 +- drivers/media/dvb-frontends/cx24110.c | 8 +-- drivers/media/dvb-frontends/cx24116.c | 8 +-- drivers/media/dvb-frontends/cx24117.c | 8 +-- drivers/media/dvb-frontends/cx24120.c | 8 +-- drivers/media/dvb-frontends/cx24123.c | 8 +-- drivers/media/dvb-frontends/cxd2820r_t.c | 4 +- drivers/media/dvb-frontends/cxd2820r_t2.c | 4 +- drivers/media/dvb-frontends/cxd2841er.c | 9 ++- .../media/dvb-frontends/cxd2880/cxd2880_top.c | 6 +- drivers/media/dvb-frontends/dib3000mb.c | 6 +- drivers/media/dvb-frontends/dib3000mc.c | 6 +- drivers/media/dvb-frontends/dib7000m.c | 6 +- drivers/media/dvb-frontends/dib7000p.c | 6 +- drivers/media/dvb-frontends/dib8000.c | 6 +- drivers/media/dvb-frontends/dib9000.c | 6 +- drivers/media/dvb-frontends/drx39xyj/drxj.c | 6 +- drivers/media/dvb-frontends/drxd_hard.c | 7 +- drivers/media/dvb-frontends/drxk_hard.c | 8 +-- drivers/media/dvb-frontends/ds3000.c | 8 +-- drivers/media/dvb-frontends/dvb_dummy_fe.c | 24 +++---- drivers/media/dvb-frontends/gp8psk-fe.c | 6 +- drivers/media/dvb-frontends/ix2505v.c | 4 +- drivers/media/dvb-frontends/l64781.c | 7 +- drivers/media/dvb-frontends/lg2160.c | 12 ++-- drivers/media/dvb-frontends/lgdt3305.c | 12 ++-- drivers/media/dvb-frontends/lgdt3306a.c | 6 +- drivers/media/dvb-frontends/lgdt330x.c | 12 ++-- drivers/media/dvb-frontends/lgs8gl5.c | 7 +- drivers/media/dvb-frontends/lgs8gxx.c | 6 +- drivers/media/dvb-frontends/m88ds3103.c | 6 +- drivers/media/dvb-frontends/m88rs2000.c | 8 +-- drivers/media/dvb-frontends/mb86a16.c | 7 +- drivers/media/dvb-frontends/mb86a20s.c | 6 +- drivers/media/dvb-frontends/mt312.c | 10 +-- drivers/media/dvb-frontends/mt352.c | 7 +- drivers/media/dvb-frontends/mxl5xx.c | 6 +- drivers/media/dvb-frontends/nxt200x.c | 6 +- drivers/media/dvb-frontends/nxt6000.c | 6 +- drivers/media/dvb-frontends/or51132.c | 6 +- drivers/media/dvb-frontends/or51211.c | 8 +-- drivers/media/dvb-frontends/rtl2830.c | 4 +- drivers/media/dvb-frontends/rtl2832.c | 10 +-- drivers/media/dvb-frontends/s5h1409.c | 6 +- drivers/media/dvb-frontends/s5h1411.c | 6 +- drivers/media/dvb-frontends/s5h1420.c | 8 +-- drivers/media/dvb-frontends/s5h1432.c | 6 +- drivers/media/dvb-frontends/s921.c | 7 +- drivers/media/dvb-frontends/si2165.c | 2 +- drivers/media/dvb-frontends/si21xx.c | 7 +- drivers/media/dvb-frontends/sp8870.c | 6 +- drivers/media/dvb-frontends/sp887x.c | 6 +- drivers/media/dvb-frontends/stb0899_drv.c | 6 +- drivers/media/dvb-frontends/stv0288.c | 7 +- drivers/media/dvb-frontends/stv0297.c | 6 +- drivers/media/dvb-frontends/stv0299.c | 7 +- drivers/media/dvb-frontends/stv0367.c | 20 +++--- drivers/media/dvb-frontends/stv0900_core.c | 7 +- drivers/media/dvb-frontends/stv090x.c | 6 +- drivers/media/dvb-frontends/stv0910.c | 6 +- drivers/media/dvb-frontends/tc90522.c | 10 +-- drivers/media/dvb-frontends/tda10021.c | 10 +-- drivers/media/dvb-frontends/tda10023.c | 6 +- drivers/media/dvb-frontends/tda10048.c | 6 +- drivers/media/dvb-frontends/tda1004x.c | 12 ++-- drivers/media/dvb-frontends/tda10071.c | 10 +-- drivers/media/dvb-frontends/tda10086.c | 6 +- drivers/media/dvb-frontends/tda8083.c | 7 +- drivers/media/dvb-frontends/ves1820.c | 6 +- drivers/media/dvb-frontends/ves1x93.c | 8 +-- drivers/media/dvb-frontends/zl10036.c | 4 +- drivers/media/dvb-frontends/zl10353.c | 7 +- drivers/media/firewire/firedtv-fe.c | 26 +++---- drivers/media/pci/bt8xx/dst.c | 26 +++---- drivers/media/pci/bt8xx/dvb-bt8xx.c | 8 +-- drivers/media/pci/ddbridge/ddbridge-mci.c | 6 +- drivers/media/pci/mantis/mantis_vp3030.c | 4 +- drivers/media/tuners/mxl5007t.c | 2 - drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | 6 +- drivers/media/usb/dvb-usb/af9005-fe.c | 6 +- drivers/media/usb/dvb-usb/cinergyT2-fe.c | 6 +- drivers/media/usb/dvb-usb/dtt200u-fe.c | 6 +- drivers/media/usb/dvb-usb/friio-fe.c | 11 ++- drivers/media/usb/dvb-usb/vp702x-fe.c | 7 +- drivers/media/usb/dvb-usb/vp7045-fe.c | 6 +- drivers/media/usb/ttusb-dec/ttusbdecfe.c | 12 ++-- include/media/dvb_frontend.h | 30 +++++++- 96 files changed, 417 insertions(+), 398 deletions(-)
drivers/media/common/siano/smsdvb-main.c +3 -3
@@ -1047,9 +1047,9 @@ static void smsdvb_release(struct dvb_frontend *fe)static const struct dvb_frontend_ops smsdvb_fe_ops = { .info = { .name ="Siano Mobile Digital MDTV Receiver" , - .frequency_min =44250000 , - .frequency_max =867250000 , - .frequency_stepsize =250000 , + .frequency_min_hz =44250 * kHz, + .frequency_max_hz =867250 * kHz, + .frequency_stepsize_hz =250 * kHz, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-core/dvb_frontend.c +48 -24
110 lines not on this page · raw message
drivers/media/dvb-frontends/af9013.c +3 -4
@@ -1136,10 +1136,9 @@ static const struct dvb_frontend_ops af9013_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Afatech AF9013", - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize = 250000, - .frequency_tolerance = 0, + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 250 * kHz, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
drivers/media/dvb-frontends/af9033.c +3 -4
@@ -1020,10 +1020,9 @@ static const struct dvb_frontend_ops af9033_ops = { .delsys = {SYS_DVBT}, .info = { .name = "Afatech AF9033 (DVB-T)", - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize = 250000, - .frequency_tolerance = 0, + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 250 * kHz, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
drivers/media/dvb-frontends/as102_fe.c +3 -3
@@ -419,9 +419,9 @@ static const struct dvb_frontend_ops as102_fe_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Abilis AS102 DVB-T", - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize =166667 , + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz =166667 , .caps = FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO
drivers/media/dvb-frontends/atbm8830.c +3 -3
@@ -428,9 +428,9 @@ static const struct dvb_frontend_ops atbm8830_ops = { .delsys = { SYS_DTMB }, .info = { .name = "AltoBeam ATBM8830/8831 DMB-TH", - .frequency_min = 474000000, - .frequency_max = 858000000, - .frequency_stepsize = 10000, + .frequency_min_hz = 474 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 10 * kHz, .caps =FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/au8522_dig.c +3 -3
@@ -897,9 +897,9 @@ static const struct dvb_frontend_ops au8522_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Auvitek AU8522 QAM/8VSB Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB },
drivers/media/dvb-frontends/bcm3510.c +2 -4
@@ -840,10 +840,8 @@ static const struct dvb_frontend_ops bcm3510_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Broadcom BCM3510 VSB/QAM frontend" , - .frequency_min = 54000000, - .frequency_max = 803000000, -/* stepsize is just a guess */ - .frequency_stepsize = 0, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 803 * MHz, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/cx22700.c +3 -3
@@ -412,9 +412,9 @@ static const struct dvb_frontend_ops cx22700_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Conexant CX22700 DVB-T", - .frequency_min = 470000000, - .frequency_max = 860000000, - .frequency_stepsize = 166667, + .frequency_min_hz = 470 * MHz, + .frequency_max_hz = 860 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
drivers/media/dvb-frontends/cx22702.c +3 -3
@@ -622,9 +622,9 @@ static const struct dvb_frontend_ops cx22702_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Conexant CX22702 DVB-T", - .frequency_min = 177000000, - .frequency_max = 858000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 177 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166666, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/cx24110.c +4 -4
@@ -629,10 +629,10 @@ static const struct dvb_frontend_ops cx24110_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Conexant CX24110 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1011 * kHz, + .frequency_tolerance_hz = 29500 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/cx24116.c +4 -4
@@ -1465,10 +1465,10 @@ static const struct dvb_frontend_ops cx24116_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="Conexant CX24116/CX24118" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1011 * kHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/cx24117.c +4 -4
@@ -1622,10 +1622,10 @@ static const struct dvb_frontend_ops cx24117_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="Conexant CX24117/CX24132" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1011 * kHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/cx24120.c +4 -4
@@ -1555,10 +1555,10 @@ static const struct dvb_frontend_ops cx24120_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="Conexant CX24120/CX24118" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1011 * kHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/cx24123.c +4 -4
@@ -1111,10 +1111,10 @@ static const struct dvb_frontend_ops cx24123_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Conexant CX24123/CX24109", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1011 * kHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/cxd2820r_t.c +2 -2
@@ -431,8 +431,8 @@ int cxd2820r_get_tune_settings_t(struct dvb_frontend *fe, struct dvb_frontend_tune_settings *s) { s->min_delay_ms =500 ; - s->step_size = fe->ops.info.frequency_stepsize *2 ; - s->max_drift = (fe->ops.info.frequency_stepsize *2 ) +1 ; + s->step_size = fe->ops.info.frequency_stepsize_hz *2 ; + s->max_drift = (fe->ops.info.frequency_stepsize_hz *2 ) +1 ;return 0 ; }
drivers/media/dvb-frontends/cxd2820r_t2.c +2 -2
@@ -426,8 +426,8 @@ int cxd2820r_get_tune_settings_t2(struct dvb_frontend *fe, struct dvb_frontend_tune_settings *s) { s->min_delay_ms =1500 ; - s->step_size = fe->ops.info.frequency_stepsize *2 ; - s->max_drift = (fe->ops.info.frequency_stepsize *2 ) +1 ; + s->step_size = fe->ops.info.frequency_stepsize_hz *2 ; + s->max_drift = (fe->ops.info.frequency_stepsize_hz *2 ) +1 ;return 0 ; }
drivers/media/dvb-frontends/cxd2841er.c +4 -5
@@ -3942,9 +3942,8 @@ static const struct dvb_frontend_ops cxd2841er_dvbs_s2_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="Sony CXD2841ER DVB-S/S2 demodulator" , - .frequency_min = 500000, - .frequency_max = 2500000, - .frequency_stepsize = 0, + .frequency_min_hz = 500 * MHz, + .frequency_max_hz = 2500 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500,
@@ -3988,8 +3987,8 @@ static struct dvb_frontend_ops cxd2841er_t_c_ops = {FE_CAN_HIERARCHY_AUTO |FE_CAN_MUTE_TS | FE_CAN_2G_MODULATION, - .frequency_min = 42000000, - .frequency_max = 1002000000, + .frequency_min_hz = 42 * MHz, + .frequency_max_hz = 1002 * MHz, .symbol_rate_min = 870000, .symbol_rate_max =11700000 },
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c +3 -3
@@ -1833,9 +1833,9 @@ static enum dvbfe_algo cxd2880_get_frontend_algo(struct dvb_frontend *fe)static struct dvb_frontend_ops cxd2880_dvbt_t2_ops = { .info = { .name ="Sony CXD2880" , - .frequency_min =174000000 , - .frequency_max =862000000 , - .frequency_stepsize =1000 , + .frequency_min_hz =174 * MHz, + .frequency_max_hz =862 * MHz, + .frequency_stepsize_hz =1 * kHz, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 |
drivers/media/dvb-frontends/dib3000mb.c +3 -3
@@ -786,9 +786,9 @@ static const struct dvb_frontend_ops dib3000mb_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 3000M-B DVB-T", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/dib3000mc.c +3 -3
@@ -944,9 +944,9 @@ static const struct dvb_frontend_ops dib3000mc_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 3000MC/P", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/dib7000m.c +3 -3
@@ -1443,9 +1443,9 @@ static const struct dvb_frontend_ops dib7000m_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 7000MA/MB/PA/PB/MC", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/dib7000p.c +3 -3
@@ -2824,9 +2824,9 @@ static const struct dvb_frontend_ops dib7000p_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 7000PC", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/dib8000.c +3 -3
@@ -4390,9 +4390,9 @@ static const struct dvb_frontend_ops dib8000_ops = { .delsys = { SYS_ISDBT }, .info = { .name = "DiBcom 8000 ISDB-T", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/dib9000.c +3 -3
@@ -2553,9 +2553,9 @@ static const struct dvb_frontend_ops dib9000_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 9000", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/drx39xyj/drxj.c +3 -3
@@ -12374,9 +12374,9 @@ static const struct dvb_frontend_ops drx39xxj_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Micronas DRX39xxj family Frontend" , - .frequency_stepsize = 62500, - .frequency_min = 51000000, - .frequency_max = 858000000, + .frequency_min_hz = 51 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB },
drivers/media/dvb-frontends/drxd_hard.c +3 -4
@@ -2912,10 +2912,9 @@ static const struct dvb_frontend_ops drxd_ops = { .delsys = { SYS_DVBT}, .info = { .name = "Micronas DRXD DVB-T", - .frequency_min = 47125000, - .frequency_max = 855250000, - .frequency_stepsize = 166667, - .frequency_tolerance = 0, + .frequency_min_hz = 47125 * kHz, + .frequency_max_hz = 855250 * kHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/drxk_hard.c +4 -4
@@ -6744,13 +6744,13 @@ static const struct dvb_frontend_ops drxk_ops = {/* .delsys will be filled dynamically */ .info = { .name = "DRXK", - .frequency_min = 47000000, - .frequency_max = 865000000, + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 865 * MHz,/* For DVB-C */ - .symbol_rate_min = 870000, + .symbol_rate_min = 870000, .symbol_rate_max = 11700000,/* For DVB-T */ - .frequency_stepsize = 166667, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_QAM_16 |FE_CAN_QAM_32 |FE_CAN_QAM_64 | FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/ds3000.c +4 -4
@@ -1100,10 +1100,10 @@ static const struct dvb_frontend_ops ds3000_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="Montage Technology DS3000" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1011 * kHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/dvb_dummy_fe.c +12 -12
@@ -170,9 +170,9 @@ static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Dummy DVB-T", - .frequency_min = 0, - .frequency_max = 863250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 0, + .frequency_max_hz = 863250 * kHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_4_5 |FE_CAN_FEC_5_6 |FE_CAN_FEC_6_7 | FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
@@ -201,11 +201,11 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops = { .delsys = { SYS_DVBC_ANNEX_A }, .info = { .name = "Dummy DVB-C", - .frequency_stepsize = 62500, - .frequency_min = 51000000, - .frequency_max = 858000000, - .symbol_rate_min = (57840000/2)/64, /* SACLK/64 == (XIN/2)/64 */ - .symbol_rate_max = (57840000 /2 )/4 ,/* SACLK/4 */ + .frequency_min_hz = 51 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, + .symbol_rate_min = (57840000 / 2) / 64, /* SACLK/64 == (XIN/2)/64 */ + .symbol_rate_max = (57840000 /2 ) /4 ,/* SACLK/4 */ .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |FE_CAN_QAM_128 |FE_CAN_QAM_256 |FE_CAN_FEC_AUTO |FE_CAN_INVERSION_AUTO
@@ -230,10 +230,10 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Dummy DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 250, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 250 * kHz, + .frequency_tolerance_hz = 29500 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/gp8psk-fe.c +3 -3
@@ -355,9 +355,9 @@ static const struct dvb_frontend_ops gp8psk_fe_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Genpix DVB-S", - .frequency_min = 800000, - .frequency_max = 2250000, - .frequency_stepsize = 100, + .frequency_min_hz = 800 * MHz, + .frequency_max_hz = 2250 * MHz, + .frequency_stepsize_hz = 100 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */
drivers/media/dvb-frontends/ix2505v.c +2 -2
@@ -135,8 +135,8 @@ static int ix2505v_set_params(struct dvb_frontend *fe)u8 gain, cc, ref, psc, local_osc, lpf;u8 data[4 ] = {0 }; -if ((frequency < fe->ops.info.frequency_min) - || (frequency > fe->ops.info.frequency_max)) +if ((frequency < fe->ops.info.frequency_min_hz / kHz) + || (frequency > fe->ops.info.frequency_max_hz / kHz))return -EINVAL ;if (state->config->tuner_gain)
drivers/media/dvb-frontends/l64781.c +3 -4
@@ -575,10 +575,9 @@ static const struct dvb_frontend_ops l64781_ops = { .delsys = { SYS_DVBT }, .info = { .name = "LSI L64781 DVB-T", -/* .frequency_min = ???,*/ -/* .frequency_max = ???,*/ - .frequency_stepsize = 166666, -/* .frequency_tolerance = ???,*/ +/* .frequency_min_hz = ???,*/ +/* .frequency_max_hz = ???,*/ + .frequency_stepsize_hz = 166666,/* .symbol_rate_tolerance = ???,*/ .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 |
drivers/media/dvb-frontends/lg2160.c +6 -6
@@ -1349,9 +1349,9 @@ static const struct dvb_frontend_ops lg2160_ops = { .delsys = { SYS_ATSCMH }, .info = { .name = "LG Electronics LG2160 ATSC/MH Frontend", - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, }, .i2c_gate_ctrl = lg216x_i2c_gate_ctrl, #if 0
@@ -1375,9 +1375,9 @@ static const struct dvb_frontend_ops lg2161_ops = { .delsys = { SYS_ATSCMH }, .info = { .name = "LG Electronics LG2161 ATSC/MH Frontend", - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, }, .i2c_gate_ctrl = lg216x_i2c_gate_ctrl, #if 0
drivers/media/dvb-frontends/lgdt3305.c +6 -6
@@ -1164,9 +1164,9 @@ static const struct dvb_frontend_ops lgdt3304_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="LG Electronics LGDT3304 VSB/QAM Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB }, .i2c_gate_ctrl = lgdt3305_i2c_gate_ctrl,
@@ -1187,9 +1187,9 @@ static const struct dvb_frontend_ops lgdt3305_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="LG Electronics LGDT3305 VSB/QAM Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB }, .i2c_gate_ctrl = lgdt3305_i2c_gate_ctrl,
drivers/media/dvb-frontends/lgdt3306a.c +3 -3
@@ -2157,9 +2157,9 @@ static const struct dvb_frontend_ops lgdt3306a_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="LG Electronics LGDT3306A VSB/QAM Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_AUTO | FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB }, .i2c_gate_ctrl = lgdt3306a_i2c_gate_ctrl,
drivers/media/dvb-frontends/lgdt330x.c +6 -6
@@ -944,9 +944,9 @@ static const struct dvb_frontend_ops lgdt3302_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="LG Electronics LGDT3302 VSB/QAM Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 5056941, /* QAM 64 */ .symbol_rate_max = 10762000, /* VSB 8 */ .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
@@ -966,9 +966,9 @@ static const struct dvb_frontend_ops lgdt3303_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="LG Electronics LGDT3303 VSB/QAM Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 5056941, /* QAM 64 */ .symbol_rate_max = 10762000, /* VSB 8 */ .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
drivers/media/dvb-frontends/lgs8gl5.c +3 -4
@@ -416,10 +416,9 @@ static const struct dvb_frontend_ops lgs8gl5_ops = { .delsys = { SYS_DTMB }, .info = { .name = "Legend Silicon LGS-8GL5 DMB-TH", - .frequency_min = 474000000, - .frequency_max = 858000000, - .frequency_stepsize = 10000, - .frequency_tolerance = 0, + .frequency_min_hz = 474 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 10 * kHz, .caps =FE_CAN_FEC_AUTO |FE_CAN_QPSK |FE_CAN_QAM_16 |FE_CAN_QAM_32 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/lgs8gxx.c +3 -3
@@ -985,9 +985,9 @@ static const struct dvb_frontend_ops lgs8gxx_ops = { .delsys = { SYS_DTMB }, .info = { .name = "Legend Silicon LGS8913/LGS8GXX DMB-TH", - .frequency_min = 474000000, - .frequency_max = 858000000, - .frequency_stepsize = 10000, + .frequency_min_hz = 474 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 10 * kHz, .caps =FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/m88ds3103.c +3 -3
@@ -1300,9 +1300,9 @@ static const struct dvb_frontend_ops m88ds3103_ops = { .delsys = {SYS_DVBS, SYS_DVBS2}, .info = { .name ="Montage Technology M88DS3103" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/m88rs2000.c +4 -4
@@ -759,10 +759,10 @@ static const struct dvb_frontend_ops m88rs2000_ops = { .delsys = { SYS_DVBS }, .info = { .name = "M88RS2000 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1000, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1 * kHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */
drivers/media/dvb-frontends/mb86a16.c +3 -4
@@ -1808,10 +1808,9 @@ static const struct dvb_frontend_ops mb86a16_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Fujitsu MB86A16 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 3000, - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 3 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500,
drivers/media/dvb-frontends/mb86a20s.c +3 -3
@@ -2111,9 +2111,9 @@ static const struct dvb_frontend_ops mb86a20s_ops = {FE_CAN_TRANSMISSION_MODE_AUTO |FE_CAN_QAM_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO,/* Actually, those values depend on the used tuner */ - .frequency_min = 45000000, - .frequency_max = 864000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 45 * MHz, + .frequency_max_hz = 864 * MHz, + .frequency_stepsize_hz = 62500, }, .release = mb86a20s_release,
drivers/media/dvb-frontends/mt312.c +5 -5
@@ -559,8 +559,8 @@ static int mt312_set_frontend(struct dvb_frontend *fe)dprintk ("%s: Freq %d\n" , __func__, p->frequency); -if ((p->frequency < fe->ops.info.frequency_min) - || (p->frequency > fe->ops.info.frequency_max)) +if ((p->frequency < fe->ops.info.frequency_min_hz / kHz) + || (p->frequency > fe->ops.info.frequency_max_hz / kHz))return -EINVAL ; if (((int)p->inversion < INVERSION_OFF)
@@ -755,10 +755,10 @@ static const struct dvb_frontend_ops mt312_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Zarlink ???? DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz,/* FIXME: adjust freq to real used xtal */ - .frequency_stepsize = (MT312_PLL_CLK / 1000) / 128, + .frequency_stepsize_hz = MT312_PLL_CLK / 128, .symbol_rate_min = MT312_SYS_CLK / 128, /* FIXME as above */ .symbol_rate_max = MT312_SYS_CLK / 2, .caps =
drivers/media/dvb-frontends/mt352.c +3 -4
@@ -567,10 +567,9 @@ static const struct dvb_frontend_ops mt352_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Zarlink MT352 DVB-T", - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize = 166667, - .frequency_tolerance = 0, + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/mxl5xx.c +2 -4
@@ -784,10 +784,8 @@ static struct dvb_frontend_ops mxl_ops = { .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, .info = { .name ="MaxLinear MxL5xx DVB-S/S2 tuner-demodulator" , - .frequency_min = 300000, - .frequency_max = 2350000, - .frequency_stepsize = 0, - .frequency_tolerance = 0, + .frequency_min_hz = 300 * MHz, + .frequency_max_hz = 2350 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/nxt200x.c +3 -3
@@ -1212,9 +1212,9 @@ static const struct dvb_frontend_ops nxt200x_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Nextwave NXT200X VSB/QAM frontend" , - .frequency_min = 54000000, - .frequency_max = 860000000, - .frequency_stepsize = 166666, /* stepsize is just a guess */ + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 860 * MHz, + .frequency_stepsize_hz = 166666, /* stepsize is just a guess */ .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO |FE_CAN_8VSB |FE_CAN_QAM_64 |FE_CAN_QAM_256
drivers/media/dvb-frontends/nxt6000.c +3 -3
@@ -596,9 +596,9 @@ static const struct dvb_frontend_ops nxt6000_ops = { .delsys = { SYS_DVBT }, .info = { .name = "NxtWave NXT6000 DVB-T", - .frequency_min = 0, - .frequency_max = 863250000, - .frequency_stepsize = 62500, + .frequency_min_hz = 0, + .frequency_max_hz = 863250 * kHz, + .frequency_stepsize_hz = 62500,/*.frequency_tolerance = *//* FIXME: 12% of SR */ .symbol_rate_min = 0, /* FIXME */ .symbol_rate_max = 9360000, /* FIXME */
drivers/media/dvb-frontends/or51132.c +3 -3
@@ -583,9 +583,9 @@ static const struct dvb_frontend_ops or51132_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Oren OR51132 VSB/QAM Frontend" , - .frequency_min = 44000000, - .frequency_max = 958000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 44 * MHz, + .frequency_max_hz = 958 * MHz, + .frequency_stepsize_hz = 166666, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/or51211.c +4 -4
@@ -530,10 +530,10 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,static const struct dvb_frontend_ops or51211_ops = { .delsys = {SYS_ATSC ,SYS_DVBC_ANNEX_B }, .info = { - .name ="Oren OR51211 VSB Frontend" , - .frequency_min =44000000 , - .frequency_max =958000000 , - .frequency_stepsize =166666 , + .name ="Oren OR51211 VSB Frontend" , + .frequency_min_hz =44 * MHz, + .frequency_max_hz =958 * MHz, + .frequency_stepsize_hz =166666 , .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO |FE_CAN_8VSB
drivers/media/dvb-frontends/rtl2830.c +2 -2
@@ -159,8 +159,8 @@ static int rtl2830_get_tune_settings(struct dvb_frontend *fe, struct dvb_frontend_tune_settings *s) { s->min_delay_ms =500 ; - s->step_size = fe->ops.info.frequency_stepsize *2 ; - s->max_drift = (fe->ops.info.frequency_stepsize *2 ) +1 ; + s->step_size = fe->ops.info.frequency_stepsize_hz *2 ; + s->max_drift = (fe->ops.info.frequency_stepsize_hz *2 ) +1 ;return 0 ; }
drivers/media/dvb-frontends/rtl2832.c +5 -5
@@ -408,8 +408,8 @@ static int rtl2832_get_tune_settings(struct dvb_frontend *fe,dev_dbg (&client->dev,"\n" ); s->min_delay_ms =1000 ; - s->step_size = fe->ops.info.frequency_stepsize *2 ; - s->max_drift = (fe->ops.info.frequency_stepsize *2 ) +1 ; + s->step_size = fe->ops.info.frequency_stepsize_hz *2 ; + s->max_drift = (fe->ops.info.frequency_stepsize_hz *2 ) +1 ;return 0 ; }
@@ -841,9 +841,9 @@ static const struct dvb_frontend_ops rtl2832_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Realtek RTL2832 (DVB-T)", - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize = 166667, + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
drivers/media/dvb-frontends/s5h1409.c +3 -3
@@ -999,9 +999,9 @@ static const struct dvb_frontend_ops s5h1409_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Samsung S5H1409 QAM/8VSB Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB },
drivers/media/dvb-frontends/s5h1411.c +3 -3
@@ -918,9 +918,9 @@ static const struct dvb_frontend_ops s5h1411_ops = { .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B }, .info = { .name ="Samsung S5H1411 QAM/8VSB Frontend" , - .frequency_min = 54000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 54 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB },
drivers/media/dvb-frontends/s5h1420.c +4 -4
@@ -934,10 +934,10 @@ static const struct dvb_frontend_ops s5h1420_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Samsung S5H1420/PnpNetwork PN1010 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125 * kHz, + .frequency_tolerance_hz = 29500 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000,/* .symbol_rate_tolerance = ???,*/
drivers/media/dvb-frontends/s5h1432.c +3 -3
@@ -370,9 +370,9 @@ static const struct dvb_frontend_ops s5h1432_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Samsung s5h1432 DVB-T Frontend", - .frequency_min = 177000000, - .frequency_max = 858000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 177 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166666, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/s921.c +3 -4
@@ -510,15 +510,14 @@ static const struct dvb_frontend_ops s921_ops = {/* Use dib8000 values per default */ .info = { .name = "Sharp S921", - .frequency_min = 470000000, + .frequency_min_hz = 470 * MHz,/* * Max should be 770MHz instead, according with Sharp docs, * but Leadership doc says it works up to 806 MHz. This is * required to get channel 69, used in Brazil */ - .frequency_max = 806000000, - .frequency_tolerance = 0, - .caps =FE_CAN_INVERSION_AUTO | + .frequency_max_hz = 806 * MHz, + .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
drivers/media/dvb-frontends/si2165.c +1 -1
@@ -1120,7 +1120,7 @@ static const struct dvb_frontend_ops si2165_ops = { .symbol_rate_min = 1000000, .symbol_rate_max = 7200000,/* For DVB-T */ - .frequency_stepsize = 166667, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
drivers/media/dvb-frontends/si21xx.c +3 -4
@@ -870,10 +870,9 @@ static const struct dvb_frontend_ops si21xx_ops = { .delsys = { SYS_DVBS }, .info = { .name = "SL SI21XX DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, /* kHz for QPSK frontends */ - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */
drivers/media/dvb-frontends/sp8870.c +3 -3
@@ -584,9 +584,9 @@ static const struct dvb_frontend_ops sp8870_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Spase SP8870 DVB-T", - .frequency_min = 470000000, - .frequency_max = 860000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 470 * MHz, + .frequency_max_hz = 860 * MHz, + .frequency_stepsize_hz = 166666, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/sp887x.c +3 -3
@@ -594,9 +594,9 @@ static const struct dvb_frontend_ops sp887x_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Spase SP887x DVB-T", - .frequency_min = 50500000, - .frequency_max = 858000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 50500 * kHz, + .frequency_max_hz = 858000 * kHz, + .frequency_stepsize_hz = 166666, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
drivers/media/dvb-frontends/stb0899_drv.c +2 -4
@@ -1584,10 +1584,8 @@ static const struct dvb_frontend_ops stb0899_ops = { .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, .info = { .name ="STB0899 Multistandard" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 0, - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, .symbol_rate_min = 5000000, .symbol_rate_max = 45000000,
drivers/media/dvb-frontends/stv0288.c +3 -4
@@ -533,10 +533,9 @@ static const struct dvb_frontend_ops stv0288_ops = { .delsys = { SYS_DVBS }, .info = { .name = "ST STV0288 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1000, /* kHz for QPSK frontends */ - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */
drivers/media/dvb-frontends/stv0297.c +3 -3
@@ -694,9 +694,9 @@ static const struct dvb_frontend_ops stv0297_ops = { .delsys = { SYS_DVBC_ANNEX_A }, .info = { .name = "ST STV0297 DVB-C", - .frequency_min = 47000000, - .frequency_max = 862000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 470 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 870000, .symbol_rate_max = 11700000, .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |
drivers/media/dvb-frontends/stv0299.c +3 -4
@@ -717,10 +717,9 @@ static const struct dvb_frontend_ops stv0299_ops = { .delsys = { SYS_DVBS }, .info = { .name = "ST STV0299 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, /* kHz for QPSK frontends */ - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125, /* kHz for QPSK frontends */ .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */
drivers/media/dvb-frontends/stv0367.c +9 -11
@@ -1693,10 +1693,9 @@ static const struct dvb_frontend_ops stv0367ter_ops = { .delsys = { SYS_DVBT }, .info = { .name = "ST STV0367 DVB-T", - .frequency_min = 47000000, - .frequency_max = 862000000, - .frequency_stepsize = 15625, - .frequency_tolerance = 0, + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 15625, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
@@ -2867,9 +2866,9 @@ static const struct dvb_frontend_ops stv0367cab_ops = { .delsys = { SYS_DVBC_ANNEX_A }, .info = { .name = "ST STV0367 DVB-C", - .frequency_min = 47000000, - .frequency_max = 862000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 870000, .symbol_rate_max = 11700000, .caps = 0x400 |/* FE_CAN_QAM_4 */
@@ -3273,10 +3272,9 @@ static const struct dvb_frontend_ops stv0367ddb_ops = { .delsys = { SYS_DVBC_ANNEX_A, SYS_DVBT }, .info = { .name ="ST STV0367 DDB DVB-C/T" , - .frequency_min = 47000000, - .frequency_max = 865000000, - .frequency_stepsize = 166667, - .frequency_tolerance = 0, + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 865 * MHz, + .frequency_stepsize_hz = 166667, .symbol_rate_min = 870000, .symbol_rate_max = 11700000, .caps = /* DVB-C */
drivers/media/dvb-frontends/stv0900_core.c +3 -4
@@ -1875,10 +1875,9 @@ static const struct dvb_frontend_ops stv0900_ops = { .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, .info = { .name ="STV0900 frontend" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500,
drivers/media/dvb-frontends/stv090x.c +2 -4
@@ -4905,10 +4905,8 @@ static const struct dvb_frontend_ops stv090x_ops = { .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, .info = { .name ="STV090x Multistandard" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 0, - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/stv0910.c +2 -4
@@ -1724,10 +1724,8 @@ static const struct dvb_frontend_ops stv0910_ops = { .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, .info = { .name ="ST STV0910" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 0, - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, .symbol_rate_min = 100000, .symbol_rate_max = 70000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/tc90522.c +5 -5
@@ -714,8 +714,8 @@ static const struct dvb_frontend_ops tc90522_ops_sat = { .delsys = { SYS_ISDBS }, .info = { .name = "Toshiba TC90522 ISDB-S module", - .frequency_min = 950000, - .frequency_max = 2150000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_AUTO |FE_CAN_QAM_AUTO |FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO,
@@ -734,9 +734,9 @@ static const struct dvb_frontend_ops tc90522_ops_ter = { .delsys = { SYS_ISDBT }, .info = { .name = "Toshiba TC90522 ISDB-T module", - .frequency_min = 470000000, - .frequency_max = 770000000, - .frequency_stepsize = 142857, + .frequency_min_hz = 470 * MHz, + .frequency_max_hz = 770 * MHz, + .frequency_stepsize_hz = 142857, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/tda10021.c +5 -5
@@ -487,11 +487,11 @@ static const struct dvb_frontend_ops tda10021_ops = { .delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C }, .info = { .name ="Philips TDA10021 DVB-C" , - .frequency_stepsize = 62500, - .frequency_min = 47000000, - .frequency_max = 862000000, - .symbol_rate_min = (XIN/2)/64, /* SACLK/64 == (XIN/2)/64 */ - .symbol_rate_max = (XIN/2)/4, /* SACLK/4 */ + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 62500, + .symbol_rate_min = (XIN / 2) / 64, /* SACLK/64 == (XIN/2)/64 */ + .symbol_rate_max = (XIN / 2) / 4, /* SACLK/4 */ #if 0 .frequency_tolerance = ???, .symbol_rate_tolerance = ???, /* ppm */ /* == 8% (spec p. 5) */
drivers/media/dvb-frontends/tda10023.c +3 -3
@@ -575,9 +575,9 @@ static const struct dvb_frontend_ops tda10023_ops = { .delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C }, .info = { .name ="Philips TDA10023 DVB-C" , - .frequency_stepsize = 62500, - .frequency_min = 47000000, - .frequency_max = 862000000, + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 0, /* set in tda10023_attach */ .symbol_rate_max = 0, /* set in tda10023_attach */ .caps = 0x400 | //FE_CAN_QAM_4
drivers/media/dvb-frontends/tda10048.c +3 -3
@@ -1156,9 +1156,9 @@ static const struct dvb_frontend_ops tda10048_ops = { .delsys = { SYS_DVBT }, .info = { .name = "NXP TDA10048HN DVB-T", - .frequency_min = 177000000, - .frequency_max = 858000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 177 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166666, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
drivers/media/dvb-frontends/tda1004x.c +6 -6
@@ -1249,9 +1249,9 @@ static const struct dvb_frontend_ops tda10045_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Philips TDA10045H DVB-T", - .frequency_min = 51000000, - .frequency_max = 858000000, - .frequency_stepsize = 166667, + .frequency_min_hz = 51 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
@@ -1319,9 +1319,9 @@ static const struct dvb_frontend_ops tda10046_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Philips TDA10046H DVB-T", - .frequency_min = 51000000, - .frequency_max = 858000000, - .frequency_stepsize = 166667, + .frequency_min_hz = 51 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/dvb-frontends/tda10071.c +5 -5
@@ -681,8 +681,8 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) cmd.args[5 ] = (c->frequency >>0 ) &0xff ; cmd.args[6 ] = ((c->symbol_rate /1000 ) >>8 ) &0xff ; cmd.args[7 ] = ((c->symbol_rate /1000 ) >>0 ) &0xff ; - cmd.args[8 ] = (tda10071_ops.info.frequency_tolerance >>8 ) &0xff ; - cmd.args[9 ] = (tda10071_ops.info.frequency_tolerance >>0 ) &0xff ; + cmd.args[8 ] = (tda10071_ops.info.frequency_tolerance_hz >>8 ) &0xff ; + cmd.args[9 ] = (tda10071_ops.info.frequency_tolerance_hz >>0 ) &0xff ; cmd.args[10 ] = rolloff; cmd.args[11 ] = inversion; cmd.args[12 ] = pilot;
@@ -1106,9 +1106,9 @@ static const struct dvb_frontend_ops tda10071_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="NXP TDA10071" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_tolerance = 5000, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_tolerance_hz = 5 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/tda10086.c +3 -3
@@ -710,9 +710,9 @@ static const struct dvb_frontend_ops tda10086_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Philips TDA10086 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, /* kHz for QPSK frontends */ + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/dvb-frontends/tda8083.c +3 -4
@@ -453,10 +453,9 @@ static const struct dvb_frontend_ops tda8083_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Philips TDA8083 DVB-S", - .frequency_min = 920000, /* TDA8060 */ - .frequency_max = 2200000, /* TDA8060 */ - .frequency_stepsize = 125, /* kHz for QPSK frontends */ -/* .frequency_tolerance = ???,*/ + .frequency_min_hz = 920 * MHz, /* TDA8060 */ + .frequency_max_hz = 2200 * MHz, /* TDA8060 */ + .frequency_stepsize_hz = 125 * kHz, .symbol_rate_min = 12000000, .symbol_rate_max = 30000000,/* .symbol_rate_tolerance = ???,*/
drivers/media/dvb-frontends/ves1820.c +3 -3
@@ -412,9 +412,9 @@ static const struct dvb_frontend_ops ves1820_ops = { .delsys = { SYS_DVBC_ANNEX_A }, .info = { .name = "VLSI VES1820 DVB-C", - .frequency_stepsize = 62500, - .frequency_min = 47000000, - .frequency_max = 862000000, + .frequency_min_hz = 47 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_QAM_16 |FE_CAN_QAM_32 | FE_CAN_QAM_64 |
drivers/media/dvb-frontends/ves1x93.c +4 -4
@@ -516,10 +516,10 @@ static const struct dvb_frontend_ops ves1x93_ops = { .delsys = { SYS_DVBS }, .info = { .name = "VLSI VES1x93 DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125 * kHz, + .frequency_tolerance_hz = 29500 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000,/* .symbol_rate_tolerance = ???,*/
drivers/media/dvb-frontends/zl10036.c +2 -2
@@ -311,8 +311,8 @@ static int zl10036_set_params(struct dvb_frontend *fe)/* ensure correct values * maybe redundant as core already checks this */ -if ((frequency < fe->ops.info.frequency_min) - || (frequency > fe->ops.info.frequency_max)) +if ((frequency < fe->ops.info.frequency_min_hz / kHz) + || (frequency > fe->ops.info.frequency_max_hz / kHz))return -EINVAL ;/*
drivers/media/dvb-frontends/zl10353.c +3 -4
@@ -635,10 +635,9 @@ static const struct dvb_frontend_ops zl10353_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Zarlink ZL10353 DVB-T", - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize = 166667, - .frequency_tolerance = 0, + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/firewire/firedtv-fe.c +13 -13
@@ -152,7 +152,7 @@ static int fdtv_set_frontend(struct dvb_frontend *fe)void fdtv_frontend_init (struct firedtv *fdtv,const char *name) {struct dvb_frontend_ops *ops = &fdtv->fe.ops; -struct dvb_frontend_info *fi = &ops->info; +struct dvb_frontend_internal_info *fi = &ops->info; ops->init = fdtv_dvb_init; ops->sleep = fdtv_sleep;
@@ -174,9 +174,9 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)case FIREDTV_DVB_S : ops->delsys[0 ] =SYS_DVBS ; - fi->frequency_min =950000 ; - fi->frequency_max =2150000 ; - fi->frequency_stepsize =125 ; + fi->frequency_min_hz =950 * MHz; + fi->frequency_max_hz =2150 * MHz; + fi->frequency_stepsize_hz =125 * kHz; fi->symbol_rate_min =1000000 ; fi->symbol_rate_max =40000000 ;
@@ -194,9 +194,9 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) ops->delsys[0 ] =SYS_DVBS ; ops->delsys[1 ] =SYS_DVBS2 ; - fi->frequency_min =950000 ; - fi->frequency_max =2150000 ; - fi->frequency_stepsize =125 ; + fi->frequency_min_hz =950 * MHz; + fi->frequency_max_hz =2150 * MHz; + fi->frequency_stepsize_hz =125 * kHz; fi->symbol_rate_min =1000000 ; fi->symbol_rate_max =40000000 ;
@@ -214,9 +214,9 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)case FIREDTV_DVB_C : ops->delsys[0 ] =SYS_DVBC_ANNEX_A ; - fi->frequency_min =47000000 ; - fi->frequency_max =866000000 ; - fi->frequency_stepsize =62500 ; + fi->frequency_min_hz =47 * MHz; + fi->frequency_max_hz =866 * MHz; + fi->frequency_stepsize_hz =62500 ; fi->symbol_rate_min =870000 ; fi->symbol_rate_max =6900000 ;
@@ -232,9 +232,9 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)case FIREDTV_DVB_T : ops->delsys[0 ] =SYS_DVBT ; - fi->frequency_min =49000000 ; - fi->frequency_max =861000000 ; - fi->frequency_stepsize =62500 ; + fi->frequency_min_hz =49 * MHz; + fi->frequency_max_hz =861 * MHz; + fi->frequency_stepsize_hz =62500 ; fi->caps =FE_CAN_INVERSION_AUTO | FE_CAN_FEC_2_3 |
drivers/media/pci/bt8xx/dst.c +13 -13
@@ -1739,9 +1739,9 @@ static const struct dvb_frontend_ops dst_dvbt_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DST DVB-T", - .frequency_min = 137000000, - .frequency_max = 858000000, - .frequency_stepsize = 166667, + .frequency_min_hz = 137 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166667, .caps =FE_CAN_FEC_AUTO |FE_CAN_QAM_AUTO | FE_CAN_QAM_16 |
@@ -1768,10 +1768,10 @@ static const struct dvb_frontend_ops dst_dvbs_ops = { .delsys = { SYS_DVBS }, .info = { .name = "DST DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1000, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1 * MHz, + .frequency_tolerance_hz = 29500 * kHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000,/* . symbol_rate_tolerance = ???,*/
@@ -1797,9 +1797,9 @@ static const struct dvb_frontend_ops dst_dvbc_ops = { .delsys = { SYS_DVBC_ANNEX_A }, .info = { .name = "DST DVB-C", - .frequency_stepsize = 62500, - .frequency_min = 51000000, - .frequency_max = 858000000, + .frequency_min_hz = 51 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_FEC_AUTO |
@@ -1826,9 +1826,9 @@ static const struct dvb_frontend_ops dst_atsc_ops = { .delsys = { SYS_ATSC }, .info = { .name = "DST ATSC", - .frequency_stepsize = 62500, - .frequency_min = 510000000, - .frequency_max = 858000000, + .frequency_min_hz = 510 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .symbol_rate_min = 1000000, .symbol_rate_max =45000000 , .caps = FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO | FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
drivers/media/pci/bt8xx/dvb-bt8xx.c +4 -4
@@ -606,8 +606,8 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)if (card->fe !=NULL ) { card->fe->ops.tuner_ops.calc_regs = thomson_dtt7579_tuner_calc_regs; - card->fe->ops.info.frequency_min =174000000 ; - card->fe->ops.info.frequency_max =862000000 ; + card->fe->ops.info.frequency_min_hz =174 * MHz; + card->fe->ops.info.frequency_max_hz =862 * MHz; }break ;
@@ -659,8 +659,8 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) card->fe =dvb_attach (mt352_attach, &advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter);if (card->fe !=NULL ) { card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; - card->fe->ops.info.frequency_min =174000000 ; - card->fe->ops.info.frequency_max =862000000 ; + card->fe->ops.info.frequency_min_hz =174 * MHz; + card->fe->ops.info.frequency_max_hz =862 * MHz; }break ;
drivers/media/pci/ddbridge/ddbridge-mci.c +2 -4
@@ -463,10 +463,8 @@ static struct dvb_frontend_ops mci_ops = { .delsys = { SYS_DVBS, SYS_DVBS2 }, .info = { .name ="Digital Devices MaxSX8 MCI DVB-S/S2/S2X" , - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 0, - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, .symbol_rate_min = 100000, .symbol_rate_max = 100000000, .caps = FE_CAN_INVERSION_AUTO |
drivers/media/pci/mantis/mantis_vp3030.c +2 -2
@@ -42,8 +42,8 @@ static struct zl10353_config mantis_vp3030_config = {static struct tda665x_config env57h12d5_config = { .name ="ENV57H12D5 (ET-50DT)" , .addr =0x60 , - .frequency_min =47000000 , - .frequency_max =862000000 , + .frequency_min =47 * MHz, + .frequency_max =862 * MHz, .frequency_offst =3616667 , .ref_multiplier =6 ,/* 1/6 MHz */ .ref_divider =100000 ,/* 1/6 MHz */
drivers/media/tuners/mxl5007t.c +0 -2
@@ -59,8 +59,6 @@ MODULE_PARM_DESC(debug, "set debug level");/* ------------------------------------------------------------------------- */ -#define MHz 1000000 -enum mxl5007t_mode { MxL_MODE_ISDBT =0 , MxL_MODE_DVBT =1 ,
drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c +3 -3
@@ -554,9 +554,9 @@ static const struct dvb_frontend_ops mxl111sf_demod_ops = { .delsys = { SYS_DVBT }, .info = { .name = "MaxLinear MxL111SF DVB-T demodulator", - .frequency_min = 177000000, - .frequency_max = 858000000, - .frequency_stepsize = 166666, + .frequency_min_hz = 177 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 166666, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
drivers/media/usb/dvb-usb/af9005-fe.c +3 -3
@@ -1455,9 +1455,9 @@ static const struct dvb_frontend_ops af9005_fe_ops = { .delsys = { SYS_DVBT }, .info = { .name = "AF9005 USB DVB-T", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 250000, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 250 * kHz, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/usb/dvb-usb/cinergyT2-fe.c +3 -3
@@ -295,9 +295,9 @@ static const struct dvb_frontend_ops cinergyt2_fe_ops = { .delsys = { SYS_DVBT }, .info = { .name = DRIVER_NAME, - .frequency_min = 174000000, - .frequency_max = 862000000, - .frequency_stepsize =166667 , + .frequency_min_hz = 174 * MHz, + .frequency_max_hz = 862 * MHz, + .frequency_stepsize_hz =166667 , .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8
drivers/media/usb/dvb-usb/dtt200u-fe.c +3 -3
@@ -230,9 +230,9 @@ static const struct dvb_frontend_ops dtt200u_fe_ops = { .delsys = { SYS_DVBT }, .info = { .name = "WideView USB DVB-T", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 250000, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 250 * kHz, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/usb/dvb-usb/friio-fe.c +5 -6
@@ -133,10 +133,10 @@ static int jdvbt90502_pll_set_freq(struct jdvbt90502_state *state, u32 freq)u32 f;deb_fe ("%s: freq=%d, step=%d\n" , __func__, freq, - state->frontend.ops.info.frequency_stepsize); + state->frontend.ops.info.frequency_stepsize_hz);/* freq -> oscilator frequency conversion. */ /* freq: 473,000,000 + n*6,000,000 [+ 142857 (center freq. shift)] */ - f = freq / state->frontend.ops.info.frequency_stepsize; + f = freq / state->frontend.ops.info.frequency_stepsize_hz;/* add 399[1/7 MHZ] = 57MHz for the IF */ f +=399 ;/* add center frequency shift if necessary */
@@ -413,10 +413,9 @@ static const struct dvb_frontend_ops jdvbt90502_ops = { .delsys = { SYS_ISDBT }, .info = { .name = "Comtech JDVBT90502 ISDB-T", - .frequency_min = 473000000, /* UHF 13ch, center */ - .frequency_max = 767142857, /* UHF 62ch, center */ - .frequency_stepsize = JDVBT90502_PLL_CLK / JDVBT90502_PLL_DIVIDER, - .frequency_tolerance = 0, + .frequency_min_hz = 473000000, /* UHF 13ch, center */ + .frequency_max_hz = 767142857, /* UHF 62ch, center */ + .frequency_stepsize_hz = JDVBT90502_PLL_CLK / JDVBT90502_PLL_DIVIDER,/* NOTE: this driver ignores all parameters but frequency. */ .caps = FE_CAN_INVERSION_AUTO |
drivers/media/usb/dvb-usb/vp702x-fe.c +3 -4
@@ -349,10 +349,9 @@ static const struct dvb_frontend_ops vp702x_fe_ops = { .delsys = { SYS_DVBS }, .info = { .name = "Twinhan DST-like frontend (VP7021/VP7020) DVB-S", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 1000, /* kHz for QPSK frontends */ - .frequency_tolerance = 0, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 1 * MHz, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */
drivers/media/usb/dvb-usb/vp7045-fe.c +3 -3
@@ -162,9 +162,9 @@ static const struct dvb_frontend_ops vp7045_fe_ops = { .delsys = { SYS_DVBT }, .info = { .name = "Twinhan VP7045/46 USB DVB-T", - .frequency_min = 44250000, - .frequency_max = 867250000, - .frequency_stepsize = 1000, + .frequency_min_hz = 44250 * kHz, + .frequency_max_hz = 867250 * kHz, + .frequency_stepsize_hz = 1 * kHz, .caps =FE_CAN_INVERSION_AUTO |FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
drivers/media/usb/ttusb-dec/ttusbdecfe.c +6 -6
@@ -247,9 +247,9 @@ static const struct dvb_frontend_ops ttusbdecfe_dvbt_ops = { .delsys = { SYS_DVBT }, .info = { .name = "TechnoTrend/Hauppauge DEC2000-t Frontend", - .frequency_min = 51000000, - .frequency_max = 858000000, - .frequency_stepsize = 62500, + .frequency_min_hz = 51 * MHz, + .frequency_max_hz = 858 * MHz, + .frequency_stepsize_hz = 62500, .caps =FE_CAN_FEC_1_2 |FE_CAN_FEC_2_3 |FE_CAN_FEC_3_4 |FE_CAN_FEC_5_6 |FE_CAN_FEC_7_8 |FE_CAN_FEC_AUTO | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
@@ -270,9 +270,9 @@ static const struct dvb_frontend_ops ttusbdecfe_dvbs_ops = { .delsys = { SYS_DVBS }, .info = { .name = "TechnoTrend/Hauppauge DEC3000-s Frontend", - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 125, + .frequency_min_hz = 950 * MHz, + .frequency_max_hz = 2150 * MHz, + .frequency_stepsize_hz = 125 * kHz, .symbol_rate_min = 1000000, /* guessed */ .symbol_rate_max = 45000000, /* guessed */ .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
include/media/dvb_frontend.h +29 -1
@@ -317,6 +317,34 @@ struct analog_demod_ops {struct dtv_frontend_properties ; +/** +* struct dvb_frontend_internal_info - Frontend properties and capabilities +* +* @name: Name of the frontend +* @frequency_min_hz: Minimal frequency supported by the frontend. +* @frequency_max_hz: Minimal frequency supported by the frontend. +* @frequency_stepsize_hz: All frequencies are multiple of this value. +* @frequency_tolerance_hz: Frequency tolerance. +* @symbol_rate_min: Minimal symbol rate, in bauds +* (for Cable/Satellite systems). +* @symbol_rate_max: Maximal symbol rate, in bauds +* (for Cable/Satellite systems). +* @symbol_rate_tolerance: Maximal symbol rate tolerance, in ppm +* (for Cable/Satellite systems). +* @caps: Capabilities supported by the frontend, +* as specified in &enum fe_caps. +*/ +struct dvb_frontend_internal_info { +char name[128 ]; +u32 frequency_min_hz; +u32 frequency_max_hz; +u32 frequency_stepsize_hz; +u32 frequency_tolerance_hz; +u32 symbol_rate_min; +u32 symbol_rate_max; +u32 symbol_rate_tolerance; +enum fe_caps caps; +};/** * struct dvb_frontend_ops - Demodulation information and callbacks for
@@ -404,7 +432,7 @@ struct dtv_frontend_properties;* @analog_ops: pointer to &struct analog_demod_ops */ struct dvb_frontend_ops { -struct dvb_frontend_info info; +struct dvb_frontend_internal_info info;u8 delsys[MAX_DELSYS ];
Signature · 1 line
2.17.1
kbuild test robot
build botRe: [PATCH 2/2] media: dvb: represent min/max/step/tolerance freqs in Hz
I love your patch! Perhaps something to improve:
Hi Mauro,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.18-rc3 next-20180704]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/DVB-represent-frequencies-at-tuner-frontend-info-in-Hz/20180705-105703 base: git://linuxtv.org/media_tree.git master config: x86_64-randconfig-x004-201826 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All warnings (new ones prefixed by >>):
drivers/media/dvb-core/dvb_frontend.c: In function 'dvb_frontend_handle_ioctl':
>> drivers/media/dvb-core/dvb_frontend.c:2396:25: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
memset(info, 0, sizeof(info));
^vim +2396 drivers/media/dvb-core/dvb_frontend.c
2295
2296 static int dvb_frontend_handle_ioctl(struct file *file,
2297 unsigned int cmd, void *parg)
2298 {
2299 struct dvb_device *dvbdev = file->private_data;
2300 struct dvb_frontend *fe = dvbdev->priv;
2301 struct dvb_frontend_private *fepriv = fe->frontend_priv;
2302 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
2303 int i, err = -ENOTSUPP;
2304
2305 dev_dbg(fe->dvb->device, "%s:\n", __func__);
2306
2307 switch (cmd) {
2308 case FE_SET_PROPERTY: {
2309 struct dtv_properties *tvps = parg;
2310 struct dtv_property *tvp = NULL;
2311
2312 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n",
2313 __func__, tvps->num);
2314 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n",
2315 __func__, tvps->props);
2316
2317 /*
2318 * Put an arbitrary limit on the number of messages that can
2319 * be sent at once
2320 */
2321 if (!tvps->num || (tvps->num > DTV_IOCTL_MAX_MSGS))
2322 return -EINVAL;
2323
2324 tvp = memdup_user((void __user *)tvps->props, tvps->num * sizeof(*tvp));
2325 if (IS_ERR(tvp))
2326 return PTR_ERR(tvp);
2327
2328 for (i = 0; i < tvps->num; i++) {
2329 err = dtv_property_process_set(fe, file,
2330 (tvp + i)->cmd,
2331 (tvp + i)->u.data);
2332 if (err < 0) {
2333 kfree(tvp);
2334 return err;
2335 }
2336 }
2337 kfree(tvp);
2338 err = 0;
2339 break;
2340 }
2341 case FE_GET_PROPERTY: {
2342 struct dtv_properties *tvps = parg;
2343 struct dtv_property *tvp = NULL;
2344 struct dtv_frontend_properties getp = fe->dtv_property_cache;
2345
2346 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n",
2347 __func__, tvps->num);
2348 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n",
2349 __func__, tvps->props);
2350
2351 /*
2352 * Put an arbitrary limit on the number of messages that can
2353 * be sent at once
2354 */
2355 if (!tvps->num || (tvps->num > DTV_IOCTL_MAX_MSGS))
2356 return -EINVAL;
2357
2358 tvp = memdup_user((void __user *)tvps->props, tvps->num * sizeof(*tvp));
2359 if (IS_ERR(tvp))
2360 return PTR_ERR(tvp);
2361
2362 /*
2363 * Let's use our own copy of property cache, in order to
2364 * avoid mangling with DTV zigzag logic, as drivers might
2365 * return crap, if they don't check if the data is available
2366 * before updating the properties cache.
2367 */
2368 if (fepriv->state != FESTATE_IDLE) {
2369 err = dtv_get_frontend(fe, &getp, NULL);
2370 if (err < 0) {
2371 kfree(tvp);
2372 return err;
2373 }
2374 }
2375 for (i = 0; i < tvps->num; i++) {
2376 err = dtv_property_process_get(fe, &getp,
2377 tvp + i, file);
2378 if (err < 0) {
2379 kfree(tvp);
2380 return err;
2381 }
2382 }
2383
2384 if (copy_to_user((void __user *)tvps->props, tvp,
2385 tvps->num * sizeof(struct dtv_property))) {
2386 kfree(tvp);
2387 return -EFAULT;
2388 }
2389 kfree(tvp);
2390 err = 0;
2391 break;
2392 }
2393
2394 case FE_GET_INFO: {
2395 struct dvb_frontend_info *info = parg;
> 2396 memset(info, 0, sizeof(info));
2397
2398 dvb_frontend_get_frequency_limits(fe, &info->frequency_min, &info->frequency_max);
2399 strcpy(info->name, fe->ops.info.name);
2400 info->frequency_stepsize = fe->ops.info.frequency_stepsize_hz;
2401 info->frequency_tolerance = fe->ops.info.frequency_tolerance_hz;
2402 info->symbol_rate_min = fe->ops.info.symbol_rate_min;
2403 info->symbol_rate_max = fe->ops.info.symbol_rate_max;
2404 info->symbol_rate_tolerance = fe->ops.info.symbol_rate_tolerance;
2405 info->caps = fe->ops.info.caps;
2406
2407 /* If the standard is for satellite, convert frequencies to kHz */
2408 switch (c->delivery_system) {
2409 case SYS_DVBS:
2410 case SYS_DVBS2:
2411 case SYS_TURBO:
2412 case SYS_ISDBS:
2413 info->frequency_stepsize = fe->ops.info.frequency_stepsize_hz / kHz;
2414 info->frequency_tolerance = fe->ops.info.frequency_tolerance_hz / kHz;
2415 break;
2416 default:
2417 info->frequency_stepsize = fe->ops.info.frequency_stepsize_hz;
2418 info->frequency_tolerance = fe->ops.info.frequency_tolerance_hz;
2419 break;
2420 }
2421
2422 /*
2423 * Associate the 4 delivery systems supported by DVBv3
2424 * API with their DVBv5 counterpart. For the other standards,
2425 * use the closest type, assuming that it would hopefully
2426 * work with a DVBv3 application.
2427 * It should be noticed that, on multi-frontend devices with
2428 * different types (terrestrial and cable, for example),
2429 * a pure DVBv3 application won't be able to use all delivery
2430 * systems. Yet, changing the DVBv5 cache to the other delivery
2431 * system should be enough for making it work.
2432 */
2433 switch (dvbv3_type(c->delivery_system)) {
2434 case DVBV3_QPSK:
2435 info->type = FE_QPSK;
2436 break;
2437 case DVBV3_ATSC:
2438 info->type = FE_ATSC;
2439 break;
2440 case DVBV3_QAM:
2441 info->type = FE_QAM;
2442 break;
2443 case DVBV3_OFDM:
2444 info->type = FE_OFDM;
2445 break;
2446 default:
2447 dev_err(fe->dvb->device,
2448 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
2449 __func__, c->delivery_system);
2450 info->type = FE_OFDM;
2451 }
2452 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
2453 __func__, c->delivery_system, info->type);
2454
2455 /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */
2456 if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT))
2457 info->caps |= FE_CAN_INVERSION_AUTO;
2458 err = 0;
2459 break;
2460 }
2461
2462 case FE_READ_STATUS: {
2463 enum fe_status *status = parg;
2464
2465 /* if retune was requested but hasn't occurred yet, prevent
2466 * that user get signal state from previous tuning */
2467 if (fepriv->state == FESTATE_RETUNE ||
2468 fepriv->state == FESTATE_ERROR) {
2469 err = 0;
2470 *status = 0;
2471 break;
2472 }
2473
2474 if (fe->ops.read_status)
2475 err = fe->ops.read_status(fe, status);
2476 break;
2477 }
2478
2479 case FE_DISEQC_RESET_OVERLOAD:
2480 if (fe->ops.diseqc_reset_overload) {
2481 err = fe->ops.diseqc_reset_overload(fe);
2482 fepriv->state = FESTATE_DISEQC;
2483 fepriv->status = 0;
2484 }
2485 break;
2486
2487 case FE_DISEQC_SEND_MASTER_CMD:
2488 if (fe->ops.diseqc_send_master_cmd) {
2489 struct dvb_diseqc_master_cmd *cmd = parg;
2490
2491 if (cmd->msg_len > sizeof(cmd->msg)) {
2492 err = -EINVAL;
2493 break;
2494 }
2495 err = fe->ops.diseqc_send_master_cmd(fe, cmd);
2496 fepriv->state = FESTATE_DISEQC;
2497 fepriv->status = 0;
2498 }
2499 break;
2500
2501 case FE_DISEQC_SEND_BURST:
2502 if (fe->ops.diseqc_send_burst) {
2503 err = fe->ops.diseqc_send_burst(fe,
2504 (enum fe_sec_mini_cmd)parg);
2505 fepriv->state = FESTATE_DISEQC;
2506 fepriv->status = 0;
2507 }
2508 break;
2509
2510 case FE_SET_TONE:
2511 if (fe->ops.set_tone) {
2512 err = fe->ops.set_tone(fe,
2513 (enum fe_sec_tone_mode)parg);
2514 fepriv->tone = (enum fe_sec_tone_mode)parg;
2515 fepriv->state = FESTATE_DISEQC;
2516 fepriv->status = 0;
2517 }
2518 break;
2519
2520 case FE_SET_VOLTAGE:
2521 if (fe->ops.set_voltage) {
2522 err = fe->ops.set_voltage(fe,
2523 (enum fe_sec_voltage)parg);
2524 fepriv->voltage = (enum fe_sec_voltage)parg;
2525 fepriv->state = FESTATE_DISEQC;
2526 fepriv->status = 0;
2527 }
2528 break;
2529
2530 case FE_DISEQC_RECV_SLAVE_REPLY:
2531 if (fe->ops.diseqc_recv_slave_reply)
2532 err = fe->ops.diseqc_recv_slave_reply(fe, parg);
2533 break;
2534
2535 case FE_ENABLE_HIGH_LNB_VOLTAGE:
2536 if (fe->ops.enable_high_lnb_voltage)
2537 err = fe->ops.enable_high_lnb_voltage(fe, (long)parg);
2538 break;
2539
2540 case FE_SET_FRONTEND_TUNE_MODE:
2541 fepriv->tune_mode_flags = (unsigned long)parg;
2542 err = 0;
2543 break;
2544
2545 /* DEPRECATED dish control ioctls */
2546
2547 case FE_DISHNETWORK_SEND_LEGACY_CMD:
2548 if (fe->ops.dishnetwork_send_legacy_command) {
2549 err = fe->ops.dishnetwork_send_legacy_command(fe,
2550 (unsigned long)parg);
2551 fepriv->state = FESTATE_DISEQC;
2552 fepriv->status = 0;
2553 } else if (fe->ops.set_voltage) {
2554 /*
2555 * NOTE: This is a fallback condition. Some frontends
2556 * (stv0299 for instance) take longer than 8msec to
2557 * respond to a set_voltage command. Those switches
2558 * need custom routines to switch properly. For all
2559 * other frontends, the following should work ok.
2560 * Dish network legacy switches (as used by Dish500)
2561 * are controlled by sending 9-bit command words
2562 * spaced 8msec apart.
2563 * the actual command word is switch/port dependent
2564 * so it is up to the userspace application to send
2565 * the right command.
2566 * The command must always start with a '0' after
2567 * initialization, so parg is 8 bits and does not
2568 * include the initialization or start bit
2569 */
2570 unsigned long swcmd = ((unsigned long)parg) << 1;
2571 ktime_t nexttime;
2572 ktime_t tv[10];
2573 int i;
2574 u8 last = 1;
2575
2576 if (dvb_frontend_debug)
2577 dprintk("%s switch command: 0x%04lx\n",
2578 __func__, swcmd);
2579 nexttime = ktime_get_boottime();
2580 if (dvb_frontend_debug)
2581 tv[0] = nexttime;
2582 /* before sending a command, initialize by sending
2583 * a 32ms 18V to the switch
2584 */
2585 fe->ops.set_voltage(fe, SEC_VOLTAGE_18);
2586 dvb_frontend_sleep_until(&nexttime, 32000);
2587
2588 for (i = 0; i < 9; i++) {
2589 if (dvb_frontend_debug)
2590 tv[i + 1] = ktime_get_boottime();
2591 if ((swcmd & 0x01) != last) {
2592 /* set voltage to (last ? 13V : 18V) */
2593 fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18);
2594 last = (last) ? 0 : 1;
2595 }
2596 swcmd = swcmd >> 1;
2597 if (i != 8)
2598 dvb_frontend_sleep_until(&nexttime, 8000);
2599 }
2600 if (dvb_frontend_debug) {
2601 dprintk("%s(%d): switch delay (should be 32k followed by all 8k)\n",
2602 __func__, fe->dvb->num);
2603 for (i = 1; i < 10; i++)
2604 pr_info("%d: %d\n", i,
2605 (int)ktime_us_delta(tv[i], tv[i - 1]));
2606 }
2607 err = 0;
2608 fepriv->state = FESTATE_DISEQC;
2609 fepriv->status = 0;
2610 }
2611 break;
2612
2613 /* DEPRECATED statistics ioctls */
2614
2615 case FE_READ_BER:
2616 if (fe->ops.read_ber) {
2617 if (fepriv->thread)
2618 err = fe->ops.read_ber(fe, parg);
2619 else
2620 err = -EAGAIN;
2621 }
2622 break;
2623
2624 case FE_READ_SIGNAL_STRENGTH:
2625 if (fe->ops.read_signal_strength) {
2626 if (fepriv->thread)
2627 err = fe->ops.read_signal_strength(fe, parg);
2628 else
2629 err = -EAGAIN;
2630 }
2631 break;
2632
2633 case FE_READ_SNR:
2634 if (fe->ops.read_snr) {
2635 if (fepriv->thread)
2636 err = fe->ops.read_snr(fe, parg);
2637 else
2638 err = -EAGAIN;
2639 }
2640 break;
2641
2642 case FE_READ_UNCORRECTED_BLOCKS:
2643 if (fe->ops.read_ucblocks) {
2644 if (fepriv->thread)
2645 err = fe->ops.read_ucblocks(fe, parg);
2646 else
2647 err = -EAGAIN;
2648 }
2649 break;
2650
2651 /* DEPRECATED DVBv3 ioctls */
2652
2653 case FE_SET_FRONTEND:
2654 err = dvbv3_set_delivery_system(fe);
2655 if (err)
2656 break;
2657
2658 err = dtv_property_cache_sync(fe, c, parg);
2659 if (err)
2660 break;
2661 err = dtv_set_frontend(fe);
2662 break;
2663 case FE_GET_EVENT:
2664 err = dvb_frontend_get_event(fe, parg, file->f_flags);
2665 break;
2666
2667 case FE_GET_FRONTEND: {
2668 struct dtv_frontend_properties getp = fe->dtv_property_cache;
2669
2670 /*
2671 * Let's use our own copy of property cache, in order to
2672 * avoid mangling with DTV zigzag logic, as drivers might
2673 * return crap, if they don't check if the data is available
2674 * before updating the properties cache.
2675 */
2676 err = dtv_get_frontend(fe, &getp, parg);
2677 break;
2678 }
2679
2680 default:
2681 return -ENOTSUPP;
2682 } /* switch */
2683
2684 return err;
2685 }
2686
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build botRe: [PATCH 2/2] media: dvb: represent min/max/step/tolerance freqs in Hz
In reply to Mauro Carvalho ChehabI love your patch! Perhaps something to improve:
Hi Mauro,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.18-rc3 next-20180704]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/DVB-represent-frequencies-at-tuner-frontend-info-in-Hz/20180705-105703 base: git://linuxtv.org/media_tree.git master config: i386-randconfig-x002-201826 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/string.h:3:0,
from include/linux/string.h:20,
from drivers/media/dvb-core/dvb_frontend.c:30:
drivers/media/dvb-core/dvb_frontend.c: In function 'dvb_frontend_handle_ioctl':
>> drivers/media/dvb-core/dvb_frontend.c:2396:25: warning: argument to 'sizeof' in '__builtin_memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
memset(info, 0, sizeof(info));
^
arch/x86/include/asm/string_32.h:325:52: note: in definition of macro 'memset'
#define memset(s, c, count) __builtin_memset(s, c, count)
^~~~~ Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
Cyclomatic Complexity 3 include/linux/log2.h:is_power_of_2
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_set
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_set
Cyclomatic Complexity 1 arch/x86/include/asm/current.h:get_current
Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
Cyclomatic Complexity 2 include/linux/thread_info.h:test_ti_thread_flag
Cyclomatic Complexity 2 include/linux/thread_info.h:check_object_size
Cyclomatic Complexity 2 include/linux/thread_info.h:copy_overflow
Cyclomatic Complexity 4 include/linux/thread_info.h:check_copy_size
Cyclomatic Complexity 70 include/linux/ktime.h:ktime_divns
Cyclomatic Complexity 1 include/linux/ktime.h:ktime_to_us
Cyclomatic Complexity 1 include/linux/ktime.h:ktime_us_delta
Cyclomatic Complexity 1 include/linux/ktime.h:ktime_add_us
Cyclomatic Complexity 1 include/linux/timekeeping.h:ktime_get_boottime
Cyclomatic Complexity 1 include/linux/refcount.h:refcount_set
Cyclomatic Complexity 1 arch/x86/include/asm/refcount.h:refcount_inc
Cyclomatic Complexity 1 arch/x86/include/asm/refcount.h:refcount_dec_and_test
Cyclomatic Complexity 1 include/linux/sched.h:task_thread_info
Cyclomatic Complexity 1 include/linux/sched.h:test_tsk_thread_flag
Cyclomatic Complexity 1 include/linux/sched/signal.h:signal_pending
Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
Cyclomatic Complexity 1 include/linux/semaphore.h:sema_init
Cyclomatic Complexity 2 include/linux/uaccess.h:copy_to_user
Cyclomatic Complexity 4 include/linux/poll.h:poll_wait
Cyclomatic Complexity 1 include/linux/kref.h:kref_init
Cyclomatic Complexity 1 include/linux/kref.h:kref_get
Cyclomatic Complexity 2 include/linux/kref.h:kref_put
Cyclomatic Complexity 2 include/linux/freezer.h:freezing
Cyclomatic Complexity 2 include/linux/freezer.h:try_to_freeze_unsafe
Cyclomatic Complexity 2 include/linux/freezer.h:try_to_freeze
Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_get
Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:has_get_frontend
Cyclomatic Complexity 5 drivers/media/dvb-core/dvb_frontend.c:dvbv3_type
Cyclomatic Complexity 5 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_init
Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_swzigzag_update_delay Cyclomatic Complexity 20 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_swzigzag_autotune Cyclomatic Complexity 6 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_is_exiting Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_should_wakeup Cyclomatic Complexity 66 drivers/media/dvb-core/dvb_frontend.c:dtv_property_process_get Cyclomatic Complexity 3 drivers/media/dvb-core/dvb_frontend.c:is_dvbv3_delsys
Cyclomatic Complexity 4 drivers/media/dvb-core/dvb_frontend.c:emulate_delivery_system Cyclomatic Complexity 10 drivers/media/dvb-core/dvb_frontend.c:dvbv5_set_delivery_system Cyclomatic Complexity 7 drivers/media/dvb-core/dvb_frontend.c:dvbv3_set_delivery_system Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_poll
Cyclomatic Complexity 4 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_suspend Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_wakeup
Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_reinitialise Cyclomatic Complexity 8 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_resume
Cyclomatic Complexity 5 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_sleep_until Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_clear_events Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_invoke_release Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:__dvb_frontend_free
Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_put
Cyclomatic Complexity 7 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_release Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_free
Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_detach
Cyclomatic Complexity 12 drivers/media/dvb-core/dvb_frontend.c:dtv_property_legacy_params_sync Cyclomatic Complexity 4 drivers/media/dvb-core/dvb_frontend.c:dtv_get_frontend
Cyclomatic Complexity 4 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_add_event Cyclomatic Complexity 25 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_swzigzag Cyclomatic Complexity 15 drivers/media/dvb-core/dvb_frontend.c:dtv_property_cache_sync Cyclomatic Complexity 6 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_get_frequency_limits Cyclomatic Complexity 10 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_check_parameters Cyclomatic Complexity 44 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_thread Cyclomatic Complexity 4 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_stop
Cyclomatic Complexity 7 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_start
Cyclomatic Complexity 28 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_open
Cyclomatic Complexity 2 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_ioctl
Cyclomatic Complexity 18 drivers/media/dvb-core/dvb_frontend.c:dtv_set_frontend
Cyclomatic Complexity 5 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_clear_cache Cyclomatic Complexity 3 drivers/media/dvb-core/dvb_frontend.c:dvb_register_frontend Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_test_event Cyclomatic Complexity 8 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_get_event Cyclomatic Complexity 68 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_handle_ioctl Cyclomatic Complexity 6 drivers/media/dvb-core/dvb_frontend.c:dvb_frontend_do_ioctl Cyclomatic Complexity 46 drivers/media/dvb-core/dvb_frontend.c:dtv_property_process_set Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:dvb_unregister_frontend Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:_GLOBAL__sub_I_00100_0_dvb_frontend_reinitialise Cyclomatic Complexity 1 drivers/media/dvb-core/dvb_frontend.c:_GLOBAL__sub_D_00100_1_dvb_frontend_reinitialise
vim +2396 drivers/media/dvb-core/dvb_frontend.c
2295
2296 static int dvb_frontend_handle_ioctl(struct file *file,
2297 unsigned int cmd, void *parg)
2298 {
2299 struct dvb_device *dvbdev = file->private_data;
2300 struct dvb_frontend *fe = dvbdev->priv;
2301 struct dvb_frontend_private *fepriv = fe->frontend_priv;
2302 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
2303 int i, err = -ENOTSUPP;
2304
2305 dev_dbg(fe->dvb->device, "%s:\n", __func__);
2306
2307 switch (cmd) {
2308 case FE_SET_PROPERTY: {
2309 struct dtv_properties *tvps = parg;
2310 struct dtv_property *tvp = NULL;
2311
2312 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n",
2313 __func__, tvps->num);
2314 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n",
2315 __func__, tvps->props);
2316
2317 /*
2318 * Put an arbitrary limit on the number of messages that can
2319 * be sent at once
2320 */
2321 if (!tvps->num || (tvps->num > DTV_IOCTL_MAX_MSGS))
2322 return -EINVAL;
2323
2324 tvp = memdup_user((void __user *)tvps->props, tvps->num * sizeof(*tvp));
2325 if (IS_ERR(tvp))
2326 return PTR_ERR(tvp);
2327
2328 for (i = 0; i < tvps->num; i++) {
2329 err = dtv_property_process_set(fe, file,
2330 (tvp + i)->cmd,
2331 (tvp + i)->u.data);
2332 if (err < 0) {
2333 kfree(tvp);
2334 return err;
2335 }
2336 }
2337 kfree(tvp);
2338 err = 0;
2339 break;
2340 }
2341 case FE_GET_PROPERTY: {
2342 struct dtv_properties *tvps = parg;
2343 struct dtv_property *tvp = NULL;
2344 struct dtv_frontend_properties getp = fe->dtv_property_cache;
2345
2346 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n",
2347 __func__, tvps->num);
2348 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n",
2349 __func__, tvps->props);
2350
2351 /*
2352 * Put an arbitrary limit on the number of messages that can
2353 * be sent at once
2354 */
2355 if (!tvps->num || (tvps->num > DTV_IOCTL_MAX_MSGS))
2356 return -EINVAL;
2357
2358 tvp = memdup_user((void __user *)tvps->props, tvps->num * sizeof(*tvp));
2359 if (IS_ERR(tvp))
2360 return PTR_ERR(tvp);
2361
2362 /*
2363 * Let's use our own copy of property cache, in order to
2364 * avoid mangling with DTV zigzag logic, as drivers might
2365 * return crap, if they don't check if the data is available
2366 * before updating the properties cache.
2367 */
2368 if (fepriv->state != FESTATE_IDLE) {
2369 err = dtv_get_frontend(fe, &getp, NULL);
2370 if (err < 0) {
2371 kfree(tvp);
2372 return err;
2373 }
2374 }
2375 for (i = 0; i < tvps->num; i++) {
2376 err = dtv_property_process_get(fe, &getp,
2377 tvp + i, file);
2378 if (err < 0) {
2379 kfree(tvp);
2380 return err;
2381 }
2382 }
2383
2384 if (copy_to_user((void __user *)tvps->props, tvp,
2385 tvps->num * sizeof(struct dtv_property))) {
2386 kfree(tvp);
2387 return -EFAULT;
2388 }
2389 kfree(tvp);
2390 err = 0;
2391 break;
2392 }
2393
2394 case FE_GET_INFO: {
2395 struct dvb_frontend_info *info = parg;
> 2396 memset(info, 0, sizeof(info));
2397
2398 dvb_frontend_get_frequency_limits(fe, &info->frequency_min, &info->frequency_max);
2399 strcpy(info->name, fe->ops.info.name);
2400 info->frequency_stepsize = fe->ops.info.frequency_stepsize_hz;
2401 info->frequency_tolerance = fe->ops.info.frequency_tolerance_hz;
2402 info->symbol_rate_min = fe->ops.info.symbol_rate_min;
2403 info->symbol_rate_max = fe->ops.info.symbol_rate_max;
2404 info->symbol_rate_tolerance = fe->ops.info.symbol_rate_tolerance;
2405 info->caps = fe->ops.info.caps;
2406
2407 /* If the standard is for satellite, convert frequencies to kHz */
2408 switch (c->delivery_system) {
2409 case SYS_DVBS:
2410 case SYS_DVBS2:
2411 case SYS_TURBO:
2412 case SYS_ISDBS:
2413 info->frequency_stepsize = fe->ops.info.frequency_stepsize_hz / kHz;
2414 info->frequency_tolerance = fe->ops.info.frequency_tolerance_hz / kHz;
2415 break;
2416 default:
2417 info->frequency_stepsize = fe->ops.info.frequency_stepsize_hz;
2418 info->frequency_tolerance = fe->ops.info.frequency_tolerance_hz;
2419 break;
2420 }
2421
2422 /*
2423 * Associate the 4 delivery systems supported by DVBv3
2424 * API with their DVBv5 counterpart. For the other standards,
2425 * use the closest type, assuming that it would hopefully
2426 * work with a DVBv3 application.
2427 * It should be noticed that, on multi-frontend devices with
2428 * different types (terrestrial and cable, for example),
2429 * a pure DVBv3 application won't be able to use all delivery
2430 * systems. Yet, changing the DVBv5 cache to the other delivery
2431 * system should be enough for making it work.
2432 */
2433 switch (dvbv3_type(c->delivery_system)) {
2434 case DVBV3_QPSK:
2435 info->type = FE_QPSK;
2436 break;
2437 case DVBV3_ATSC:
2438 info->type = FE_ATSC;
2439 break;
2440 case DVBV3_QAM:
2441 info->type = FE_QAM;
2442 break;
2443 case DVBV3_OFDM:
2444 info->type = FE_OFDM;
2445 break;
2446 default:
2447 dev_err(fe->dvb->device,
2448 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
2449 __func__, c->delivery_system);
2450 info->type = FE_OFDM;
2451 }
2452 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
2453 __func__, c->delivery_system, info->type);
2454
2455 /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */
2456 if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT))
2457 info->caps |= FE_CAN_INVERSION_AUTO;
2458 err = 0;
2459 break;
2460 }
2461
2462 case FE_READ_STATUS: {
2463 enum fe_status *status = parg;
2464
2465 /* if retune was requested but hasn't occurred yet, prevent
2466 * that user get signal state from previous tuning */
2467 if (fepriv->state == FESTATE_RETUNE ||
2468 fepriv->state == FESTATE_ERROR) {
2469 err = 0;
2470 *status = 0;
2471 break;
2472 }
2473
2474 if (fe->ops.read_status)
2475 err = fe->ops.read_status(fe, status);
2476 break;
2477 }
2478
2479 case FE_DISEQC_RESET_OVERLOAD:
2480 if (fe->ops.diseqc_reset_overload) {
2481 err = fe->ops.diseqc_reset_overload(fe);
2482 fepriv->state = FESTATE_DISEQC;
2483 fepriv->status = 0;
2484 }
2485 break;
2486
2487 case FE_DISEQC_SEND_MASTER_CMD:
2488 if (fe->ops.diseqc_send_master_cmd) {
2489 struct dvb_diseqc_master_cmd *cmd = parg;
2490
2491 if (cmd->msg_len > sizeof(cmd->msg)) {
2492 err = -EINVAL;
2493 break;
2494 }
2495 err = fe->ops.diseqc_send_master_cmd(fe, cmd);
2496 fepriv->state = FESTATE_DISEQC;
2497 fepriv->status = 0;
2498 }
2499 break;
2500
2501 case FE_DISEQC_SEND_BURST:
2502 if (fe->ops.diseqc_send_burst) {
2503 err = fe->ops.diseqc_send_burst(fe,
2504 (enum fe_sec_mini_cmd)parg);
2505 fepriv->state = FESTATE_DISEQC;
2506 fepriv->status = 0;
2507 }
2508 break;
2509
2510 case FE_SET_TONE:
2511 if (fe->ops.set_tone) {
2512 err = fe->ops.set_tone(fe,
2513 (enum fe_sec_tone_mode)parg);
2514 fepriv->tone = (enum fe_sec_tone_mode)parg;
2515 fepriv->state = FESTATE_DISEQC;
2516 fepriv->status = 0;
2517 }
2518 break;
2519
2520 case FE_SET_VOLTAGE:
2521 if (fe->ops.set_voltage) {
2522 err = fe->ops.set_voltage(fe,
2523 (enum fe_sec_voltage)parg);
2524 fepriv->voltage = (enum fe_sec_voltage)parg;
2525 fepriv->state = FESTATE_DISEQC;
2526 fepriv->status = 0;
2527 }
2528 break;
2529
2530 case FE_DISEQC_RECV_SLAVE_REPLY:
2531 if (fe->ops.diseqc_recv_slave_reply)
2532 err = fe->ops.diseqc_recv_slave_reply(fe, parg);
2533 break;
2534
2535 case FE_ENABLE_HIGH_LNB_VOLTAGE:
2536 if (fe->ops.enable_high_lnb_voltage)
2537 err = fe->ops.enable_high_lnb_voltage(fe, (long)parg);
2538 break;
2539
2540 case FE_SET_FRONTEND_TUNE_MODE:
2541 fepriv->tune_mode_flags = (unsigned long)parg;
2542 err = 0;
2543 break;
2544
2545 /* DEPRECATED dish control ioctls */
2546
2547 case FE_DISHNETWORK_SEND_LEGACY_CMD:
2548 if (fe->ops.dishnetwork_send_legacy_command) {
2549 err = fe->ops.dishnetwork_send_legacy_command(fe,
2550 (unsigned long)parg);
2551 fepriv->state = FESTATE_DISEQC;
2552 fepriv->status = 0;
2553 } else if (fe->ops.set_voltage) {
2554 /*
2555 * NOTE: This is a fallback condition. Some frontends
2556 * (stv0299 for instance) take longer than 8msec to
2557 * respond to a set_voltage command. Those switches
2558 * need custom routines to switch properly. For all
2559 * other frontends, the following should work ok.
2560 * Dish network legacy switches (as used by Dish500)
2561 * are controlled by sending 9-bit command words
2562 * spaced 8msec apart.
2563 * the actual command word is switch/port dependent
2564 * so it is up to the userspace application to send
2565 * the right command.
2566 * The command must always start with a '0' after
2567 * initialization, so parg is 8 bits and does not
2568 * include the initialization or start bit
2569 */
2570 unsigned long swcmd = ((unsigned long)parg) << 1;
2571 ktime_t nexttime;
2572 ktime_t tv[10];
2573 int i;
2574 u8 last = 1;
2575
2576 if (dvb_frontend_debug)
2577 dprintk("%s switch command: 0x%04lx\n",
2578 __func__, swcmd);
2579 nexttime = ktime_get_boottime();
2580 if (dvb_frontend_debug)
2581 tv[0] = nexttime;
2582 /* before sending a command, initialize by sending
2583 * a 32ms 18V to the switch
2584 */
2585 fe->ops.set_voltage(fe, SEC_VOLTAGE_18);
2586 dvb_frontend_sleep_until(&nexttime, 32000);
2587
2588 for (i = 0; i < 9; i++) {
2589 if (dvb_frontend_debug)
2590 tv[i + 1] = ktime_get_boottime();
2591 if ((swcmd & 0x01) != last) {
2592 /* set voltage to (last ? 13V : 18V) */
2593 fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18);
2594 last = (last) ? 0 : 1;
2595 }
2596 swcmd = swcmd >> 1;
2597 if (i != 8)
2598 dvb_frontend_sleep_until(&nexttime, 8000);
2599 }
2600 if (dvb_frontend_debug) {
2601 dprintk("%s(%d): switch delay (should be 32k followed by all 8k)\n",
2602 __func__, fe->dvb->num);
2603 for (i = 1; i < 10; i++)
2604 pr_info("%d: %d\n", i,
2605 (int)ktime_us_delta(tv[i], tv[i - 1]));
2606 }
2607 err = 0;
2608 fepriv->state = FESTATE_DISEQC;
2609 fepriv->status = 0;
2610 }
2611 break;
2612
2613 /* DEPRECATED statistics ioctls */
2614
2615 case FE_READ_BER:
2616 if (fe->ops.read_ber) {
2617 if (fepriv->thread)
2618 err = fe->ops.read_ber(fe, parg);
2619 else
2620 err = -EAGAIN;
2621 }
2622 break;
2623
2624 case FE_READ_SIGNAL_STRENGTH:
2625 if (fe->ops.read_signal_strength) {
2626 if (fepriv->thread)
2627 err = fe->ops.read_signal_strength(fe, parg);
2628 else
2629 err = -EAGAIN;
2630 }
2631 break;
2632
2633 case FE_READ_SNR:
2634 if (fe->ops.read_snr) {
2635 if (fepriv->thread)
2636 err = fe->ops.read_snr(fe, parg);
2637 else
2638 err = -EAGAIN;
2639 }
2640 break;
2641
2642 case FE_READ_UNCORRECTED_BLOCKS:
2643 if (fe->ops.read_ucblocks) {
2644 if (fepriv->thread)
2645 err = fe->ops.read_ucblocks(fe, parg);
2646 else
2647 err = -EAGAIN;
2648 }
2649 break;
2650
2651 /* DEPRECATED DVBv3 ioctls */
2652
2653 case FE_SET_FRONTEND:
2654 err = dvbv3_set_delivery_system(fe);
2655 if (err)
2656 break;
2657
2658 err = dtv_property_cache_sync(fe, c, parg);
2659 if (err)
2660 break;
2661 err = dtv_set_frontend(fe);
2662 break;
2663 case FE_GET_EVENT:
2664 err = dvb_frontend_get_event(fe, parg, file->f_flags);
2665 break;
2666
2667 case FE_GET_FRONTEND: {
2668 struct dtv_frontend_properties getp = fe->dtv_property_cache;
2669
2670 /*
2671 * Let's use our own copy of property cache, in order to
2672 * avoid mangling with DTV zigzag logic, as drivers might
2673 * return crap, if they don't check if the data is available
2674 * before updating the properties cache.
2675 */
2676 err = dtv_get_frontend(fe, &getp, parg);
2677 break;
2678 }
2679
2680 default:
2681 return -ENOTSUPP;
2682 } /* switch */
2683
2684 return err;
2685 }
2686
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build bot[PATCH] media: dvb: fix noderef.cocci warnings
In reply to Mauro Carvalho Chehabdrivers/media/dvb-core/dvb_frontend.c:2396:18-24: ERROR: application of sizeof to pointer
From: kbuild test robot <[email protected]>
drivers/media/dvb-core/dvb_frontend.c:2396:18-24: ERROR: application of sizeof to pointer
sizeof when applied to a pointer typed expression gives the size of the pointer
Generated by: scripts/coccinelle/misc/noderef.cocci
---
dvb_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb-core/dvb_frontend.c +1 -1
@@ -2393,7 +2393,7 @@ static int dvb_frontend_handle_ioctl(strcase FE_GET_INFO : {struct dvb_frontend_info *info = parg; -memset (info,0 ,sizeof (info)); +memset (info,0 ,sizeof (*info));dvb_frontend_get_frequency_limits (fe, &info->frequency_min, &info->frequency_max);strcpy (info->name, fe->ops.info.name);
Re: [PATCH] media: dvb: fix noderef.cocci warnings
Quoted 21 lines · kbuild test robot
From: kbuild test robot <[email protected]>
drivers/media/dvb-core/dvb_frontend.c:2396:18-24: ERROR: application of sizeof to pointer
sizeof when applied to a pointer typed expression gives the size of the pointer
Generated by:
scripts/coccinelle/misc/noderef.cocciFixes 07acff734698 ("media: dvb: represent min/max/step/tolerance freqs in Hz")CC Mauro Carvalho Chehab <[email protected]>Signed-off-by kbuild test robot <[email protected]>---
dvb_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb-core/dvb_frontend.c static int dvb_frontend_handle_ioctl(str · line 2399
Quoted 8 lines
drivers/media/dvb-core/dvb_frontend.c +1
-1@@ -2393,7 +2393,7 @@ static int dvb_frontend_handle_ioctl(strcase FE_GET_INFO : {struct dvb_frontend_info *info = parg; -memset (info,0 ,sizeof (info)); +memset (info,0 ,sizeof (*info));dvb_frontend_get_frequency_limits (fe, &info->frequency_min, &info->frequency_max);strcpy (info->name, fe->ops.info.name);
Nice catch! (even for a robot) I think we'll find more of these sprinkled throughout the tree.
kbuild test robot
build botRe: [PATCH 2/2] media: dvb: represent min/max/step/tolerance freqs in Hz
In reply to Mauro Carvalho ChehabI love your patch! Perhaps something to improve:
Hi Mauro,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.18-rc3 next-20180704]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/DVB-represent-frequencies-at-tuner-frontend-info-in-Hz/20180705-105703 base: git://linuxtv.org/media_tree.git master
coccinelle warnings: (new ones prefixed by >>)
>> drivers/media/dvb-core/dvb_frontend.c:2396:18-24: ERROR: application of sizeof to pointer
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation