From patchwork Tue Mar 31 03:39:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Wong X-Patchwork-Id: 15318 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 n2V3dab5013478 for ; Tue, 31 Mar 2009 03:39:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757028AbZCaDjg (ORCPT ); Mon, 30 Mar 2009 23:39:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757189AbZCaDjg (ORCPT ); Mon, 30 Mar 2009 23:39:36 -0400 Received: from rv-out-0506.google.com ([209.85.198.231]:32312 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757028AbZCaDjf convert rfc822-to-8bit (ORCPT ); Mon, 30 Mar 2009 23:39:35 -0400 Received: by rv-out-0506.google.com with SMTP id f9so2784123rvb.1 for ; Mon, 30 Mar 2009 20:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=C9qOFsxd3Tlv2x3Y8EVx+GBgO/rNzL8H0lFVWqhFJ7A=; b=rfyhvF11ekE0ofBIcHe3pyvGDKrwKMjbPAwRG8THiETLzrvi0tSl6uFkIl8mhQysRt RbOzcFe40LjXVWI3oYdgbcmk0retZQRTNP0V3Nbmwl4yGMUsdfKBOhNTieCNU8p9Pp8W xBJA1vGkFCXG3+7Qu2MSf1LJfJL1ia+Yd4xVU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=os1gOmeBHrj3TFwigAvYhyhFy5Q5E2KMm6jWan7szAkWhjMiXvy7j8ilYVwNA6b7bw QxybJG4u9gudjiATtzZeei+dCFLIE/um/xyqDgQekEVuLB1tZde0KNBUf6jTB4Qao5h+ vKig0Z45BK+DqtsRUKrjSL4spt3mLoFe8iN/I= MIME-Version: 1.0 Received: by 10.141.49.18 with SMTP id b18mr3218835rvk.96.1238470774185; Mon, 30 Mar 2009 20:39:34 -0700 (PDT) In-Reply-To: <412bdbff0903301957i77c36f10hcb9e9cb919124057@mail.gmail.com> References: <15ed362e0903301947rf0de73eo8edbd8cbcd5b5abd@mail.gmail.com> <412bdbff0903301957i77c36f10hcb9e9cb919124057@mail.gmail.com> Date: Tue, 31 Mar 2009 11:39:34 +0800 Message-ID: <15ed362e0903302039g6d9575cnca5d9b62b566db72@mail.gmail.com> Subject: Re: XC5000 DVB-T/DMB-TH support From: David Wong To: Devin Heitmueller Cc: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Tue, Mar 31, 2009 at 10:57 AM, Devin Heitmueller wrote: > On Mon, Mar 30, 2009 at 10:47 PM, David Wong wrote: >> Does anyone know how to get XC5000 working for DVB-T, especially 8MHz bandwidth? >> Current driver only supports ATSC with 6MHz bandwidth only. >> It seems there is a trick at setting compensated RF frequency. >> >> DVB-T 8MHz support would probably works for DMB-TH, but DMB-TH >> settings is very welcome. >> >> Regards, >> David >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-media" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at  http://vger.kernel.org/majordomo-info.html >> > > All of my xc5000 work has been with ATSC/QAM, so I can't say > authoritatively what is required to make it work. > > Well, at a minimum you will have to modify xc5000_set_params to > support setting priv->video_standard to DTV8.  Beyond that, I don't > think you need to do anything specific for DVB-T. > > Devin > > -- > Devin J. Heitmueller > http://www.devinheitmueller.com > AIM: devinheitmueller > I have tried followings in xc5000_set_params() if (fe->ops.info.type == FE_ATSC) { ... } else if (fe->ops.info.type == FE_OFDM) { switch (params->u.ofdm.bandwidth) { case BANDWIDTH_6_MHZ: printk("xc5000 bandwidth 6MHz\n"); priv->bandwidth = BANDWIDTH_6_MHZ; priv->video_standard = DTV6; break; case BANDWIDTH_7_MHZ: printk("xc5000 bandwidth 7MHz\n"); priv->bandwidth = BANDWIDTH_7_MHZ; priv->video_standard = DTV7; break; case BANDWIDTH_8_MHZ: printk("xc5000 bandwidth 8MHz\n"); priv->bandwidth = BANDWIDTH_8_MHZ; priv->video_standard = DTV8; break; default: printk("xc5000 bandwidth not set!\n"); return -EINVAL; } priv->rf_mode = XC_RF_MODE_AIR; priv->freq_hz = params->frequency - 1750000; } But no success yet. I am wondering the -1750000 compensation for DTV8. BTW, The xc_debug_dump() could get more information like firmware build number and tuner total gain More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r 2276e777f950 linux/drivers/media/common/tuners/xc5000.c --- a/linux/drivers/media/common/tuners/xc5000.c Thu Mar 26 22:17:48 2009 -0300 +++ b/linux/drivers/media/common/tuners/xc5000.c Mon Mar 30 16:23:11 2009 +0800 @@ -84,6 +84,7 @@ #define XREG_IF_OUT 0x05 #define XREG_SEEK_MODE 0x07 #define XREG_POWER_DOWN 0x0A +#define XREG_OUTPUT_AMP 0x0B #define XREG_SIGNALSOURCE 0x0D /* 0=Air, 1=Cable */ #define XREG_SMOOTHEDCVBS 0x0E #define XREG_XTALFREQ 0x0F @@ -100,6 +101,8 @@ #define XREG_VERSION 0x07 #define XREG_PRODUCT_ID 0x08 #define XREG_BUSY 0x09 +#define XREG_BUILD_NUM 0x0D +#define XREG_TOTAL_GAIN 0x0F /* Basic firmware description. This will remain with @@ -468,7 +485,8 @@ static int xc_get_version(struct xc5000_priv *priv, u8 *hw_majorversion, u8 *hw_minorversion, - u8 *fw_majorversion, u8 *fw_minorversion) + u8 *fw_majorversion, u8 *fw_minorversion, + u16 *fw_buildnum) { u16 data; int result; @@ -481,6 +499,11 @@ (*hw_minorversion) = (data >> 8) & 0x0F; (*fw_majorversion) = (data >> 4) & 0x0F; (*fw_minorversion) = data & 0x0F; + + result = xc_read_reg(priv, XREG_BUILD_NUM, &data); + if (result) + return result; + *fw_buildnum = data; return 0; } @@ -506,6 +529,11 @@ static int xc_get_quality(struct xc5000_priv *priv, u16 *quality) { return xc_read_reg(priv, XREG_QUALITY, quality); +} + +static int xc_get_total_gain(struct xc5000_priv *priv, u16 *gain) +{ + return xc_read_reg(priv, XREG_TOTAL_GAIN, gain); } static u16 WaitForLock(struct xc5000_priv *priv) @@ -626,8 +654,10 @@ u32 hsync_freq_hz = 0; u16 frame_lines; u16 quality; + u16 gain; u8 hw_majorversion = 0, hw_minorversion = 0; u8 fw_majorversion = 0, fw_minorversion = 0; + u16 fw_buildnum = 0; /* Wait for stats to stabilize. * Frame Lines needs two frame times after initial lock @@ -646,10 +676,11 @@ lock_status); xc_get_version(priv, &hw_majorversion, &hw_minorversion, - &fw_majorversion, &fw_minorversion); - dprintk(1, "*** HW: V%02x.%02x, FW: V%02x.%02x\n", + &fw_majorversion, &fw_minorversion, &fw_buildnum); + dprintk(1, "*** HW: V%02x.%02x, FW: V%02x.%02x build %d\n", hw_majorversion, hw_minorversion, - fw_majorversion, fw_minorversion); + fw_majorversion, fw_minorversion, + fw_buildnum); xc_get_hsync_freq(priv, &hsync_freq_hz); dprintk(1, "*** Horizontal sync frequency = %d Hz\n", hsync_freq_hz); @@ -659,6 +690,9 @@ xc_get_quality(priv, &quality); dprintk(1, "*** Quality (0:<8dB, 7:>56dB) = %d\n", quality); + + xc_get_total_gain(priv, &gain); + dprintk(1, "*** Total Gain = %d mdB\n", gain * 1000 / 256); } -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org