aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/dvb/dvb-core/dvb_frontend.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-17 20:36:57 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-20 11:50:23 -0200
commitfd66c45dd51000ff444231a94ac15ccab8cffd3d (patch)
tree9f54f08e52b38c936329a85a396abd98369be048 /drivers/media/dvb/dvb-core/dvb_frontend.c
parent669a4ba44d6054f147ef123b0c9a640e49c518e0 (diff)
[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 <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-core/dvb_frontend.c')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 821b2250ec7..66537b10132 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)