From patchwork Fri Jul 22 16:05:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alina Friedrichsen X-Patchwork-Id: 999882 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6MGBP3G007169 for ; Fri, 22 Jul 2011 16:11:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751883Ab1GVQFU (ORCPT ); Fri, 22 Jul 2011 12:05:20 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:48942 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750927Ab1GVQFT (ORCPT ); Fri, 22 Jul 2011 12:05:19 -0400 Received: (qmail 12573 invoked by uid 0); 22 Jul 2011 16:05:17 -0000 Received: from 217.140.74.94 by www003.gmx.net with HTTP; Fri, 22 Jul 2011 18:05:14 +0200 (CEST) Date: Fri, 22 Jul 2011 18:05:14 +0200 From: "Alina Friedrichsen" Message-ID: <20110722160514.169940@gmx.net> MIME-Version: 1.0 Subject: [PATCH] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028 To: linux-media@vger.kernel.org X-Authenticated: #24363424 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+Q4fIjYa6QeciLr4vCmsV42j8wqS6YoKossVpGLt OUKrsta92GWz3upOoEMJ+m4GkmSIT3ik+umQ== X-GMX-UID: jq0eeQs7bGInO9m3HmVn69JvcmZ1Zly8 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 22 Jul 2011 16:11:27 +0000 (UTC) Since many, many kernel releases my Hauppauge WinTV HVR-1400 doesn't work anymore, and nobody feels responsible to fix it. The code to get it work is still in there, it's only commented out. My patch to enable it was rejected, because somebody had fear that it could break other cards. So here is a new patch, that allows you to select the frequency adjustment code by a module parameter. Default is the old code, so it can't break anything. Signed-off-by: Alina Friedrichsen --- -- 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 diff -urN linux-3.0.orig/drivers/media/common/tuners/tuner-xc2028.c linux-3.0/drivers/media/common/tuners/tuner-xc2028.c --- linux-3.0.orig/drivers/media/common/tuners/tuner-xc2028.c 2011-07-22 04:17:23.000000000 +0200 +++ linux-3.0/drivers/media/common/tuners/tuner-xc2028.c 2011-07-22 16:30:54.280668772 +0200 @@ -54,6 +54,11 @@ MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the " "default firmware name\n"); +static int frequency_magic; +module_param(frequency_magic, int, 0644); +MODULE_PARM_DESC(frequency_magic, "selects the adjustment code for XC3028 to " + "properly centralize the frequency"); + static LIST_HEAD(hybrid_tuner_instance_list); static DEFINE_MUTEX(xc2028_list_mutex); @@ -967,34 +972,36 @@ * 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 - /* - * Still need tests for XC3028L (firmware 3.2 or upper) - * So, for now, let's just comment the per-firmware - * version of this change. Reports with xc3028l working - * with and without the lines bellow are welcome - */ + if (!frequency_magic) { + /* + * The proper adjustment would be to do it at s-code + * table. However, this didn't work, as reported by + * Robert Lowery + */ - if (priv->firm_version < 0x0302) { if (priv->cur_fw.type & DTV7) offset += 500000; + } else { - if (priv->cur_fw.type & DTV7) - offset -= 300000; - else if (type != ATSC) /* DVB @6MHz, DTV 8 and DTV 7/8 */ - offset += 200000; + /* + * Still need tests for XC3028L (firmware 3.2 or upper) + * So, for now, let's just comment the per-firmware + * version of this change. Reports with xc3028l working + * with and without the lines bellow are welcome + */ + + if (priv->firm_version < 0x0302) { + if (priv->cur_fw.type & DTV7) + offset += 500000; + } else { + if (priv->cur_fw.type & DTV7) + offset -= 300000; + else if (type != ATSC) { + /* DVB @6MHz, DTV 8 and DTV 7/8 */ + offset += 200000; + } + } } -#endif } div = (freq - offset + DIV / 2) / DIV;