[pvrusb2] [PATCH] pvrusb2: make default frequency configurable via modprobe option

Michael Krufky mkrufky at linuxtv.org
Sun May 11 12:54:01 CDT 2008


Mike,

Please review & merge this patch (attached), if you agree with it.

-or-

Please pull from:

http://linuxtv.org/hg/~mkrufky/pvrusb2

for:

- pvrusb2: make default frequency configurable via modprobe option

 pvrusb2-hdw.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

---

# HG changeset patch
# User Michael Krufky <mkrufky at linuxtv.org>
# Date 1210523870 14400
# Node ID 1148bbb6604a57af2f3980e3f1750108bf12aa76
# Parent d876384888805da67d5cde770f8dd43bd269fad7
pvrusb2: make default frequency configurable via modprobe option

From: Michael Krufky <mkrufky at linuxtv.org>

The pvrusb2 driver initially sets the tuner to known broadcast frequencies
in the Chicago area, to ease driver testing for the maintainer.

This patch keeps those default frequencies, but allows them to be altered
via modprobe option.  This allows the same ease and convenience for testing
multiple pvrusb2 devices one after another under other conditions and areas.

For instance, the default initial frequency, 175.25 MHz, might not
necessarily be valid on all cable television networks, but usually will be a
valid NTSC broadcast channel.

Signed-off-by: Michael Krufky <mkrufky at linuxtv.org>

--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c	Thu May 01 03:23:23 2008 -0400
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c	Sun May 11 12:37:50 2008 -0400
@@ -67,6 +67,16 @@ MODULE_PARM_DESC(video_std,"specify init
 MODULE_PARM_DESC(video_std,"specify initial video standard");
 module_param_array(tolerance,    int, NULL, 0444);
 MODULE_PARM_DESC(tolerance,"specify stream error tolerance");
+
+/* US Broadcast channel 7 (175.25 MHz) */
+static int default_tv_freq    = 175250000L;
+/* 104.3 MHz, a usable FM station for my area */
+static int default_radio_freq = 104300000L;
+
+module_param_named(tv_freq, default_tv_freq, int, 0444);
+MODULE_PARM_DESC(tv_freq, "specify initial television frequency");
+module_param_named(radio_freq, default_radio_freq, int, 0444);
+MODULE_PARM_DESC(radio_freq, "specify initial radio frequency");
 
 #define PVR2_CTL_WRITE_ENDPOINT  0x01
 #define PVR2_CTL_READ_ENDPOINT   0x81
@@ -1718,10 +1728,8 @@ static void pvr2_hdw_setup_low(struct pv
 	   are, but I set them to something usable in the Chicago area just
 	   to make driver testing a little easier. */
 
-	/* US Broadcast channel 7 (175.25 MHz) */
-	hdw->freqValTelevision = 175250000L;
-	/* 104.3 MHz, a usable FM station for my area */
-	hdw->freqValRadio = 104300000L;
+	hdw->freqValTelevision = default_tv_freq;
+	hdw->freqValRadio = default_radio_freq;
 
 	// Do not use pvr2_reset_ctl_endpoints() here.  It is not
 	// thread-safe against the normal pvr2_send_request() mechanism.



More information about the pvrusb2 mailing list