V4L/DVB: tm6000: fix some info messages
[safe/jmp/linux-2.6] / drivers / staging / tm6000 / tm6000-core.c
index 7ec13d5..bf40aa8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   tm6000-core.c - driver for TM5600/TM6000 USB video capture devices
+   tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices
 
    Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
 
@@ -24,7 +24,6 @@
 #include <linux/kernel.h>
 #include <linux/usb.h>
 #include <linux/i2c.h>
-#include <linux/video_decoder.h>
 #include "tm6000.h"
 #include "tm6000-regs.h"
 #include <media/v4l2-common.h>
@@ -109,6 +108,7 @@ int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index)
                tm6000_read_write_usb (dev, USB_DIR_OUT | USB_TYPE_VENDOR,
                                       req, value, index, NULL, 0);
 }
+EXPORT_SYMBOL_GPL(tm6000_set_reg);
 
 int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index)
 {
@@ -123,6 +123,7 @@ int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index)
 
        return *buf;
 }
+EXPORT_SYMBOL_GPL(tm6000_get_reg);
 
 int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index)
 {
@@ -415,6 +416,13 @@ struct reg_init tm6010_init_tab[] = {
 
        { REQ_05_SET_GET_USBREG, 0x18, 0x00 },
 
+       { REQ_07_SET_GET_AVREG, 0xdc, 0xaa },
+       { REQ_07_SET_GET_AVREG, 0xdd, 0x30 },
+       { REQ_07_SET_GET_AVREG, 0xde, 0x20 },
+       { REQ_07_SET_GET_AVREG, 0xdf, 0xd0 },
+       { REQ_04_EN_DISABLE_MCU_INT, 0x02, 0x00 },
+       { REQ_07_SET_GET_AVREG, 0xd8, 0x2f },
+
        /* set remote wakeup key:any key wakeup */
        { REQ_07_SET_GET_AVREG,  0xe5,  0xfe },
        { REQ_07_SET_GET_AVREG,  0xda,  0xff },
@@ -454,54 +462,9 @@ int tm6000_init (struct tm6000_core *dev)
                printk (KERN_ERR "Error %i while retrieving board version\n",board);
        }
 
-       if (dev->dev_type == TM6010) {
-               /* Turn xceive 3028 on */
-               tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6010_GPIO_3, 0x01);
-               msleep(11);
-       }
-
-       /* Reset GPIO1 and GPIO4. */
-       for (i=0; i< 2; i++) {
-               rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-                                       dev->tuner_reset_gpio, 0x00);
-               if (rc<0) {
-                       printk (KERN_ERR "Error %i doing GPIO1 reset\n",rc);
-                       return rc;
-               }
+       rc = tm6000_cards_setup(dev);
 
-               msleep(10); /* Just to be conservative */
-               rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-                                       dev->tuner_reset_gpio, 0x01);
-               if (rc<0) {
-                       printk (KERN_ERR "Error %i doing GPIO1 reset\n",rc);
-                       return rc;
-               }
-
-               msleep(10);
-               rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_4, 0);
-               if (rc<0) {
-                       printk (KERN_ERR "Error %i doing GPIO4 reset\n",rc);
-                       return rc;
-               }
-
-               msleep(10);
-               rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_4, 1);
-               if (rc<0) {
-                       printk (KERN_ERR "Error %i doing GPIO4 reset\n",rc);
-                       return rc;
-               }
-
-               if (!i) {
-                       rc=tm6000_get_reg16(dev, 0x40,0,0);
-                       if (rc>=0) {
-                               printk ("board=%d\n", rc);
-                       }
-               }
-       }
-
-       msleep(50);
-
-       return 0;
+       return rc;
 }
 
 int tm6000_set_audio_bitrate(struct tm6000_core *dev, int bitrate)