The patch number 8642 was added via Steven Toth <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Steven Toth  <[EMAIL PROTECTED]>
cx23885: Factor out common cx23885 tuner callback


Tuners currently hook different things to the private pointer in their
callback function. Longer term we should make that private pointer
consistent, but for now separate out the guts of the cx23885 tuner callback
so we can reuse it.

Signed-off-by: Steven Toth <[EMAIL PROTECTED]>
Signed-off-by: Anton Blanchard <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/cx23885/cx23885-cards.c |   22 ++++++++------
 linux/drivers/media/video/cx23885/cx23885-dvb.c   |    4 +-
 linux/drivers/media/video/cx23885/cx23885.h       |    2 -
 3 files changed, 16 insertions(+), 12 deletions(-)

diff -r 48b7f1e48d8f -r 58d874c29f06 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 18:18:27 
2008 -0300
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:36:49 
2008 -0400
@@ -320,13 +320,9 @@ static void hauppauge_eeprom(struct cx23
                        dev->name, tv.model);
 }
 
-/* Tuner callback function for cx23885 boards. Currently only needed
- * for HVR1500Q, which has an xc5000 tuner.
- */
-int cx23885_tuner_callback(void *priv, int command, int arg)
-{
-       struct cx23885_i2c *bus = priv;
-       struct cx23885_dev *dev = bus->dev;
+static int cx23885_tuner_callback(struct cx23885_dev *dev, int port,
+                                 int command, int arg)
+{
        u32 bitmask = 0;
 
        if (command != 0) {
@@ -346,9 +342,9 @@ int cx23885_tuner_callback(void *priv, i
 
                        /* Two identical tuners on two different i2c buses,
                         * we need to reset the correct gpio. */
-                       if (bus->nr == 0)
+                       if (port == 0)
                                bitmask = 0x01;
-                       else if (bus->nr == 1)
+                       else if (port == 1)
                                bitmask = 0x04;
                }
                break;
@@ -362,6 +358,14 @@ int cx23885_tuner_callback(void *priv, i
        }
 
        return 0;
+}
+
+int cx23885_xc5000_tuner_callback(void *priv, int command, int arg)
+{
+       struct cx23885_i2c *bus = priv;
+       struct cx23885_dev *dev = bus->dev;
+
+       return cx23885_tuner_callback(dev, bus->nr, command, arg);
 }
 
 void cx23885_gpio_setup(struct cx23885_dev *dev)
diff -r 48b7f1e48d8f -r 58d874c29f06 
linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 18:18:27 
2008 -0300
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 20:36:49 
2008 -0400
@@ -189,13 +189,13 @@ static struct xc5000_config hauppauge_hv
 static struct xc5000_config hauppauge_hvr1500q_tunerconfig = {
        .i2c_address      = 0x61,
        .if_khz           = 5380,
-       .tuner_callback   = cx23885_tuner_callback
+       .tuner_callback   = cx23885_xc5000_tuner_callback,
 };
 
 static struct xc5000_config dvico_xc5000_tunerconfig = {
        .i2c_address      = 0x64,
        .if_khz           = 5380,
-       .tuner_callback   = cx23885_tuner_callback
+       .tuner_callback   = cx23885_xc5000_tuner_callback,
 };
 
 static struct tda829x_config tda829x_no_probe = {
diff -r 48b7f1e48d8f -r 58d874c29f06 linux/drivers/media/video/cx23885/cx23885.h
--- a/linux/drivers/media/video/cx23885/cx23885.h       Mon Aug 04 18:18:27 
2008 -0300
+++ b/linux/drivers/media/video/cx23885/cx23885.h       Mon Aug 04 20:36:49 
2008 -0400
@@ -410,7 +410,7 @@ extern struct cx23885_subid cx23885_subi
 extern struct cx23885_subid cx23885_subids[];
 extern const unsigned int cx23885_idcount;
 
-extern int cx23885_tuner_callback(void *priv, int command, int arg);
+extern int cx23885_xc5000_tuner_callback(void *priv, int command, int arg);
 extern void cx23885_card_list(struct cx23885_dev *dev);
 extern int  cx23885_ir_init(struct cx23885_dev *dev);
 extern void cx23885_gpio_setup(struct cx23885_dev *dev);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/58d874c29f06372f85b0b72bb389a9888556ba8f

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to