V4L/DVB (8773): cx18: Fix cx18_find_handle() and add error checking
[safe/jmp/linux-2.6] / drivers / media / video / bt8xx / bttvp.h
index ad79b8d..b4d940b 100644 (file)
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 #include <linux/videodev.h>
-#include <media/v4l2-common.h>
 #include <linux/pci.h>
 #include <linux/input.h>
 #include <linux/mutex.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <asm/io.h>
-
+#include <media/v4l2-common.h>
 #include <linux/device.h>
-#include <media/video-buf.h>
-#include <media/tuner.h>
+#include <media/videobuf-dma-sg.h>
 #include <media/tveeprom.h>
 #include <media/ir-common.h>
 
 /* Limits scaled width, which must be a multiple of 4. */
 #define MAX_HACTIVE (0x3FF & -4)
 
-#define clamp(x, low, high) min (max (low, x), high)
-
+#define BTTV_NORMS    (\
+               V4L2_STD_PAL    | V4L2_STD_PAL_N | \
+               V4L2_STD_PAL_Nc | V4L2_STD_SECAM | \
+               V4L2_STD_NTSC   | V4L2_STD_PAL_M | \
+               V4L2_STD_PAL_60)
 /* ---------------------------------------------------------- */
 
 struct bttv_tvnorm {
@@ -112,7 +113,6 @@ extern const struct bttv_tvnorm bttv_tvnorms[];
 
 struct bttv_format {
        char *name;
-       int  palette;         /* video4linux 1      */
        int  fourcc;          /* video4linux 2      */
        int  btformat;        /* BT848_COLOR_FMT_*  */
        int  btswap;          /* BT848_COLOR_CTL_*  */
@@ -253,20 +253,23 @@ int bttv_overlay_risc(struct bttv *btv, struct bttv_overlay *ov,
 /* ---------------------------------------------------------- */
 /* bttv-vbi.c                                                 */
 
-int bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_vbi_format *f);
-void bttv_vbi_get_fmt(struct bttv_fh *fh, struct v4l2_vbi_format *f);
-int bttv_vbi_set_fmt(struct bttv_fh *fh, struct v4l2_vbi_format *f);
+int bttv_try_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f);
+int bttv_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f);
+int bttv_s_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f);
 
 extern struct videobuf_queue_ops bttv_vbi_qops;
 
 /* ---------------------------------------------------------- */
 /* bttv-gpio.c */
 
-
 extern struct bus_type bttv_sub_bus_type;
 int bttv_sub_add_device(struct bttv_core *core, char *name);
 int bttv_sub_del_devices(struct bttv_core *core);
 
+/* ---------------------------------------------------------- */
+/* bttv-cards.c                                               */
+
+extern int no_overlay;
 
 /* ---------------------------------------------------------- */
 /* bttv-driver.c                                              */
@@ -284,8 +287,8 @@ extern int fini_bttv_i2c(struct bttv *btv);
 #define d2printk if (bttv_debug >= 2) printk
 
 #define BTTV_MAX_FBUF   0x208000
-#define BTTV_TIMEOUT    (HZ/2) /* 0.5 seconds */
-#define BTTV_FREE_IDLE  (HZ)   /* one second */
+#define BTTV_TIMEOUT    msecs_to_jiffies(500)    /* 0.5 seconds */
+#define BTTV_FREE_IDLE  msecs_to_jiffies(1000)   /* one second */
 
 
 struct bttv_pll_info {
@@ -337,7 +340,9 @@ struct bttv {
        /* old gpio interface */
        wait_queue_head_t gpioq;
        int shutdown;
-       void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set);
+
+       void (*volume_gpio)(struct bttv *btv, __u16 volume);
+       void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set);
 
        /* new gpio interface */
        spinlock_t gpio_lock;
@@ -434,6 +439,9 @@ struct bttv {
        unsigned int users;
        struct bttv_fh init;
 
+       /* used to make dvb-bt8xx autoloadable */
+       struct work_struct request_module_wk;
+
        /* Default (0) and current (1) video capturing and overlay
           cropping parameters in bttv_tvnorm.cropcap units. Protected
           by bttv.lock. */
@@ -455,10 +463,6 @@ struct bttv {
 extern unsigned int bttv_num;
 extern struct bttv bttvs[BTTV_MAX];
 
-/* private ioctls */
-#define BTTV_VERSION            _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
-#define BTTV_VBISIZE            _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
-
 #endif
 
 #define btwrite(dat,adr)    writel((dat), btv->bt848_mmio+(adr))