From 39ce61a846c8e1fa00cb57ad5af021542e6e8403 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 11 Nov 2011 12:46:23 -0200 Subject: [media] dvb: Allow select between DVB-C Annex A and Annex C DVB-C, as defined by ITU-T J.83 has 3 annexes. The differences between Annex A and Annex C is that Annex C uses a subset of the modulation types, and uses a different rolloff factor. A different rolloff means that the bandwidth required is slicely different, and may affect the saw filter configuration at the tuners. Also, some demods have different configurations, depending on using Annex A or Annex C. So, allow userspace to specify it, by changing the rolloff factor. Signed-off-by: Mauro Carvalho Chehab --- include/linux/dvb/frontend.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/dvb/frontend.h') diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 1b1094c35e4f..d9251df867b5 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -329,6 +329,8 @@ typedef enum fe_rolloff { ROLLOFF_20, ROLLOFF_25, ROLLOFF_AUTO, + ROLLOFF_15, /* DVB-C Annex A */ + ROLLOFF_13, /* DVB-C Annex C */ } fe_rolloff_t; typedef enum fe_delivery_system { -- cgit v1.2.3 From ba2780c796badfc3741c7cb499a575ca49f17e6d Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Sun, 13 Nov 2011 18:47:44 -0300 Subject: [media] DVB: Query DVB frontend delivery capabilities Currently, for any multi-standard frontend it is assumed that it just has a single standard capability. This is fine in some cases, but makes things hard when there are incompatible standards in conjuction. Eg: DVB-S can be seen as a subset of DVB-S2, but the same doesn't hold the same for DSS. This is not specific to any driver as it is, but a generic issue. This was handled correctly in the multiproto tree, while such functionality is missing from the v5 API update. http://www.linuxtv.org/pipermail/vdr/2008-November/018417.html Later on a FE_CAN_2G_MODULATION was added as a hack to workaround this issue in the v5 API, but that hack is incapable of addressing the issue, as it can be used to simply distinguish between DVB-S and DVB-S2 alone, or another X vs X2 modulation. If there are more systems, then you have a potential issue. An application needs to query the device capabilities before requesting any operation from the device. Signed-off-by: Manu Abraham Acked-by: Andreas Oberritter Acked-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-core/dvb_frontend.c | 36 +++++++++++++++++++++++++++++++ include/linux/dvb/frontend.h | 4 +++- include/linux/dvb/version.h | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) (limited to 'include/linux/dvb/frontend.h') diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index c849455458ea..821b2250ec70 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -974,6 +974,8 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = { _DTV_CMD(DTV_GUARD_INTERVAL, 0, 0), _DTV_CMD(DTV_TRANSMISSION_MODE, 0, 0), _DTV_CMD(DTV_HIERARCHY, 0, 0), + + _DTV_CMD(DTV_ENUM_DELSYS, 0, 0), }; static void dtv_property_dump(struct dtv_property *tvp) @@ -1209,6 +1211,37 @@ static int dvb_frontend_ioctl_legacy(struct file *file, static int dvb_frontend_ioctl_properties(struct file *file, unsigned int cmd, void *parg); +static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct dtv_property *p) +{ + const struct dvb_frontend_info *info = &fe->ops.info; + u32 ncaps = 0; + + switch (info->type) { + case FE_QPSK: + p->u.buffer.data[ncaps++] = SYS_DVBS; + if (info->caps & FE_CAN_2G_MODULATION) + p->u.buffer.data[ncaps++] = SYS_DVBS2; + if (info->caps & FE_CAN_TURBO_FEC) + p->u.buffer.data[ncaps++] = SYS_TURBO; + break; + case FE_QAM: + p->u.buffer.data[ncaps++] = SYS_DVBC_ANNEX_AC; + break; + case FE_OFDM: + p->u.buffer.data[ncaps++] = SYS_DVBT; + if (info->caps & FE_CAN_2G_MODULATION) + p->u.buffer.data[ncaps++] = SYS_DVBT2; + break; + case FE_ATSC: + if (info->caps & (FE_CAN_8VSB | FE_CAN_16VSB)) + p->u.buffer.data[ncaps++] = SYS_ATSC; + if (info->caps & (FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_128 | FE_CAN_QAM_256)) + p->u.buffer.data[ncaps++] = SYS_DVBC_ANNEX_B; + break; + } + p->u.buffer.len = ncaps; +} + static int dtv_property_process_get(struct dvb_frontend *fe, struct dtv_property *tvp, struct file *file) @@ -1229,6 +1262,9 @@ static int dtv_property_process_get(struct dvb_frontend *fe, } switch(tvp->cmd) { + case DTV_ENUM_DELSYS: + dtv_set_default_delivery_caps(fe, tvp); + break; case DTV_FREQUENCY: tvp->u.data = c->frequency; break; diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index d9251df867b5..cb114f52ccf7 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -316,7 +316,9 @@ struct dvb_frontend_event { #define DTV_DVBT2_PLP_ID 43 -#define DTV_MAX_COMMAND DTV_DVBT2_PLP_ID +#define DTV_ENUM_DELSYS 44 + +#define DTV_MAX_COMMAND DTV_ENUM_DELSYS typedef enum fe_pilot { PILOT_ON, diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 66594b1d5d7b..0559e2bd38f9 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h @@ -24,6 +24,6 @@ #define _DVBVERSION_H_ #define DVB_API_VERSION 5 -#define DVB_API_VERSION_MINOR 4 +#define DVB_API_VERSION_MINOR 5 #endif /*_DVBVERSION_H_*/ -- cgit v1.2.3 From bf3b84006e22ae241ec3d53dbe6c6d1f6ceddb56 Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Sat, 17 Dec 2011 20:36:55 -0300 Subject: [media] DVB: Use a unique delivery system identifier for DVBC_ANNEX_C Use a unique delivery system identifier for DVBC_ANNEX_C, just like any other. DVBC_ANNEX_A and DVBC_ANNEX_C have slightly different parameters and are used in 2 geographically different locations. Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- include/linux/dvb/frontend.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/linux/dvb/frontend.h') diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index cb114f52ccf7..b2a939f8f1e2 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -337,7 +337,7 @@ typedef enum fe_rolloff { typedef enum fe_delivery_system { SYS_UNDEFINED, - SYS_DVBC_ANNEX_AC, + SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_B, SYS_DVBT, SYS_DSS, @@ -354,8 +354,13 @@ typedef enum fe_delivery_system { SYS_DAB, SYS_DVBT2, SYS_TURBO, + SYS_DVBC_ANNEX_C, } fe_delivery_system_t; + +#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A + + struct dtv_cmds_h { char *name; /* A display name for debugging purposes */ -- cgit v1.2.3 From fd66c45dd51000ff444231a94ac15ccab8cffd3d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 17 Dec 2011 20:36:57 -0300 Subject: [media] Remove Annex A/C selection via roll-off factor Instead of using a roll-off factor, change DRX-K & friends to select the bandwidth filter and the Nyquist half roll-off via delivery system. This provides a cleaner support for Annex A/C switch. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/tuners/xc5000.c | 137 ++++++++++++----------------- drivers/media/dvb/dvb-core/dvb_frontend.c | 25 +++++- drivers/media/dvb/frontends/drxk_hard.c | 15 ++-- drivers/media/dvb/frontends/tda18271c2dd.c | 44 ++++----- include/linux/dvb/frontend.h | 2 - 5 files changed, 106 insertions(+), 117 deletions(-) (limited to 'include/linux/dvb/frontend.h') diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index 97ad33896343..5c56d3cc030b 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c @@ -629,11 +629,13 @@ static void xc_debug_dump(struct xc5000_priv *priv) } static int xc5000_set_params(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) + struct dvb_frontend_parameters *params) { + int ret, b; struct xc5000_priv *priv = fe->tuner_priv; - int ret; - u32 bw; + u32 bw = fe->dtv_property_cache.bandwidth_hz; + u32 freq = fe->dtv_property_cache.frequency; + u32 delsys = fe->dtv_property_cache.delivery_system; if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) { if (xc_load_fw_and_init_tuner(fe) != XC_RESULT_SUCCESS) { @@ -642,104 +644,77 @@ static int xc5000_set_params(struct dvb_frontend *fe, } } - dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); + dprintk(1, "%s() frequency=%d (Hz)\n", __func__, freq); - if (fe->ops.info.type == FE_ATSC) { - dprintk(1, "%s() ATSC\n", __func__); - switch (params->u.vsb.modulation) { - case VSB_8: - case VSB_16: - dprintk(1, "%s() VSB modulation\n", __func__); - priv->rf_mode = XC_RF_MODE_AIR; - priv->freq_hz = params->frequency - 1750000; - priv->bandwidth = BANDWIDTH_6_MHZ; - priv->video_standard = DTV6; - break; - case QAM_64: - case QAM_256: - case QAM_AUTO: - dprintk(1, "%s() QAM modulation\n", __func__); - priv->rf_mode = XC_RF_MODE_CABLE; - priv->freq_hz = params->frequency - 1750000; - priv->bandwidth = BANDWIDTH_6_MHZ; - priv->video_standard = DTV6; - break; - default: - return -EINVAL; - } - } else if (fe->ops.info.type == FE_OFDM) { + switch (delsys) { + case SYS_ATSC: + dprintk(1, "%s() VSB modulation\n", __func__); + priv->rf_mode = XC_RF_MODE_AIR; + priv->freq_hz = freq - 1750000; + priv->bandwidth = BANDWIDTH_6_MHZ; + priv->video_standard = DTV6; + break; + case SYS_DVBC_ANNEX_B: + dprintk(1, "%s() QAM modulation\n", __func__); + priv->rf_mode = XC_RF_MODE_CABLE; + priv->freq_hz = freq - 1750000; + priv->bandwidth = BANDWIDTH_6_MHZ; + priv->video_standard = DTV6; + break; + case SYS_DVBT: + case SYS_DVBT2: dprintk(1, "%s() OFDM\n", __func__); - switch (params->u.ofdm.bandwidth) { - case BANDWIDTH_6_MHZ: + switch (bw) { + case 6000000: priv->bandwidth = BANDWIDTH_6_MHZ; priv->video_standard = DTV6; - priv->freq_hz = params->frequency - 1750000; + priv->freq_hz = freq - 1750000; break; - case BANDWIDTH_7_MHZ: + case 7000000: priv->bandwidth = BANDWIDTH_7_MHZ; priv->video_standard = DTV7; - priv->freq_hz = params->frequency - 2250000; + priv->freq_hz = freq - 2250000; break; - case BANDWIDTH_8_MHZ: + case 8000000: priv->bandwidth = BANDWIDTH_8_MHZ; priv->video_standard = DTV8; - priv->freq_hz = params->frequency - 2750000; + priv->freq_hz = freq - 2750000; break; default: printk(KERN_ERR "xc5000 bandwidth not set!\n"); return -EINVAL; } priv->rf_mode = XC_RF_MODE_AIR; - } else if (fe->ops.info.type == FE_QAM) { - switch (params->u.qam.modulation) { - case QAM_256: - case QAM_AUTO: - case QAM_16: - case QAM_32: - case QAM_64: - case QAM_128: - dprintk(1, "%s() QAM modulation\n", __func__); - priv->rf_mode = XC_RF_MODE_CABLE; - /* - * Using a higher bandwidth at the tuner filter may - * allow inter-carrier interference. - * So, determine the minimal channel spacing, in order - * to better adjust the tuner filter. - * According with ITU-T J.83, the bandwidth is given by: - * bw = Simbol Rate * (1 + roll_off), where the roll_off - * is equal to 0.15 for Annex A, and 0.13 for annex C - */ - if (fe->dtv_property_cache.rolloff == ROLLOFF_13) - bw = (params->u.qam.symbol_rate * 113) / 100; - else - bw = (params->u.qam.symbol_rate * 115) / 100; - if (bw <= 6000000) { - priv->bandwidth = BANDWIDTH_6_MHZ; - priv->video_standard = DTV6; - priv->freq_hz = params->frequency - 1750000; - } else if (bw <= 7000000) { - priv->bandwidth = BANDWIDTH_7_MHZ; - priv->video_standard = DTV7; - priv->freq_hz = params->frequency - 2250000; - } else { - priv->bandwidth = BANDWIDTH_8_MHZ; - priv->video_standard = DTV7_8; - priv->freq_hz = params->frequency - 2750000; - } - dprintk(1, "%s() Bandwidth %dMHz (%d)\n", __func__, - BANDWIDTH_6_MHZ ? 6: 8, bw); - break; - default: - dprintk(1, "%s() Unsupported QAM type\n", __func__); - return -EINVAL; + case SYS_DVBC_ANNEX_A: + case SYS_DVBC_ANNEX_C: + dprintk(1, "%s() QAM modulation\n", __func__); + priv->rf_mode = XC_RF_MODE_CABLE; + if (bw <= 6000000) { + priv->bandwidth = BANDWIDTH_6_MHZ; + priv->video_standard = DTV6; + priv->freq_hz = freq - 1750000; + b = 6; + } else if (bw <= 7000000) { + priv->bandwidth = BANDWIDTH_7_MHZ; + priv->video_standard = DTV7; + priv->freq_hz = freq - 2250000; + b = 7; + } else { + priv->bandwidth = BANDWIDTH_8_MHZ; + priv->video_standard = DTV7_8; + priv->freq_hz = freq - 2750000; + b = 8; } - } else { - printk(KERN_ERR "xc5000 modulation type not supported!\n"); + dprintk(1, "%s() Bandwidth %dMHz (%d)\n", __func__, + b, bw); + break; + default: + printk(KERN_ERR "xc5000: delivery system is not supported!\n"); return -EINVAL; } - dprintk(1, "%s() frequency=%d (compensated)\n", - __func__, priv->freq_hz); + dprintk(1, "%s() frequency=%d (compensated to %d)\n", + __func__, freq, priv->freq_hz); ret = xc_SetSignalSource(priv, priv->rf_mode); if (ret != XC_RESULT_SUCCESS) { diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 821b2250ec70..66537b10132c 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -1011,7 +1011,7 @@ static void dtv_property_dump(struct dtv_property *tvp) static int is_legacy_delivery_system(fe_delivery_system_t s) { - if((s == SYS_UNDEFINED) || (s == SYS_DVBC_ANNEX_AC) || + if((s == SYS_UNDEFINED) || (s == SYS_DVBC_ANNEX_A) || (s == SYS_DVBC_ANNEX_B) || (s == SYS_DVBT) || (s == SYS_DVBS) || (s == SYS_ATSC)) return 1; @@ -1032,8 +1032,7 @@ static void dtv_property_cache_init(struct dvb_frontend *fe, c->delivery_system = SYS_DVBS; break; case FE_QAM: - c->delivery_system = SYS_DVBC_ANNEX_AC; - c->rolloff = ROLLOFF_15; /* implied for Annex A */ + c->delivery_system = SYS_DVBC_ANNEX_A; break; case FE_OFDM: c->delivery_system = SYS_DVBT; @@ -1144,9 +1143,10 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe) */ static void dtv_property_adv_params_sync(struct dvb_frontend *fe) { - const struct dtv_frontend_properties *c = &fe->dtv_property_cache; + struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dvb_frontend_parameters *p = &fepriv->parameters_in; + u32 rolloff = 0; p->frequency = c->frequency; p->inversion = c->inversion; @@ -1178,6 +1178,23 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe) else p->u.ofdm.bandwidth = BANDWIDTH_AUTO; } + + /* + * On DVB-C, the bandwidth is a function of roll-off and symbol rate. + * The bandwidth is required for DVB-C tuners, in order to avoid + * inter-channel noise. Instead of estimating the minimal required + * bandwidth on every single driver, calculates it here and fills + * it at the cache bandwidth parameter. + * While not officially supported, a side effect of handling it at + * the cache level is that a program could retrieve the bandwidth + * via DTV_BANDWIDTH_HZ, wich may be useful for test programs. + */ + if (c->delivery_system == SYS_DVBC_ANNEX_A) + rolloff = 115; + if (c->delivery_system == SYS_DVBC_ANNEX_C) + rolloff = 113; + if (rolloff) + c->bandwidth_hz = (c->symbol_rate * rolloff) / 100; } static void dtv_property_cache_submit(struct dvb_frontend *fe) diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 038e470bf039..a2c819651933 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -6215,6 +6215,7 @@ static int drxk_set_parameters(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) { struct drxk_state *state = fe->demodulator_priv; + u32 delsys = fe->dtv_property_cache.delivery_system; u32 IF; dprintk(1, "\n"); @@ -6225,11 +6226,15 @@ static int drxk_set_parameters(struct dvb_frontend *fe, return -EINVAL; } - if (fe->ops.info.type == FE_QAM) { - if (fe->dtv_property_cache.rolloff == ROLLOFF_13) - state->m_itut_annex_c = true; - else - state->m_itut_annex_c = false; + switch (delsys) { + case SYS_DVBC_ANNEX_A: + state->m_itut_annex_c = false; + break; + case SYS_DVBC_ANNEX_C: + state->m_itut_annex_c = true; + break; + default: + return -EINVAL; } if (fe->ops.i2c_gate_ctrl) diff --git a/drivers/media/dvb/frontends/tda18271c2dd.c b/drivers/media/dvb/frontends/tda18271c2dd.c index b66ca29704fc..0f8e9622bc96 100644 --- a/drivers/media/dvb/frontends/tda18271c2dd.c +++ b/drivers/media/dvb/frontends/tda18271c2dd.c @@ -1130,50 +1130,44 @@ static int set_params(struct dvb_frontend *fe, struct tda_state *state = fe->tuner_priv; int status = 0; int Standard; - u32 bw; + u32 bw = fe->dtv_property_cache.bandwidth_hz; + u32 delsys = fe->dtv_property_cache.delivery_system; - state->m_Frequency = params->frequency; + state->m_Frequency = fe->dtv_property_cache.frequency; - if (fe->ops.info.type == FE_OFDM) - switch (params->u.ofdm.bandwidth) { - case BANDWIDTH_6_MHZ: + switch (delsys) { + case SYS_DVBT: + case SYS_DVBT2: + switch (bw) { + case 6000000: Standard = HF_DVBT_6MHZ; break; - case BANDWIDTH_7_MHZ: + case 7000000: Standard = HF_DVBT_7MHZ; break; - default: - case BANDWIDTH_8_MHZ: + case 8000000: Standard = HF_DVBT_8MHZ; break; + default: + return -EINVAL; } - else if (fe->ops.info.type == FE_QAM) { - /* - * Using a higher bandwidth at the tuner filter may - * allow inter-carrier interference. - * So, determine the minimal channel spacing, in order - * to better adjust the tuner filter. - * According with ITU-T J.83, the bandwidth is given by: - * bw = Simbol Rate * (1 + roll_off), where the roll_off - * is equal to 0.15 for Annex A, and 0.13 for annex C - */ - if (fe->dtv_property_cache.rolloff == ROLLOFF_13) - bw = (params->u.qam.symbol_rate * 113) / 100; - else - bw = (params->u.qam.symbol_rate * 115) / 100; + case SYS_DVBC_ANNEX_A: + case SYS_DVBC_ANNEX_C: if (bw <= 6000000) Standard = HF_DVBC_6MHZ; else if (bw <= 7000000) Standard = HF_DVBC_7MHZ; else Standard = HF_DVBC_8MHZ; - } else + default: return -EINVAL; + } do { - status = RFTrackingFiltersCorrection(state, params->frequency); + status = RFTrackingFiltersCorrection(state, state->m_Frequency); if (status < 0) break; - status = ChannelConfiguration(state, params->frequency, Standard); + status = ChannelConfiguration(state, state->m_Frequency, + Standard); if (status < 0) break; diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index b2a939f8f1e2..a3c762383f88 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -331,8 +331,6 @@ typedef enum fe_rolloff { ROLLOFF_20, ROLLOFF_25, ROLLOFF_AUTO, - ROLLOFF_15, /* DVB-C Annex A */ - ROLLOFF_13, /* DVB-C Annex C */ } fe_rolloff_t; typedef enum fe_delivery_system { -- cgit v1.2.3 From 8de8594a79ae43b08d115c94f09373f6c673f202 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 26 Dec 2011 20:22:50 -0300 Subject: [media] dvb-core: be sure that drivers won't use DVBv3 internally Now that all frontends are implementing DVBv5, don't export the DVBv3 specific stuff to the drivers. Only the core should be aware of that, as it will keep providing DVBv3 backward compatibility. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-core/dvb_frontend.c | 3 +++ drivers/media/dvb/dvb-core/dvb_frontend.h | 2 ++ include/linux/dvb/frontend.h | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include/linux/dvb/frontend.h') diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index b1ab866743fd..55ca5521bca6 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -25,6 +25,9 @@ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html */ +/* Enables DVBv3 compatibility bits at the headers */ +#define __DVB_CORE__ + #include #include #include diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h index 93715d6755f4..676481c8ad78 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h @@ -315,6 +315,7 @@ struct dvb_frontend_ops { int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp); }; +#ifdef __DVB_CORE__ #define MAX_EVENT 8 struct dvb_fe_events { @@ -325,6 +326,7 @@ struct dvb_fe_events { wait_queue_head_t wait_queue; struct mutex mtx; }; +#endif struct dtv_frontend_properties { diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index a3c762383f88..7e7cb64f56d8 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -181,6 +181,7 @@ typedef enum fe_transmit_mode { TRANSMISSION_MODE_32K, } fe_transmit_mode_t; +#if defined(__DVB_CORE__) || !defined (__KERNEL__) typedef enum fe_bandwidth { BANDWIDTH_8_MHZ, BANDWIDTH_7_MHZ, @@ -190,7 +191,7 @@ typedef enum fe_bandwidth { BANDWIDTH_10_MHZ, BANDWIDTH_1_712_MHZ, } fe_bandwidth_t; - +#endif typedef enum fe_guard_interval { GUARD_INTERVAL_1_32, @@ -213,6 +214,7 @@ typedef enum fe_hierarchy { } fe_hierarchy_t; +#if defined(__DVB_CORE__) || !defined (__KERNEL__) struct dvb_qpsk_parameters { __u32 symbol_rate; /* symbol rate in Symbols per second */ fe_code_rate_t fec_inner; /* forward error correction (see above) */ @@ -251,11 +253,11 @@ struct dvb_frontend_parameters { } u; }; - struct dvb_frontend_event { fe_status_t status; struct dvb_frontend_parameters parameters; }; +#endif /* S2API Commands */ #define DTV_UNDEFINED 0 -- cgit v1.2.3 From cd7d494d0b23673215330963c28138dd0c3fd405 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 1 Jan 2012 16:11:17 -0300 Subject: [media] dvb: deprecate the usage of ops->info.type Mark info.type as deprecated inside the header, recommending the usage of DTV_ENUM_DELSYS DVBv5 command instead. Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/dvb/frontend.xml | 4 ++++ include/linux/dvb/frontend.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include/linux/dvb/frontend.h') diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml index 28d7ea5d5e73..aeaed59d0f1f 100644 --- a/Documentation/DocBook/media/dvb/frontend.xml +++ b/Documentation/DocBook/media/dvb/frontend.xml @@ -63,6 +63,10 @@ transmission. The fontend types are given by fe_type_t type, defined as: Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're supported via the new FE_GET_PROPERTY/FE_GET_SET_PROPERTY ioctl's, using the DTV_DELIVERY_SYSTEM parameter. + +The usage of this field is deprecated, as it doesn't report all supported standards, and +will provide an incomplete information for frontends that support multiple delivery systems. +Please use DTV_ENUM_DELSYS instead.
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 7e7cb64f56d8..cb4428ab81ed 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -72,7 +72,7 @@ typedef enum fe_caps { struct dvb_frontend_info { char name[128]; - fe_type_t type; + fe_type_t type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ __u32 frequency_min; __u32 frequency_max; __u32 frequency_stepsize; -- cgit v1.2.3