aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-03-28 10:53:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 06:26:14 -0400
commite0df5417acf65cff05343b1fb83fb40344e155ea (patch)
tree3d2754e953bb6e3bcea5d42a039b63d07a5eef75
parent30bd3b56db37a2c2eb6d3bb14ce02156807c79ed (diff)
[media] xc5000: Improve it to work better with 6MHz-spaced channels
Brazil uses 6MHz-spaced channels. So, the nyquist filter for DVB-C should be different, otherwise, inter-channel interference may badly affect the device, and signal may not be properly decoded. On my tests here, without this patch, sometimes channels are seen, but, most of the time, PID filter returns with timeout. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/tuners/xc5000.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index 1e28f7dcb26b..aa1b2e844d32 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -628,6 +628,15 @@ static void xc_debug_dump(struct xc5000_priv *priv)
628 dprintk(1, "*** Quality (0:<8dB, 7:>56dB) = %d\n", quality); 628 dprintk(1, "*** Quality (0:<8dB, 7:>56dB) = %d\n", quality);
629} 629}
630 630
631/*
632 * As defined on EN 300 429, the DVB-C roll-off factor is 0.15.
633 * So, the amount of the needed bandwith is given by:
634 * Bw = Symbol_rate * (1 + 0.15)
635 * As such, the maximum symbol rate supported by 6 MHz is given by:
636 * max_symbol_rate = 6 MHz / 1.15 = 5217391 Bauds
637 */
638#define MAX_SYMBOL_RATE_6MHz 5217391
639
631static int xc5000_set_params(struct dvb_frontend *fe, 640static int xc5000_set_params(struct dvb_frontend *fe,
632 struct dvb_frontend_parameters *params) 641 struct dvb_frontend_parameters *params)
633{ 642{
@@ -688,21 +697,32 @@ static int xc5000_set_params(struct dvb_frontend *fe,
688 } 697 }
689 priv->rf_mode = XC_RF_MODE_AIR; 698 priv->rf_mode = XC_RF_MODE_AIR;
690 } else if (fe->ops.info.type == FE_QAM) { 699 } else if (fe->ops.info.type == FE_QAM) {
691 dprintk(1, "%s() QAM\n", __func__);
692 switch (params->u.qam.modulation) { 700 switch (params->u.qam.modulation) {
701 case QAM_256:
702 case QAM_AUTO:
693 case QAM_16: 703 case QAM_16:
694 case QAM_32: 704 case QAM_32:
695 case QAM_64: 705 case QAM_64:
696 case QAM_128: 706 case QAM_128:
697 case QAM_256:
698 case QAM_AUTO:
699 dprintk(1, "%s() QAM modulation\n", __func__); 707 dprintk(1, "%s() QAM modulation\n", __func__);
700 priv->bandwidth = BANDWIDTH_8_MHZ;
701 priv->video_standard = DTV7_8;
702 priv->freq_hz = params->frequency - 2750000;
703 priv->rf_mode = XC_RF_MODE_CABLE; 708 priv->rf_mode = XC_RF_MODE_CABLE;
709 /*
710 * Using a 8MHz bandwidth sometimes fail
711 * with 6MHz-spaced channels, due to inter-carrier
712 * interference. So, use DTV6 firmware
713 */
714 if (params->u.qam.symbol_rate <= MAX_SYMBOL_RATE_6MHz) {
715 priv->bandwidth = BANDWIDTH_6_MHZ;
716 priv->video_standard = DTV6;
717 priv->freq_hz = params->frequency - 1750000;
718 } else {
719 priv->bandwidth = BANDWIDTH_8_MHZ;
720 priv->video_standard = DTV7_8;
721 priv->freq_hz = params->frequency - 2750000;
722 }
704 break; 723 break;
705 default: 724 default:
725 dprintk(1, "%s() Unsupported QAM type\n", __func__);
706 return -EINVAL; 726 return -EINVAL;
707 } 727 }
708 } else { 728 } else {