diff mbox

XC5000 support for DVB-T 6MHz and 8MHz

Message ID 15ed362e0903312012w733db706g6d617336f98c642f@mail.gmail.com (mailing list archive)
State Changes Requested
Delegated to: Mauro Carvalho Chehab
Headers show

Commit Message

David Wong April 1, 2009, 3:12 a.m. UTC
This patch add XC5000 supports for DVB-T 6MHz and 8MHz bandwidth.

Signed-off-by: David T.L. Wong <davidtlwong@gmail.com>

Comments

Devin Heitmueller April 1, 2009, 3:20 a.m. UTC | #1
2009/3/31 David Wong <davidtlwong@gmail.com>:
> This patch add XC5000 supports for DVB-T 6MHz and 8MHz bandwidth.
>
> Signed-off-by: David T.L. Wong <davidtlwong@gmail.com>

At first glance the patch looks sane.

Mauro, please do not merge this directly.  I am preparing a series of
xc5000 patches this week, and I will include this patch in the series
(which will get reviewed by stoth).  Also, I don't want this to go in
without having done at least some sanity testing under ATSC to ensure
it doesn't introduce any regressions (not that I think it will).

Thanks,

Devin
diff mbox

Patch

diff -r 5567e82c34a0 linux/drivers/media/common/tuners/xc5000.c
--- a/linux/drivers/media/common/tuners/xc5000.c	Tue Mar 31 07:24:14 2009 -0300
+++ b/linux/drivers/media/common/tuners/xc5000.c	Wed Apr 01 11:05:47 2009 +0800
@@ -669,25 +669,52 @@ 
 
 	dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency);
 
-	switch (params->u.vsb.modulation) {
-	case VSB_8:
-	case VSB_16:
-		dprintk(1, "%s() VSB modulation\n", __func__);
+	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) {
+		dprintk(1, "%s() OFDM\n", __func__);
+		switch (params->u.ofdm.bandwidth) {
+		case BANDWIDTH_6_MHZ:
+			priv->bandwidth = BANDWIDTH_6_MHZ;
+			priv->video_standard = DTV6;
+			priv->freq_hz = params->frequency - 1750000;
+			break;
+		case BANDWIDTH_7_MHZ:
+			printk(KERN_ERR "xc5000 bandwidth 7MHz not supported\n");
+			return -EINVAL;
+		case BANDWIDTH_8_MHZ:
+			priv->bandwidth = BANDWIDTH_8_MHZ;
+			priv->video_standard = DTV8;
+			priv->freq_hz = params->frequency - 2750000;
+			break;
+		default:
+			printk(KERN_ERR "xc5000 bandwidth not set!\n");
+			return -EINVAL;
+		}
 		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:
+	} else {
+		printk(KERN_ERR "xc5000 modulation type not supported!\n");
 		return -EINVAL;
 	}