patch-2.3.50 linux/drivers/char/bttv.h

Next file: linux/drivers/char/console.c
Previous file: linux/drivers/char/bttv.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.49/linux/drivers/char/bttv.h linux/drivers/char/bttv.h
@@ -21,45 +21,67 @@
 #ifndef _BTTV_H_
 #define _BTTV_H_
 
-#define BTTV_VERSION_CODE 0x00070d
+#define BTTV_VERSION_CODE KERNEL_VERSION(0,7,21) 
 
 #include <linux/types.h>
 #include <linux/wait.h>
+#include <linux/videodev.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 
 #include "audiochip.h"
 #include "bt848.h"
 
+#define WAIT_QUEUE                 wait_queue_head_t
 
-/* experimental, interface might change */
-#ifndef VIDIOCSWIN2
-#define VIDIOCSWIN2 _IOW('v',28,struct video_window2)
-struct video_window2
-{
-	__u16   palette;                /* Palette (aka video format) in use */
-	__u32   start;                  /* start address, relative to video_buffer.base */
-	__u32   pitch;
-	__u32   width;
-	__u32   height;
-	__u32   flags;
-	
-	struct	video_clip *clips;
-	int	clipcount;
-};
-#endif
-
+/* returns card type, 
+   for possible values see lines below beginning with #define BTTV_UNKNOWN
+   returns negative value if error ocurred 
+*/
+extern int bttv_get_id(unsigned int card);
+
+/* sets GPOE register (BT848_GPIO_OUT_EN) to new value:
+   data | (current_GPOE_value & ~mask)
+   returns negative value if error ocurred
+*/
+extern int bttv_gpio_enable(unsigned int card,
+			    unsigned long mask, unsigned long data);
+
+/* fills data with GPDATA register contents
+   returns negative value if error ocurred
+*/
+extern int bttv_read_gpio(unsigned int card, unsigned long *data);
+
+/* sets GPDATA register to new value:
+  (data & mask) | (current_GPDATA_value & ~mask)
+  returns negative value if error ocurred 
+*/
+extern int bttv_write_gpio(unsigned int card, 
+			    unsigned long mask, unsigned long data);
+
+/* returns pointer to task queue which can be used as parameter to 
+   interruptible_sleep_on
+   in interrupt handler if BT848_INT_GPINT bit is set - this queue is activated
+   (wake_up_interruptible) and following call to the function bttv_read_gpio 
+   should return new value of GPDATA,
+   returns NULL value if error ocurred or queue is not available
+   WARNING: because there is no buffer for GPIO data, one MUST 
+   process data ASAP
+*/
+extern WAIT_QUEUE* bttv_get_gpio_queue(unsigned int card);
 
-#define WAIT_QUEUE                 wait_queue_head_t
 
 #ifndef O_NONCAP  
 #define O_NONCAP	O_TRUNC
 #endif
 
-#define MAX_GBUFFERS	2
+#define MAX_GBUFFERS	64
 #define RISCMEM_LEN	(32744*2)
 #define VBI_MAXLINES    16
 #define VBIBUF_SIZE     (2048*VBI_MAXLINES*2)
 
 #define BTTV_MAX_FBUF	0x208000
+#define I2C_CLIENTS_MAX 8
 
 #ifdef __KERNEL__
 
@@ -69,17 +91,12 @@
 	ushort width, height;
 	ushort bpp, bpl;
 	ushort swidth, sheight;
-	short cropx, cropy;
-	ushort cropwidth, cropheight;
 	unsigned long vidadr;
 	ushort freq;
 	int norm;
 	int interlace;
 	int color_fmt;
 	ushort depth;
-
-	int use_yuv;
-	struct video_window2 win2;
 };
 
 struct bttv_pll_info {
@@ -89,7 +106,21 @@
 	unsigned int pll_current;  /* Currently programmed ofreq */
 };
 
-#define I2C_CLIENTS_MAX 8
+struct bttv_gbuf {
+	int stat;
+#define GBUFFER_UNUSED       0
+#define GBUFFER_GRABBING     1
+#define GBUFFER_DONE         2
+#define GBUFFER_ERROR        3
+
+	u16 width;
+	u16 height;
+	u16 fmt;
+	
+	u32 *risc;
+	unsigned long ro;
+	unsigned long re;
+};
 
 struct bttv
 {
@@ -125,6 +156,7 @@
   
 	unsigned char *vbibuf;
 	struct bttv_window win;
+	int fb_color_ctl;
 	int type;            /* card type  */
 	int audio;           /* audio mode */
 	int audio_chip;      /* set to one of the chips supported by bttv.c */
@@ -141,34 +173,18 @@
 	WAIT_QUEUE capqe;
 	int vbip;
 
-	u32 *risc_odd;
-	u32 *risc_even;
-	int cap;
+	u32 *risc_scr_odd;
+	u32 *risc_scr_even;
+	u32 risc_cap_odd;
+	u32 risc_cap_even;
+	int scr_on;
+	int vbi_on;
 	struct video_clip *cliprecs;
 
-	struct gbuffer *ogbuffers;
-	struct gbuffer *egbuffers;
-	u16 gwidth, gheight, gfmt;
-	u16 gwidth_next, gheight_next, gfmt_next;
-	u32 *grisc;
-	
-	unsigned long gro;
-	unsigned long gre;
-	unsigned long gro_next;
-	unsigned long gre_next;
-
-        int grf,grf_next;  /* frame numbers in grab queue */
-        int frame_stat[MAX_GBUFFERS];
-#define GBUFFER_UNUSED       0
-#define GBUFFER_GRABBING     1
-#define GBUFFER_DONE         2
-
+	struct bttv_gbuf *gbuf;
+	int gqueue[MAX_GBUFFERS];
+	int gq_in,gq_out,gq_grab;
         char *fbuffer;
-	int gmode;
-	int grabbing;
-	int lastgrab;
-	int grab;
-	int grabcount;
 
 	struct bttv_pll_info pll;
 	unsigned int Fsc;
@@ -176,12 +192,12 @@
 	unsigned int last_field; /* number of last grabbed field */
 	int i2c_command;
 	int triton1;
+
+	WAIT_QUEUE gpioq;
+	int shutdown;
 };
 #endif
 
-/*The following should be done in more portable way. It depends on define
-  of _ALPHA_BTTV in the Makefile.*/
-
 #if defined(__powerpc__) /* big-endian */
 extern __inline__ void io_st_le32(volatile unsigned *addr, unsigned val)
 {
@@ -193,14 +209,9 @@
 #define btwrite(dat,adr)  io_st_le32((unsigned *)(btv->bt848_mem+(adr)),(dat))
 #define btread(adr)       ld_le32((unsigned *)(btv->bt848_mem+(adr)))
 #else
-#ifdef _ALPHA_BTTV
-#define btwrite(dat,adr)    writel((dat),(char *) (btv->bt848_adr+(adr)))
-#define btread(adr)         readl(btv->bt848_adr+(adr))
-#else
 #define btwrite(dat,adr)    writel((dat), (char *) (btv->bt848_mem+(adr)))
 #define btread(adr)         readl(btv->bt848_mem+(adr))
 #endif
-#endif
 
 #define btand(dat,adr)      btwrite((dat) & btread(adr), adr)
 #define btor(dat,adr)       btwrite((dat) | btread(adr), adr)
@@ -243,10 +254,19 @@
 #define BTTV_PHOEBE_TVMAS  0x16
 #define BTTV_MODTEC_205    0x17
 #define BTTV_MAGICTVIEW061 0x18
-
+#define BTTV_VOBIS_BOOSTAR 0x19
+#define BTTV_HAUPPAUG_WCAM 0x1a
 #define BTTV_MAXI          0x1b
 #define BTTV_TERRATV       0x1c
 #define BTTV_PXC200        0x1d
+#define BTTV_FLYVIDEO_98   0x1e
+#define BTTV_IPROTV        0x1f
+#define BTTV_INTEL_C_S_PCI 0x20
+#define BTTV_TERRATVALUE   0x21
+#define BTTV_WINFAST2000   0x22
+#define BTTV_CHRONOS_VS2   0x23
+#define BTTV_TYPHOON_TVIEW 0x24
+#define BTTV_PXELVWPLTVPRO 0x25
 
 
 #define AUDIO_TUNER        0x00
@@ -279,27 +299,6 @@
 #define TDA9840_STADJ      0x03
 #define TDA9840_TEST       0x04
 
-#define TDA9850_CON1       0x04
-#define TDA9850_CON2       0x05
-#define TDA9850_CON3       0x06
-#define TDA9850_CON4       0x07
-#define TDA9850_ALI1       0x08
-#define TDA9850_ALI2       0x09
-#define TDA9850_ALI3       0x0a
-
-#define TDA8425_VL         0x00
-#define TDA8425_VR         0x01
-#define TDA8425_BA         0x02
-#define TDA8425_TR         0x03
-#define TDA8425_S1         0x08
- 
-#define TEA6300_VL         0x00		/* volume control left */
-#define TEA6300_VR         0x01		/* volume control right */
-#define TEA6300_BA         0x02		/* bass control */
-#define TEA6300_TR         0x03		/* treble control */
-#define TEA6300_FA         0x04		/* fader control */
-#define TEA6300_SW         0x05		/* mute and source switch */
-
 #define PT2254_L_CHANEL 0x10
 #define PT2254_R_CHANEL 0x08
 #define PT2254_DBS_IN_2 0x400
@@ -309,3 +308,9 @@
 #define WINVIEW_PT2254_STROBE 0x80
 
 #endif
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)