Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c99080d authored by David T.L. Wong's avatar David T.L. Wong Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (11803): xc5000: add support for DVB-T tuning



This patch adds XC5000 supports for DVB-T 6MHz and 8MHz bandwidth.

Signed-off-by: default avatarDavid T.L. Wong <davidtlwong@gmail.com>
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a6301d1d
Loading
Loading
Loading
Loading
+45 −18
Original line number Diff line number Diff line
@@ -636,6 +636,8 @@ static int xc5000_set_params(struct dvb_frontend *fe,

	dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency);

	if (fe->ops.info.type == FE_ATSC) {
		dprintk(1, "%s() ATSC\n", __func__);
		switch (params->u.vsb.modulation) {
		case VSB_8:
		case VSB_16:
@@ -657,6 +659,31 @@ static int xc5000_set_params(struct dvb_frontend *fe,
		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;
	} else {
		printk(KERN_ERR "xc5000 modulation type not supported!\n");
		return -EINVAL;
	}

	dprintk(1, "%s() frequency=%d (compensated)\n",
		__func__, priv->freq_hz);