From patchwork Thu Dec 8 13:00:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gianluca Gennari X-Patchwork-Id: 8744 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RYda9-0000Bf-UH; Thu, 08 Dec 2011 14:00:14 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1RYda8-0000uP-Cf; Thu, 08 Dec 2011 14:00:13 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751197Ab1LHNAJ (ORCPT + 4 others); Thu, 8 Dec 2011 08:00:09 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:39160 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836Ab1LHNAI (ORCPT ); Thu, 8 Dec 2011 08:00:08 -0500 Received: by eekd41 with SMTP id d41so1147121eek.19 for ; Thu, 08 Dec 2011 05:00:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=gz8NmiZD02gNJVV9hHMOsEketVQba9Ri0Fn1zCwgqRY=; b=XpJe0W7evbmZ67IBEOXEI0euUgkJtW6w2cEFw9ct8Y2mKOjvyab/SCu4fg8e1zmkiK EuGBppLM0w4ACj6K+RSTNh64pL9BLuUsjZydkKfADEfsXtT3RLWhbRr3dqXIDfR4yXYL K0tc+ZHj10uKzo+cHTED8bubNzWOMzwGeyRx0= Received: by 10.14.18.94 with SMTP id k70mr219109eek.228.1323349207230; Thu, 08 Dec 2011 05:00:07 -0800 (PST) Received: from [192.168.2.3] (93-50-34-119.ip150.fastwebnet.it. [93.50.34.119]) by mx.google.com with ESMTPS id d6sm17594652eec.10.2011.12.08.05.00.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Dec 2011 05:00:06 -0800 (PST) Message-ID: <4EE0B4D4.2020909@gmail.com> Date: Thu, 08 Dec 2011 14:00:04 +0100 From: Gianluca Gennari Reply-To: gennarone@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 To: linux-media@vger.kernel.org CC: Mauro Carvalho Chehab Subject: Re: [PATCH 1/1] xc3028: fix center frequency calculation for DTV78 firmware References: <4EE0B419.3070604@gmail.com> In-Reply-To: <4EE0B419.3070604@gmail.com> X-Enigmail-Version: 1.1.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.8.124819 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' FORGED_FROM_GMAIL 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FRAUD_WEBMAIL_REPLYTO 0, __FROM_GMAIL 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' X-LSpam-Score: -6.9 (------) X-LSpam-Report: No, score=-6.9 required=5.0 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, T_DKIM_INVALID=0.01 autolearn=ham Updated center frequency calculation to fix VHF band reception with firmware DTV78. The adjustment for DTV78 is not needed anymore with new firmwares, since the offset is not depending anymore on the bandwidth or the firmware version (at least for DTV7, DTV8, DTV78). Signed-off-by: Gianluca Gennari --- drivers/media/common/tuners/tuner-xc2028.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) * xc3028 additional "magic" @@ -979,17 +985,13 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, * newer firmwares */ -#if 1 /* * The proper adjustment would be to do it at s-code table. * However, this didn't work, as reported by * Robert Lowery */ - if (priv->cur_fw.type & DTV7) - offset += 500000; - -#else +#if 0 /* * Still need tests for XC3028L (firmware 3.2 or upper) * So, for now, let's just comment the per-firmware diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c index e531267..7653aca 100644 --- a/drivers/media/common/tuners/tuner-xc2028.c +++ b/drivers/media/common/tuners/tuner-xc2028.c @@ -962,14 +962,20 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, * For DTV 7/8, the firmware uses BW = 8000, so it needs a * further adjustment to get the frequency center on VHF */ + + /* + * The center frequency formula above seems no more correct. + * The adjustment for DTV78 is not needed anymore with new + * firmwares, since the offset is not depending anymore on the + * bandwidth or the firmware version (at least for DTV78). + * This is probably a consequence of the SCODE table adjustments + * mentioned in the comment below. + */ + if (priv->cur_fw.type & DTV6) offset = 1750000; - else if (priv->cur_fw.type & DTV7) - offset = 2250000; - else /* DTV8 or DTV78 */ + else /* DTV7 or DTV8 or DTV78 */ offset = 2750000; - if ((priv->cur_fw.type & DTV78) && freq < 470000000) - offset -= 500000; /*