From patchwork Wed Apr 1 03:12:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wong X-Patchwork-Id: 15583 X-Patchwork-Delegate: mchehab@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n313CimA016223 for ; Wed, 1 Apr 2009 03:12:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754416AbZDADMo (ORCPT ); Tue, 31 Mar 2009 23:12:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753711AbZDADMo (ORCPT ); Tue, 31 Mar 2009 23:12:44 -0400 Received: from rv-out-0506.google.com ([209.85.198.228]:20173 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753183AbZDADMn (ORCPT ); Tue, 31 Mar 2009 23:12:43 -0400 Received: by rv-out-0506.google.com with SMTP id f9so3359933rvb.1 for ; Tue, 31 Mar 2009 20:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=AxJ7Sp6SYaEootrBBNIeljnBMnPLIB24lYGqUZ9EbgI=; b=I5MVYWETaEfs6gqdZnXKQaXPztEYSJbSFxFritOmaE8i7M6rrKdV7JQU9JpB6pxWpZ Emlshl3isEisNYgIYy78UnPGa4YW5kjLeXvTDhkRszGh0JjHE9/ZbE9TP6aYPURuI6+l GG40JXD42xCttdrvU0DTbUxg08Y9Vth/uOwrw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=FnjoWNtdpmV7oKqHaKNCkBMiMFqx7LHrXRUMTQy8CEMm4wpRdav0yCTM8r7K2txfV0 g4RpD/V4vTlK6rnDs2vayjuB288sUOM5jITrsmc/DGmK5Pg8hVkiH34GtrwGzBwsFo2L d3YXDDgQjH9XJkNpXFVHFMV3ZXIazd04d/RUc= MIME-Version: 1.0 Received: by 10.141.28.4 with SMTP id f4mr3795798rvj.37.1238555561617; Tue, 31 Mar 2009 20:12:41 -0700 (PDT) Date: Wed, 1 Apr 2009 11:12:41 +0800 Message-ID: <15ed362e0903312012w733db706g6d617336f98c642f@mail.gmail.com> Subject: [PATCH] XC5000 support for DVB-T 6MHz and 8MHz From: David Wong To: linux-media@vger.kernel.org Cc: Devin Heitmueller Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch add XC5000 supports for DVB-T 6MHz and 8MHz bandwidth. Signed-off-by: David T.L. Wong 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; }