Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-10 Thread David Engel
On Mon, Sep 10, 2007 at 12:12:01PM -0500, David Engel wrote:
  Unfortunately, this does not allow for REVERSING the input selection -- 
  this will only force it to use one or the other in digital mode.  If 
  anybody has some ideas as to how to reverse the default selection in a 
  clean way, I am open to suggestions.
 
 The attached patch, is completely untested (I didn't even try
 compiling it), but it should be close.

Take two, with the patch.

David
-- 
David Engel
[EMAIL PROTECTED]
diff -r b7fa7c4598ac linux/drivers/media/dvb/frontends/dvb-pll.c
--- a/linux/drivers/media/dvb/frontends/dvb-pll.c	Sun Sep 09 12:00:45 2007 -0400
+++ b/linux/drivers/media/dvb/frontends/dvb-pll.c	Mon Sep 10 11:58:50 2007 -0500
@@ -49,9 +49,9 @@ module_param(debug, int, 0644);
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, enable verbose debug messages);
 
-static unsigned int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 };
+static int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 };
 module_param_array(input, int, NULL, 0644);
-MODULE_PARM_DESC(input,specify rf input choice, 0 for autoselect (default));
+MODULE_PARM_DESC(input,specify rf input choice, 0 for autoselect (default), -1 for autoselect reversed);
 
 static unsigned int id[DVB_PLL_MAX] =
 	{ [ 0 ... (DVB_PLL_MAX-1) ] = DVB_PLL_UNDEFINED };
@@ -399,9 +399,10 @@ static void tuv1236d_rf(struct dvb_front
 			const struct dvb_frontend_parameters *params)
 {
 	struct dvb_pll_priv *priv = fe-tuner_priv;
-	unsigned int new_rf = input[priv-nr];
-
-	if ((new_rf == 0) || (new_rf  2)) {
+	int new_rf = input[priv-nr];
+
+	if ((new_rf = 0) || (new_rf  2)) {
+		int reverse = (new_rf == -1);
 		switch (params-u.vsb.modulation) {
 			case QAM_64:
 			case QAM_256:
@@ -411,6 +412,8 @@ static void tuv1236d_rf(struct dvb_front
 			default:
 new_rf = 2;
 		}
+		if (reverse)
+			new_rf = 3 - new_rf;
 	}
 
 	switch (new_rf) {
@@ -856,6 +859,9 @@ struct dvb_frontend *dvb_pll_attach(stru
 			printk( %d-%04x, i2c_adapter_id(i2c), pll_addr);
 		printk(: tuner rf input will be );
 		switch (input[priv-nr]) {
+		case -1:
+			printk(autoselected reversed\n);
+			break;
 		case 0:
 			printk(autoselected\n);
 			break;
___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-10 Thread Michael Krufky
David Engel wrote:
 On Mon, Sep 10, 2007 at 12:12:01PM -0500, David Engel wrote:
   
 Unfortunately, this does not allow for REVERSING the input selection -- 
 this will only force it to use one or the other in digital mode.  If 
 anybody has some ideas as to how to reverse the default selection in a 
 clean way, I am open to suggestions.
   
 The attached patch, is completely untested (I didn't even try
 compiling it), but it should be close.
 

 Take two, with the patch.

   
David,

This is the same thing I did in my tree, but just didn't push it to the
repository.

This would work, but it doesn't cover all possible cases.  For instance,
what if there was a tuner with three rf inputs?  I don't think that such
a device exists on any supported hardware, but you never know.

This solution is fine with me, for the meanwhile... if you could test
it, would be nice :-)

-Mike

 diff -r b7fa7c4598ac linux/drivers/media/dvb/frontends/dvb-pll.c
 --- a/linux/drivers/media/dvb/frontends/dvb-pll.c Sun Sep 09 12:00:45 
 2007 -0400
 +++ b/linux/drivers/media/dvb/frontends/dvb-pll.c Mon Sep 10 11:58:50 
 2007 -0500
 @@ -49,9 +49,9 @@ module_param(debug, int, 0644);
  module_param(debug, int, 0644);
  MODULE_PARM_DESC(debug, enable verbose debug messages);
  
 -static unsigned int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 };
 +static int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 };
  module_param_array(input, int, NULL, 0644);
 -MODULE_PARM_DESC(input,specify rf input choice, 0 for autoselect 
 (default));
 +MODULE_PARM_DESC(input,specify rf input choice, 0 for autoselect (default), 
 -1 for autoselect reversed);
  
  static unsigned int id[DVB_PLL_MAX] =
   { [ 0 ... (DVB_PLL_MAX-1) ] = DVB_PLL_UNDEFINED };
 @@ -399,9 +399,10 @@ static void tuv1236d_rf(struct dvb_front
   const struct dvb_frontend_parameters *params)
  {
   struct dvb_pll_priv *priv = fe-tuner_priv;
 - unsigned int new_rf = input[priv-nr];
 -
 - if ((new_rf == 0) || (new_rf  2)) {
 + int new_rf = input[priv-nr];
 +
 + if ((new_rf = 0) || (new_rf  2)) {
 + int reverse = (new_rf == -1);
   switch (params-u.vsb.modulation) {
   case QAM_64:
   case QAM_256:
 @@ -411,6 +412,8 @@ static void tuv1236d_rf(struct dvb_front
   default:
   new_rf = 2;
   }
 + if (reverse)
 + new_rf = 3 - new_rf;
   }
  
   switch (new_rf) {
 @@ -856,6 +859,9 @@ struct dvb_frontend *dvb_pll_attach(stru
   printk( %d-%04x, i2c_adapter_id(i2c), pll_addr);
   printk(: tuner rf input will be );
   switch (input[priv-nr]) {
 + case -1:
 + printk(autoselected reversed\n);
 + break;
   case 0:
   printk(autoselected\n);
   break;
   


___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-10 Thread David Engel
On Mon, Sep 10, 2007 at 03:04:32PM -0400, Michael Krufky wrote:
 This is the same thing I did in my tree, but just didn't push it to the
 repository.
 
 This would work, but it doesn't cover all possible cases.  For instance,
 what if there was a tuner with three rf inputs?  I don't think that such
 a device exists on any supported hardware, but you never know.

Yes, devices with three or more inputs would be really troublesome
this way.  An alternative would be to have separate modules parameters
per modulation type.  Instead of dvb_pll taking an input parameter, it
could, for example, take qam_input and vsb_input parameters.  That
could work as long as the number of modulation types doesn't grow much
more.

 This solution is fine with me, for the meanwhile... if you could test
 it, would be nice :-)

I will, but it take a few to serveral days.

David
-- 
David Engel
[EMAIL PROTECTED]

___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-09 Thread Michael Krufky
Eric,

Eric Sandeen wrote:
 Michael Krufky wrote:
   
 For now, the only thing that I'm asking you to test is whether you are
 able to switch the input selection using the module option.
 
 Works for me.  for dvb_pll, input=1 on the ATSC-110 is the same as what
 I get with no options, i.e. the bottom connector.  input=2 gives me the
 top connector.
   
:-) Thanks for testing!
 Would a printk about which input is being used for each card at startup
 time be useful?

Yes.  I added it to the tree.  Please pull from:

http://linuxtv.org/hg/~mkrufky/dvb-pll


Regards,

Mike

___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-08 Thread Eric Sandeen
Michael Krufky wrote:

 Please provide some feedback after testing this tree.  The changes in 
 question are:
 
 http://linuxtv.org/hg/~mkrufky/dvb-pll
 
 - dvb-pll: pass fe pointer into dvb_pll_configure() and set() functions
 - dvb-pll: store instance ID in dvb_pll_priv structure
 - dvb-pll: add module option to specify rf input
 - dvb-pll: add module option to force dvb-pll desc id (for debug use only)

it's 1am so not doing a whole lot, but set up all modules from that
repo, and my mythbox came up happy with the QAM input working on the
bottom connector of my Kworld ATSC-110.  I'll try the option to switch
them tomorrow  anything else you'd like me to test with this card?

Thanks,
-Eric

___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-08 Thread Michael Krufky
Eric Sandeen wrote:
 Michael Krufky wrote:

   
 Please provide some feedback after testing this tree.  The changes in 
 question are:

 http://linuxtv.org/hg/~mkrufky/dvb-pll

 - dvb-pll: pass fe pointer into dvb_pll_configure() and set() functions
 - dvb-pll: store instance ID in dvb_pll_priv structure
 - dvb-pll: add module option to specify rf input
 - dvb-pll: add module option to force dvb-pll desc id (for debug use only)
 

 it's 1am so not doing a whole lot, but set up all modules from that
 repo, and my mythbox came up happy with the QAM input working on the
 bottom connector of my Kworld ATSC-110.  I'll try the option to switch
 them tomorrow  anything else you'd like me to test with this card?

Eric,

For now, the only thing that I'm asking you to test is whether you are
able to switch the input selection using the module option.

Thanks,

Mike

___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


Re: [linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-08 Thread Eric Sandeen
Michael Krufky wrote:

 Eric,
 
 For now, the only thing that I'm asking you to test is whether you are
 able to switch the input selection using the module option.

Works for me.  for dvb_pll, input=1 on the ATSC-110 is the same as what
I get with no options, i.e. the bottom connector.  input=2 gives me the
top connector.

Would a printk about which input is being used for each card at startup
time be useful?

-Eric

___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


[linux-dvb] [RFC] TUV1236d / dvb-pll: rf input switching via module option

2007-09-07 Thread Michael Krufky
David Engel wrote:
 The standard driver as of Linux v2.6.21 does analog and 8VSB
 on the top input and QAM on the bottom input.  My desired behavior is
 analog and QAM on one input and 8VSB on the other.  No problem.  It
 was an easy enough driver hack to make it do what I wanted.
 
 Others might be interested in this change too, so is there any
 willingness from the core DVB maintainers to accept a patch to make
 this configurable via a module parameter?  If so, would you like one
 global setting for all cards or one setting for each card?



I know I took a while with this... I was working on tuner refactoring and 
didn't have time.

Meanwhile, if we do any kind of module option for rf input selection, it must 
be one setting for each card.


Please test the following mercurial tree:

http://linuxtv.org/hg/~mkrufky/dvb-pll

After building  installing the new modules, do:

modinfo dvb-pll

...to view the new module options.

If you have only one card in the system, you may do:


modprobe dvb-pll input=1

... then:

modprobe cx88-dvb

-or-

modprobe saa7134-dvb


After doing the above, your card will use input #1 regardless of whether you 
are using VSB or QAM.

If, however, you have multiple cards in the system, and the ATSC11[05] / HDTV 
Wonder is the second DVB card, then instead do:


modprobe dvb-pll input=0,2


...to specify that the dvb-pll module should autoselect the input used for the 
first card, and use input #2 for the second card.

Unfortunately, this does not allow for REVERSING the input selection -- this 
will only force it to use one or the other in digital mode.  If anybody has 
some ideas as to how to reverse the default selection in a clean way, I am open 
to suggestions.

If this works correctly, (and I have no doubt that it will) I can add the same 
option to the tuner-simple module, to allow the user to choose the rf input 
used for analog tv as well.

Please also note:

Pass debug=1 to dvb-pll, in order for dvb-pll to show you the instance ID of 
the tuv1236d.  If you have multiple cards in the system, this will be helpful 
to determine the order of the input option array to pass via modprobe.

debug output will look like this:

[ 3023.695903] dvb-pll[0] 0-0061: id# 11 (LG TDVS-H06xF) attached, autodetected

I also added a module option to force dvb-pll to use a dvb_pll_desc other than 
the one picked by default.  This is useful in some cases, where the vendor may 
release an alternate revision of the hardware using a different tuner, but 
without changing the pci subsystem / usb device ids.  This option should be 
used for debugging purposes, ONLY.

Please provide some feedback after testing this tree.  The changes in question 
are:

http://linuxtv.org/hg/~mkrufky/dvb-pll

- dvb-pll: pass fe pointer into dvb_pll_configure() and set() functions
- dvb-pll: store instance ID in dvb_pll_priv structure
- dvb-pll: add module option to specify rf input
- dvb-pll: add module option to force dvb-pll desc id (for debug use only)

 dvb-pll.c |  145 +-
 1 file changed, 102 insertions(+), 43 deletions(-)

Cheers,

Mike Krufky

___
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb