The patch number 8643 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]>
Switch Hauppauge HVR1400 and HVR1500 to common cx23885 tuner callback


The Hauppauge HVR1400 and HVR1500 can now use the common cx23885 tuner
callback.

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


---

 linux/drivers/media/video/cx23885/cx23885-cards.c |   16 ++++++
 linux/drivers/media/video/cx23885/cx23885-dvb.c   |   34 --------------
 linux/drivers/media/video/cx23885/cx23885.h       |    1 
 3 files changed, 18 insertions(+), 33 deletions(-)

diff -r 58d874c29f06 -r c2ad00518e83 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:36:49 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:38:46 
2008 -0400
@@ -27,6 +27,7 @@
 
 #include "compat.h"
 #include "cx23885.h"
+#include "tuner-xc2028.h"
 
 /* ------------------------------------------------------------------ */
 /* board config info                                                  */
@@ -332,8 +333,10 @@ static int cx23885_tuner_callback(struct
        }
 
        switch(dev->board) {
+       case CX23885_BOARD_HAUPPAUGE_HVR1400:
+       case CX23885_BOARD_HAUPPAUGE_HVR1500:
        case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
-               /* Tuner Reset Command from xc5000 */
+               /* Tuner Reset Command */
                if (command == 0)
                        bitmask = 0x04;
                break;
@@ -366,6 +369,17 @@ int cx23885_xc5000_tuner_callback(void *
        struct cx23885_dev *dev = bus->dev;
 
        return cx23885_tuner_callback(dev, bus->nr, command, arg);
+}
+
+int cx23885_xc3028_tuner_callback(void *priv, int command, int arg)
+{
+       struct cx23885_tsport *port = priv;
+       struct cx23885_dev *dev = port->dev;
+
+       if (command == XC2028_RESET_CLK)
+               return 0;
+
+       return cx23885_tuner_callback(dev, port->nr, command, arg);
 }
 
 void cx23885_gpio_setup(struct cx23885_dev *dev)
diff -r 58d874c29f06 -r c2ad00518e83 
linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 20:36:49 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 20:38:46 
2008 -0400
@@ -303,36 +303,6 @@ static struct dib7000p_config hauppauge_
 
        .output_mode = OUTMODE_MPEG2_SERIAL,
 };
-
-static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg)
-{
-       struct cx23885_tsport *port = ptr;
-       struct cx23885_dev *dev = port->dev;
-
-       switch (command) {
-       case XC2028_TUNER_RESET:
-               /* Send the tuner in then out of reset */
-               /* GPIO-2 xc3028 tuner */
-               dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __func__, arg);
-
-               cx_set(GP0_IO, 0x00040000);
-               cx_clear(GP0_IO, 0x00000004);
-               msleep(5);
-
-               cx_set(GP0_IO, 0x00040004);
-               msleep(5);
-               break;
-       case XC2028_RESET_CLK:
-               dprintk(1, "%s: XC2028_RESET_CLK %d\n", __func__, arg);
-               break;
-       default:
-               dprintk(1, "%s: unknown command %d, arg %d\n", __func__,
-                       command, arg);
-               return -EINVAL;
-       }
-
-       return 0;
-}
 
 static int dvb_register(struct cx23885_tsport *port)
 {
@@ -427,7 +397,7 @@ static int dvb_register(struct cx23885_t
                        struct xc2028_config cfg = {
                                .i2c_adap  = &i2c_bus->i2c_adap,
                                .i2c_addr  = 0x61,
-                               .callback  = cx23885_hvr1500_xc3028_callback,
+                               .callback  = cx23885_xc3028_tuner_callback,
                        };
                        static struct xc2028_ctrl ctl = {
                                .fname       = "xc3028-v27.fw",
@@ -466,7 +436,7 @@ static int dvb_register(struct cx23885_t
                        struct xc2028_config cfg = {
                                .i2c_adap  = &dev->i2c_bus[1].i2c_adap,
                                .i2c_addr  = 0x64,
-                               .callback  = cx23885_hvr1500_xc3028_callback,
+                               .callback  = cx23885_xc3028_tuner_callback,
                        };
                        static struct xc2028_ctrl ctl = {
                                .fname   = "xc3028L-v36.fw",
diff -r 58d874c29f06 -r c2ad00518e83 linux/drivers/media/video/cx23885/cx23885.h
--- a/linux/drivers/media/video/cx23885/cx23885.h       Mon Aug 04 20:36:49 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885.h       Mon Aug 04 20:38:46 
2008 -0400
@@ -411,6 +411,7 @@ extern const unsigned int cx23885_idcoun
 extern const unsigned int cx23885_idcount;
 
 extern int cx23885_xc5000_tuner_callback(void *priv, int command, int arg);
+extern int cx23885_xc3028_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/c2ad00518e836521f00e557eed923213a73dd150

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

Reply via email to