public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028
@ 2011-08-01 14:55 jean.bruenn
  0 siblings, 0 replies; 8+ messages in thread
From: jean.bruenn @ 2011-08-01 14:55 UTC (permalink / raw)
  To: x-alina; +Cc: linux-media


Hey,

thanks Mauro, thanks Alina, my DVB-T Card started to work again, too.

Jean

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v3] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028
@ 2011-07-22 18:35 Alina Friedrichsen
  2011-07-27 14:34 ` Mauro Carvalho Chehab
  2011-07-28 19:38 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 8+ messages in thread
From: Alina Friedrichsen @ 2011-07-22 18:35 UTC (permalink / raw)
  To: linux-media; +Cc: rglowery

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 <x-alina@gmx.net>
---
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 20:15:08.212540252 +0200
@@ -54,6 +54,11 @@
 MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
 				"default firmware name\n");
 
+static int freq_magic;
+module_param(freq_magic, int, 0644);
+MODULE_PARM_DESC(freq_magic, "Selects the frequency adjustment code "
+			     "for XC3028. Set it to 1 if tuning fails.");
+
 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 <rglowery@exemail.com.au>
-		 */
-
-		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 (!freq_magic) {
+			/*
+			 * The proper adjustment would be to do it at s-code
+			 * table. However, this didn't work, as reported by
+			 * Robert Lowery <rglowery@exemail.com.au>
+			 */
 
-		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;


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-01 14:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 14:55 [PATCH v3] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028 jean.bruenn
  -- strict thread matches above, loose matches on Subject: below --
2011-07-22 18:35 Alina Friedrichsen
2011-07-27 14:34 ` Mauro Carvalho Chehab
2011-07-27 14:58   ` Devin Heitmueller
2011-07-27 15:50     ` Mauro Carvalho Chehab
2011-07-27 16:06     ` Mauro Carvalho Chehab
2011-07-28 19:38 ` Mauro Carvalho Chehab
2011-07-29  6:49   ` Alina Friedrichsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox