Re: [PULL] http://kernellabs.com/hg/~mkrufky/k2c2

2009-06-16 Thread Michael Krufky

Michael Krufky wrote:

Mauro Carvalho Chehab wrote:

Em Tue, 16 Jun 2009 11:19:29 -0400
Michael Krufky mkru...@linuxtv.org escreveu:

 

Mauro,

Please pull from:

http://kernellabs.com/hg/~mkrufky/k2c2

for:

- cx23885: override set_frontend to allow rf input path switching on 
the HVR1275


 cx23885-dvb.c |   29 +
 cx23885.h |2 ++
 2 files changed, 31 insertions(+)

Hopefully, you can get this into the next merge window with all the
other pending changesets ;-)

Thanks  regards,

Mike




 

Use separate RF input spigots for Antennae and Cable.

Priority: normal

Reviewed-by: Steven Toth st...@kernellabs.com
Signed-off-by: Michael Krufky mkru...@kernellabs.com

--- a/linux/drivers/media/video/cx23885/cx23885-dvb.cTue May 12 
17:53:47 2009 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.cFri May 08 
21:39:24 2009 -0400

@@ -417,6 +417,30 @@
 .demod_address = 0x05,
 };
 
+static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,

+struct dvb_frontend_parameters *param)
+{
+struct cx23885_tsport *port = fe-dvb-priv;
+struct cx23885_dev *dev = port-dev;
+
+switch (dev-board) {
+case CX23885_BOARD_HAUPPAUGE_HVR1275:
+switch (param-u.vsb.modulation) {
+case VSB_8:
+cx23885_gpio_clear(dev, GPIO_5);
+break;
+case QAM_64:
+case QAM_256:
+default:
+cx23885_gpio_set(dev, GPIO_5);
+break;
+}
+break;
+}
+return (port-set_frontend_save) ?
+port-set_frontend_save(fe, param) : -ENODEV;
+}
+
 static int dvb_register(struct cx23885_tsport *port)
 {
 struct cx23885_dev *dev = port-dev;
@@ -456,6 +480,11 @@
0x60, dev-i2c_bus[1].i2c_adap,
hauppauge_hvr127x_config);
 }
+
+/* define bridge override to set_frontend */
+port-set_frontend_save = fe0-dvb.frontend-ops.set_frontend;
+fe0-dvb.frontend-ops.set_frontend = 
cx23885_dvb_set_frontend;

+
 break;
 case CX23885_BOARD_HAUPPAUGE_HVR1255:
 i2c_bus = dev-i2c_bus[0];
--- a/linux/drivers/media/video/cx23885/cx23885.hTue May 12 
17:53:47 2009 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885.hFri May 08 
21:39:24 2009 -0400

@@ -288,6 +288,8 @@
 /* Allow a single tsport to have multiple frontends */
 u32num_frontends;
 void   *port_priv;
+int (*set_frontend_save) (struct dvb_frontend *,
+  struct dvb_frontend_parameters *);
 };
 
 struct cx23885_dev {





Argh! this looks like a hack! Don't you have a better approach for it?



I have a better approach that I plan to push for the next kernel.  
This is planned for 2.6.31, for 2.6.32 I have a better method that 
will be genericly used for all drivers.


I plan to post an RFC about the new method after the merge window closes.

Can you merge this for now, and the new, better method can be saved 
for the next devel cycle?


I'd just like to add a point:

The method used in this patch is the same method currently used inside 
the dib0700 driver (grep for set_param_save in struct dib0700_adapter_state)


This is the minimal patch for the current merge window -- I'd like to 
merge this one for now, and when the merge window closes, I will issue 
the RFC for the new, better method, while converting dib0700 and cx23885 
both to use this new better method.


Once that is done, this sort of thing will be much clearer and easier to 
accomplish across other drivers in the susbsystem tree.


I have added a FIXME comment as per your request...

Please pull from:

http://kernellabs.com/hg/~mkrufky/k2c2

for the following:

- cx23885: override set_frontend to allow rf input path switching on the 
HVR1275

- cx23885: add FIXME comment above set_frontend override

cx23885-dvb.c |   30 ++
cx23885.h |4 
2 files changed, 34 insertions(+)

Cheers,

Mike


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://kernellabs.com/hg/~mkrufky/k2c2

2009-06-16 Thread Michael Krufky

Mauro Carvalho Chehab wrote:

Em Tue, 16 Jun 2009 11:19:29 -0400
Michael Krufky mkru...@linuxtv.org escreveu:

  

Mauro,

Please pull from:

http://kernellabs.com/hg/~mkrufky/k2c2

for:

- cx23885: override set_frontend to allow rf input path switching on the HVR1275

 cx23885-dvb.c |   29 +
 cx23885.h |2 ++
 2 files changed, 31 insertions(+)

Hopefully, you can get this into the next merge window with all the
other pending changesets ;-)

Thanks  regards,

Mike




  

Use separate RF input spigots for Antennae and Cable.

Priority: normal

Reviewed-by: Steven Toth st...@kernellabs.com
Signed-off-by: Michael Krufky mkru...@kernellabs.com

--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c   Tue May 12 17:53:47 
2009 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c   Fri May 08 21:39:24 
2009 -0400
@@ -417,6 +417,30 @@
.demod_address = 0x05,
 };
 
+static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,

+   struct dvb_frontend_parameters *param)
+{
+   struct cx23885_tsport *port = fe-dvb-priv;
+   struct cx23885_dev *dev = port-dev;
+
+   switch (dev-board) {
+   case CX23885_BOARD_HAUPPAUGE_HVR1275:
+   switch (param-u.vsb.modulation) {
+   case VSB_8:
+   cx23885_gpio_clear(dev, GPIO_5);
+   break;
+   case QAM_64:
+   case QAM_256:
+   default:
+   cx23885_gpio_set(dev, GPIO_5);
+   break;
+   }
+   break;
+   }
+   return (port-set_frontend_save) ?
+   port-set_frontend_save(fe, param) : -ENODEV;
+}
+
 static int dvb_register(struct cx23885_tsport *port)
 {
struct cx23885_dev *dev = port-dev;
@@ -456,6 +480,11 @@
   0x60, dev-i2c_bus[1].i2c_adap,
   hauppauge_hvr127x_config);
}
+
+   /* define bridge override to set_frontend */
+   port-set_frontend_save = fe0-dvb.frontend-ops.set_frontend;
+   fe0-dvb.frontend-ops.set_frontend = cx23885_dvb_set_frontend;
+
break;
case CX23885_BOARD_HAUPPAUGE_HVR1255:
i2c_bus = dev-i2c_bus[0];
--- a/linux/drivers/media/video/cx23885/cx23885.h   Tue May 12 17:53:47 
2009 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885.h   Fri May 08 21:39:24 
2009 -0400
@@ -288,6 +288,8 @@
/* Allow a single tsport to have multiple frontends */
u32num_frontends;
void   *port_priv;
+   int (*set_frontend_save) (struct dvb_frontend *,
+ struct dvb_frontend_parameters *);
 };
 
 struct cx23885_dev {





Argh! this looks like a hack! Don't you have a better approach for it?



I have a better approach that I plan to push for the next kernel.  This 
is planned for 2.6.31, for 2.6.32 I have a better method that will be 
genericly used for all drivers.


I plan to post an RFC about the new method after the merge window closes.

Can you merge this for now, and the new, better method can be saved for 
the next devel cycle?


Thanks  Regards,

Mike
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://kernellabs.com/hg/~mkrufky/k2c2

2009-06-16 Thread Trent Piepho
On Tue, 16 Jun 2009, Mauro Carvalho Chehab wrote:
 Em Tue, 16 Jun 2009 11:19:29 -0400
 Michael Krufky mkru...@linuxtv.org escreveu:
  +static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
  +   struct dvb_frontend_parameters *param)

You could make this an HVR1275 specific function and then do away with the
first case statement.  With a name like cx23885_dvb_set_frontend() it
appears that all boards will use it, when it is only ever called with an
HVR1275.

  +   switch (param-u.vsb.modulation) {
  +   case VSB_8:
  +   cx23885_gpio_clear(dev, GPIO_5);
  +   break;
  +   case QAM_64:
  +   case QAM_256:
  +   default:
  +   cx23885_gpio_set(dev, GPIO_5);
  +   break;

Using the modulation to switch inputs is of course a hack, needed because
the dvb api lacks a concept of multiple inputs.  I do not know if any still
exist, but there were cable systems which broadcast with both QAM and VS.


 Argh! this looks like a hack! Don't you have a better approach for it?

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://kernellabs.com/hg/~mkrufky/k2c2

2009-06-16 Thread Michael Krufky
On Tue, Jun 16, 2009 at 7:59 PM, Trent Piephoxy...@speakeasy.org wrote:
 On Tue, 16 Jun 2009, Mauro Carvalho Chehab wrote:
 Em Tue, 16 Jun 2009 11:19:29 -0400
 Michael Krufky mkru...@linuxtv.org escreveu:
  +static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
  +                               struct dvb_frontend_parameters *param)

 You could make this an HVR1275 specific function and then do away with the
 first case statement.  With a name like cx23885_dvb_set_frontend() it
 appears that all boards will use it, when it is only ever called with an
 HVR1275.

Actually, it *will* be used by other boards.  For now it is
HVR1275-specific.  The other changes will come after the close of the
merge window.


  +           switch (param-u.vsb.modulation) {
  +           case VSB_8:
  +                   cx23885_gpio_clear(dev, GPIO_5);
  +                   break;
  +           case QAM_64:
  +           case QAM_256:
  +           default:
  +                   cx23885_gpio_set(dev, GPIO_5);
  +                   break;

 Using the modulation to switch inputs is of course a hack, needed because
 the dvb api lacks a concept of multiple inputs.  I do not know if any still
 exist, but there were cable systems which broadcast with both QAM and VS.

By design on this board, VSB uses one input, QAM uses the other.

Cheers,

Mike
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html