summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda18271c2dd.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-11-11 20:26:03 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-11 20:26:03 -0200
commit2440f7aff46af4187d0518e92adaddf475aa82b0 (patch)
treec01e1ec4c8845c0704d0d6699418f8b7f386fa52 /drivers/media/dvb/frontends/tda18271c2dd.c
parent39ce61a846c8e1fa00cb57ad5af021542e6e8403 (diff)
[media] Properly implement ITU-T J.88 Annex C support
The Annex C support were broken with the previous implementation, as, at xc5000 and tda18271c2dd, it were choosing the wrong bandwidth for some symbol rates. At DRX-J, it were always selecting Annex A, even having Annex C support coded there. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/tda18271c2dd.c')
-rw-r--r--drivers/media/dvb/frontends/tda18271c2dd.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/media/dvb/frontends/tda18271c2dd.c b/drivers/media/dvb/frontends/tda18271c2dd.c
index 1b1bf200c55..de544f6a4d7 100644
--- a/drivers/media/dvb/frontends/tda18271c2dd.c
+++ b/drivers/media/dvb/frontends/tda18271c2dd.c
@@ -1123,20 +1123,6 @@ static int release(struct dvb_frontend *fe)
return 0;
}
-/*
- * As defined on EN 300 429 Annex A and on ITU-T J.83 annex A, the DVB-C
- * roll-off factor is 0.15.
- * According with the specs, the amount of the needed bandwith is given by:
- * Bw = Symbol_rate * (1 + 0.15)
- * As such, the maximum symbol rate supported by 6 MHz is
- * max_symbol_rate = 6 MHz / 1.15 = 5217391 Bauds
- *NOTE: For ITU-T J.83 Annex C, the roll-off factor is 0.13. So:
- * max_symbol_rate = 6 MHz / 1.13 = 5309735 Baud
- * That means that an adjustment is needed for Japan,
- * but, as currently DRX-K is hardcoded to Annex A, let's stick
- * with 0.15 roll-off factor.
- */
-#define MAX_SYMBOL_RATE_6MHz 5217391
static int set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
@@ -1144,6 +1130,7 @@ static int set_params(struct dvb_frontend *fe,
struct tda_state *state = fe->tuner_priv;
int status = 0;
int Standard;
+ u32 bw;
state->m_Frequency = params->frequency;
@@ -1161,8 +1148,23 @@ static int set_params(struct dvb_frontend *fe,
break;
}
else if (fe->ops.info.type == FE_QAM) {
- if (params->u.qam.symbol_rate <= MAX_SYMBOL_RATE_6MHz)
+ /*
+ * 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 * 13) / 10;
+ else
+ bw = (params->u.qam.symbol_rate * 15) / 10;
+ if (bw <= 6000000)
Standard = HF_DVBC_6MHZ;
+ else if (bw <= 7000000)
+ Standard = HF_DVBC_7MHZ;
else
Standard = HF_DVBC_8MHZ;
} else