V4L/DVB: Rework for support xc5000
[safe/jmp/linux-2.6] / drivers / staging / tm6000 / tm6000.h
index b4b6032..b49c139 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   tm6000.h - driver for TM5600/TM6000 USB video capture devices
+   tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices
 
    Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
 
@@ -37,7 +37,7 @@
 #include "dvb_frontend.h"
 #include "dmxdev.h"
 
-#define TM6000_VERSION KERNEL_VERSION(0, 0, 1)
+#define TM6000_VERSION KERNEL_VERSION(0, 0, 2)
 
 /* Inputs */
 
@@ -103,6 +103,16 @@ enum tm6000_mode {
        TM6000_MODE_DIGITAL,
 };
 
+struct tm6000_gpio {
+       int             tuner_reset;
+       int             tuner_on;
+       int             demod_reset;
+       int             demod_on;
+       int             power_led;
+       int             dvb_led;
+       int             ir;
+};
+
 struct tm6000_capabilities {
        unsigned int    has_tuner:1;
        unsigned int    has_tda9874:1;
@@ -122,6 +132,13 @@ struct tm6000_dvb {
        struct mutex            mutex;
 };
 
+struct tm6000_endpoint {
+       struct usb_host_endpoint        *endp;
+       __u8                            bInterfaceNumber;
+       __u8                            bAlternateSetting;
+       unsigned                        maxsize;
+};
+
 struct tm6000_core {
        /* generic device properties */
        char                            name[30];       /* name (including minor) of the device */
@@ -140,7 +157,8 @@ struct tm6000_core {
        /* Tuner configuration */
        int                             tuner_type;             /* type of the tuner */
        int                             tuner_addr;             /* tuner address */
-       int                             tuner_reset_gpio;       /* GPIO used for tuner reset */
+
+       struct tm6000_gpio              gpio;
 
        /* Demodulator configuration */
        int                             demod_addr;     /* demodulator address */
@@ -175,9 +193,7 @@ struct tm6000_core {
        /* usb transfer */
        struct usb_device               *udev;          /* the usb device */
 
-       struct usb_host_endpoint        *bulk_in, *bulk_out, *isoc_in, *isoc_out;
-       unsigned int                    max_bulk_in, max_bulk_out;
-       unsigned int                    max_isoc_in, max_isoc_out;
+       struct tm6000_endpoint          bulk_in, bulk_out, isoc_in, isoc_out;
 
        /* scaler!=0 if scaler is active*/
        int                             scaler;
@@ -206,11 +222,16 @@ struct tm6000_fh {
 /* In tm6000-cards.c */
 
 int tm6000_tuner_callback (void *ptr, int component, int command, int arg);
+int tm6000_xc5000_callback (void *ptr, int component, int command, int arg);
+int tm6000_cards_setup(struct tm6000_core *dev);
+
 /* In tm6000-core.c */
 
 int tm6000_read_write_usb (struct tm6000_core *dev, u8 reqtype, u8 req,
                           u16 value, u16 index, u8 *buf, u16 len);
 int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index);
+int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index);
+int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index);
 int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index);
 int tm6000_init (struct tm6000_core *dev);