/shark/trunk/drivers/bttv/include/drivers/gpio.h |
---|
File deleted |
/shark/trunk/drivers/bttv/include/drivers/compbttv.h |
---|
File deleted |
/shark/trunk/drivers/bttv/include/drivers/videodev.h |
---|
File deleted |
/shark/trunk/drivers/bttv/include/drivers/bt848.h |
---|
204,6 → 204,9 |
#define BT848_COLOR_FMT_YCrCb411 0x99 |
#define BT848_COLOR_FMT_RAW 0xee |
#define BT848_VTOTAL_LO 0xB0 |
#define BT848_VTOTAL_HI 0xB4 |
#define BT848_COLOR_CTL 0x0D8 |
#define BT848_COLOR_CTL_EXT_FRMRATE (1<<7) |
#define BT848_COLOR_CTL_COLOR_BARS (1<<6) |
279,6 → 282,10 |
#define BT848_GPIO_DMA_CTL_FIFO_ENABLE (1<<0) |
#define BT848_I2C 0x110 |
#define BT878_I2C_MODE (1<<7) |
#define BT878_I2C_RATE (1<<6) |
#define BT878_I2C_NOSTOP (1<<5) |
#define BT878_I2C_NOSTART (1<<4) |
#define BT848_I2C_DIV (0xf<<4) |
#define BT848_I2C_SYNC (1<<3) |
#define BT848_I2C_W3B (1<<2) |
285,7 → 292,6 |
#define BT848_I2C_SCL (1<<1) |
#define BT848_I2C_SDA (1<<0) |
#define BT848_RISC_STRT_ADD 0x114 |
#define BT848_GPIO_OUT_EN 0x118 |
#define BT848_GPIO_REG_INP 0x11C |
311,31 → 317,30 |
/* WRITE and SKIP */ |
/* disable which bytes of each DWORD */ |
#define BT848_RISC_BYTE0 (1<<12) |
#define BT848_RISC_BYTE1 (1<<13) |
#define BT848_RISC_BYTE2 (1<<14) |
#define BT848_RISC_BYTE3 (1<<15) |
#define BT848_RISC_BYTE_ALL (0x0f<<12) |
#define BT848_RISC_BYTE0 (1U<<12) |
#define BT848_RISC_BYTE1 (1U<<13) |
#define BT848_RISC_BYTE2 (1U<<14) |
#define BT848_RISC_BYTE3 (1U<<15) |
#define BT848_RISC_BYTE_ALL (0x0fU<<12) |
#define BT848_RISC_BYTE_NONE 0 |
/* cause RISCI */ |
#define BT848_RISC_IRQ (1<<24) |
#define BT848_RISC_IRQ (1U<<24) |
/* RISC command is last one in this line */ |
#define BT848_RISC_EOL (1<<26) |
#define BT848_RISC_EOL (1U<<26) |
/* RISC command is first one in this line */ |
#define BT848_RISC_SOL (1<<27) |
#define BT848_RISC_SOL (1U<<27) |
#define BT848_RISC_WRITE (0x01<<28) |
#define BT848_RISC_SKIP (0x02<<28) |
#define BT848_RISC_WRITEC (0x05<<28) |
#define BT848_RISC_JUMP (0x07<<28) |
#define BT848_RISC_SYNC (0x08<<28) |
#define BT848_RISC_WRITE (0x01U<<28) |
#define BT848_RISC_SKIP (0x02U<<28) |
#define BT848_RISC_WRITEC (0x05U<<28) |
#define BT848_RISC_JUMP (0x07U<<28) |
#define BT848_RISC_SYNC (0x08U<<28) |
#define BT848_RISC_WRITE123 (0x09<<28) |
#define BT848_RISC_SKIP123 (0x0a<<28) |
#define BT848_RISC_WRITE1S23 (0x0b<<28) |
#define BT848_RISC_WRITE123 (0x09U<<28) |
#define BT848_RISC_SKIP123 (0x0aU<<28) |
#define BT848_RISC_WRITE1S23 (0x0bU<<28) |
/* Bt848A and higher only !! */ |
#define BT848_TGLB 0x080 |
#define BT848_TGCTRL 0x084 |
347,6 → 352,8 |
#define BT848_PLL_X (1<<7) |
#define BT848_PLL_C (1<<6) |
#define BT848_DVSIF 0x0FC |
/* Bt878 register */ |
#define BT878_DEVCTRL 0x40 |
/shark/trunk/drivers/bttv/include/drivers/tuner.h |
---|
62,6 → 62,9 |
#define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099)*/ |
#define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746)*/ |
#define TUNER_LG_PAL_NEW_TAPC 37 |
#define TUNER_PHILIPS_FM1216ME_MK3 38 |
#define TUNER_LG_NTSC_NEW_TAPC 39 |
#define TUNER_HITACHI_NTSC 40 |
80,10 → 83,13 |
#define SHARP 6 |
#define Samsung 7 |
#define Microtune 8 |
#define HITACHI 9 |
#define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */ |
#define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */ |
#define TUNER_SET_RADIOFREQ _IOW('t',3,int) /* set radio freq */ |
#define TUNER_SET_MODE _IOW('t',4,int) /* set tuner mode */ |
#if 0 /* obsolete */ |
# define TUNER_SET_RADIOFREQ _IOW('t',3,int) /* set radio freq */ |
# define TUNER_SET_MODE _IOW('t',4,int) /* set tuner mode */ |
#endif |
#endif |
/shark/trunk/drivers/bttv/include/drivers/btcx-risc.h |
---|
0,0 → 1,33 |
struct btcx_riscmem { |
unsigned int size; |
u32 *cpu; |
u32 *jmp; |
dma_addr_t dma; |
}; |
struct btcx_skiplist { |
int start; |
int end; |
}; |
int btcx_riscmem_alloc(struct pci_dev *pci, |
struct btcx_riscmem *risc, |
unsigned int size); |
void btcx_riscmem_free(struct pci_dev *pci, |
struct btcx_riscmem *risc); |
int btcx_screen_clips(int swidth, int sheight, struct v4l2_rect *win, |
struct v4l2_clip *clips, unsigned int n); |
int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, |
unsigned int n, int mask); |
void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips); |
void btcx_calc_skips(int line, int width, unsigned int *maxy, |
struct btcx_skiplist *skips, unsigned int *nskips, |
const struct v4l2_clip *clips, unsigned int nclips); |
/* |
* Local variables: |
* c-basic-offset: 8 |
* End: |
*/ |
/shark/trunk/drivers/bttv/include/drivers/bttv.h |
---|
13,20 → 13,11 |
#ifndef _BTTV_H_ |
#define _BTTV_H_ |
#include <sys/types.h> |
#include "drivers/compbttv.h" |
#include <linux/videodev.h> |
#include "drivers/videodev.h" |
#include "linux/i2c.h" |
#include "linux/i2c-algo-bit.h" |
/* ---------------------------------------------------------- */ |
/* exported by bttv-cards.c */ |
#include "drivers/bt848.h" |
#include "drivers/audiochip.h" |
#include "drivers/gpio.h" |
#define I2C_CLIENTS_MAX 16 |
#define BTTV_UNKNOWN 0x00 |
#define BTTV_MIRO 0x01 |
#define BTTV_HAUPPAUGE 0x02 |
99,22 → 90,39 |
#define BTTV_SENSORAY311 0x49 |
#define BTTV_RV605 0x4a |
#define BTTV_WINDVR 0x4c |
#define BTTV_OSPREY1x0 0x4f |
#define BTTV_OSPREY1x0_848 0x50 |
#define BTTV_OSPREY101_848 0x51 |
#define BTTV_OSPREY1x1 0x52 |
#define BTTV_OSPREY1x1_SVID 0x53 |
#define BTTV_OSPREY2xx 0x54 |
#define BTTV_OSPREY2x0_SVID 0x55 |
#define BTTV_OSPREY2x0 0x56 |
#define BTTV_OSPREY5x0 0x57 |
#define BTTV_OSPREY2000 0x58 |
#define BTTV_OSPREY_BEGIN BTTV_OSPREY1x0 |
#define BTTV_OSPREY_END BTTV_OSPREY2000 |
#define BTTV_GRANDTEC 0x4d |
#define BTTV_KWORLD 0x4e |
#define BTTV_HAUPPAUGEPVR 0x50 |
#define BTTV_GVBCTV5PCI 0x51 |
#define BTTV_OSPREY1x0 0x52 |
#define BTTV_OSPREY1x0_848 0x53 |
#define BTTV_OSPREY101_848 0x54 |
#define BTTV_OSPREY1x1 0x55 |
#define BTTV_OSPREY1x1_SVID 0x56 |
#define BTTV_OSPREY2xx 0x57 |
#define BTTV_OSPREY2x0_SVID 0x58 |
#define BTTV_OSPREY2x0 0x59 |
#define BTTV_OSPREY500 0x5a |
#define BTTV_OSPREY540 0x5b |
#define BTTV_OSPREY2000 0x5c |
#define BTTV_IDS_EAGLE 0x5d |
#define BTTV_PINNACLESAT 0x5e |
#define BTTV_FORMAC_PROTV 0x5f |
#define BTTV_EURESYS_PICOLO 0x61 |
#define BTTV_PV150 0x62 |
#define BTTV_AD_TVK503 0x63 |
#define BTTV_IVC200 0x66 |
#define BTTV_XGUARD 0x67 |
#define BTTV_NEBULA_DIGITV 0x68 |
#define BTTV_PV143 0x69 |
#define BTTV_IVC100 0x6e |
#define BTTV_IVC120 0x6f |
/* i2c address list */ |
#define I2C_TSA5522 0xc2 |
#define I2C_TDA7432 0x8a |
#define I2C_BT832_ALT1 0x88 |
#define I2C_BT832_ALT2 0x8a // alternate setting |
#define I2C_TDA8425 0x82 |
#define I2C_TDA9840 0x84 |
#define I2C_TDA9850 0xb6 /* also used by 9855,9873 */ |
124,8 → 132,10 |
#define I2C_STBEE 0xae |
#define I2C_VHX 0xc0 |
#define I2C_MSP3400 0x80 |
#define I2C_MSP3400_ALT 0x88 |
#define I2C_TEA6300 0x80 |
#define I2C_DPL3518 0x84 |
#define I2C_TDA9887 0x86 |
/* more card-specific defines */ |
#define PT2254_L_CHANNEL 0x10 |
136,193 → 146,20 |
#define WINVIEW_PT2254_DATA 0x20 |
#define WINVIEW_PT2254_STROBE 0x80 |
#define dprintk if (bttv_debug) cprintf |
/* digital_mode */ |
#define DIGITAL_MODE_VIDEO 1 |
#define DIGITAL_MODE_CAMERA 2 |
/* Anybody who uses more than four? */ |
#define BTTV_MAX 4 |
extern int bttv_num; /* number of Bt848s in use */ |
extern struct bttv bttvs[BTTV_MAX]; |
struct bttv; |
#ifndef O_NONCAP |
#define O_NONCAP O_TRUNC |
#endif |
#ifdef VIDEODAT_HACK |
# define VBI_MAXLINES 19 |
#else |
# define VBI_MAXLINES 16 |
#endif |
#define VBIBUF_SIZE (2048*VBI_MAXLINES*2) |
#define MAX_GBUFFERS 64 |
#define RISCMEM_LEN (32744*2) |
#define BTTV_MAX_FBUF 0x208000 |
struct bttv_window |
{ |
int x, y; |
ushort width, height; |
ushort bpp, bpl; |
ushort swidth, sheight; |
unsigned long vidadr; |
ushort freq; |
int norm; |
int interlace; |
int color_fmt; |
ushort depth; |
}; |
struct bttv_pll_info { |
unsigned int pll_ifreq; /* PLL input frequency */ |
unsigned int pll_ofreq; /* PLL output frequency */ |
unsigned int pll_crystal; /* Crystal used for input */ |
unsigned int pll_current; /* Currently programmed ofreq */ |
}; |
struct bttv_gbuf { |
int stat; |
#define GBUFFER_UNUSED 0 |
#define GBUFFER_GRABBING 1 |
#define GBUFFER_DONE 2 |
#define GBUFFER_ERROR 3 |
struct timespec tv; |
u16 width; |
u16 height; |
u16 fmt; |
u32 *risc; |
unsigned long ro; |
unsigned long re; |
}; |
struct bttv { |
struct video_device video_dev; |
struct video_device radio_dev; |
struct video_device vbi_dev; |
struct video_picture picture; /* Current picture params */ |
struct video_audio audio_dev; /* Current audio params */ |
int user; |
int capuser; |
/* i2c */ |
struct i2c_adapter i2c_adap; |
struct i2c_algo_bit_data i2c_algo; |
struct i2c_client i2c_client; |
int i2c_state, i2c_rc; |
struct i2c_client *i2c_clients[I2C_CLIENTS_MAX]; |
int tuner_type; |
int channel; |
unsigned int nr; |
unsigned short id; |
unsigned char revision; |
unsigned long bt848_adr; /* bus address of IO mem returned by PCI BIOS */ |
struct pci_dev *dev; |
unsigned char *bt848_mem; /* ptr to mapped IO memory */ |
struct gpio_adapter gpio_adap; |
unsigned long busriscmem; |
u32 *riscmem; |
unsigned char *vbibuf; |
struct bttv_window win; |
int fb_color_ctl; |
int type; /* card type */ |
int cardid; |
int audio; /* audio mode */ |
int audio_chip; /* set to one of the chips supported by bttv.c */ |
int radio; |
int has_radio; |
/* miro/pinnacle + Aimslab VHX |
philips matchbox (tea5757 radio tuner) support */ |
int has_matchbox; |
int mbox_we; |
int mbox_data; |
int mbox_clk; |
int mbox_most; |
int mbox_mask; |
u32 *risc_jmp; |
u32 *vbi_odd; |
u32 *vbi_even; |
u32 bus_vbi_even; |
u32 bus_vbi_odd; |
int vbip; |
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 bttv_gbuf *gbuf; |
int gqueue[MAX_GBUFFERS]; |
int gq_in,gq_out,gq_grab,gq_start; |
char *fbuffer; |
struct bttv_pll_info pll; |
unsigned int Fsc; |
unsigned int field; |
unsigned int last_field; /* number of last grabbed field */ |
int i2c_command; |
int triton1; |
int errors; |
int needs_restart; |
int shutdown; |
}; |
/* insmod options / kernel args */ |
extern int no_overlay; |
extern unsigned int bttv_verbose; |
extern unsigned int bttv_debug; |
extern unsigned int bttv_gpio; |
extern void bttv_gpio_tracking(struct bttv *btv, char *comment); |
extern int init_bttv_i2c(struct bttv *btv); |
#define btwrite(dat,adr) *(unsigned long *) (btv->bt848_mem+(adr)) = (unsigned long)(dat) |
#define btread(adr) *(unsigned long *)(btv->bt848_mem+(adr)) |
#define btand(dat,adr) btwrite((dat) & btread(adr), adr) |
#define btor(dat,adr) btwrite((dat) | btread(adr), adr) |
#define btaor(dat,mask,adr) btwrite((dat) | ((mask) & btread(adr)), adr) |
#define gpiowrite(dat) gpio_set (&(btv->gpio_adap),dat) |
#define gpioread() btread(BT848_GPIO_DATA) |
#define gpioand(dat) gpio_and (&(btv->gpio_adap),dat) |
#define gpioor(dat) gpio_or (&(btv->gpio_adap),dat) |
#define gpioaor(dat,mask) gpio_andor(&(btv->gpio_adap),mask,dat) |
/* bttv ioctls */ |
#define BTTV_READEE _IOW('v', BASE_VIDIOCPRIVATE+0, char [256]) |
#define BTTV_WRITEE _IOR('v', BASE_VIDIOCPRIVATE+1, char [256]) |
#define BTTV_FIELDNR _IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int) |
#define BTTV_PLLSET _IOW('v' , BASE_VIDIOCPRIVATE+3, struct bttv_pll_info) |
#define BTTV_BURST_ON _IOR('v' , BASE_VIDIOCPRIVATE+4, int) |
#define BTTV_BURST_OFF _IOR('v' , BASE_VIDIOCPRIVATE+5, int) |
#define BTTV_VERSION _IOR('v' , BASE_VIDIOCPRIVATE+6, int) |
#define BTTV_PICNR _IOR('v' , BASE_VIDIOCPRIVATE+7, int) |
#define BTTV_VBISIZE _IOR('v' , BASE_VIDIOCPRIVATE+8, int) |
#define TDA9850 0x01 |
#define TDA9840 0x02 |
#define TDA8425 0x03 |
#define TEA6300 0x04 |
struct tvcard |
{ |
char *name; |
int video_inputs; |
int audio_inputs; |
int tuner; |
int svhs; |
unsigned int video_inputs; |
unsigned int audio_inputs; |
unsigned int tuner; |
unsigned int svhs; |
unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO |
u32 gpiomask; |
u32 muxsel[16]; |
u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ |
329,25 → 166,29 |
u32 gpiomask2; /* GPIO MUX mask */ |
/* i2c audio flags */ |
int no_msp34xx:1; |
int no_tda9875:1; |
int no_tda7432:1; |
int needs_tvaudio:1; |
unsigned int no_msp34xx:1; |
unsigned int no_tda9875:1; |
unsigned int no_tda7432:1; |
unsigned int needs_tvaudio:1; |
unsigned int msp34xx_alt:1; |
/* flag: video pci function is unused */ |
unsigned int no_video; |
/* other settings */ |
int pll; |
unsigned int pll; |
#define PLL_NONE 0 |
#define PLL_28 1 |
#define PLL_35 2 |
int tuner_type; |
int has_radio; |
unsigned int tuner_type; |
unsigned int has_radio; |
void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set); |
void (*muxsel_hook)(struct bttv *btv, unsigned int input); |
}; |
extern struct tvcard bttv_tvcards[]; |
extern const int bttv_num_tvcards; |
extern const unsigned int bttv_num_tvcards; |
/* identification / initialization of the card */ |
extern void bttv_idcard(struct bttv *btv); |
373,7 → 214,9 |
for possible values see lines below beginning with #define BTTV_UNKNOWN |
returns negative value if error occurred |
*/ |
extern int bttv_get_cardinfo(unsigned int card, int *type, int *cardid); |
extern int bttv_get_cardinfo(unsigned int card, int *type, |
unsigned int *cardid); |
extern struct pci_dev* bttv_get_pcidev(unsigned int card); |
/* obsolete, use bttv_get_cardinfo instead */ |
extern int bttv_get_id(unsigned int card); |
397,6 → 240,22 |
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 occurred or queue is not available |
WARNING: because there is no buffer for GPIO data, one MUST |
process data ASAP |
*/ |
extern wait_queue_head_t* bttv_get_gpio_queue(unsigned int card); |
/* call i2c clients |
*/ |
extern void bttv_i2c_call(unsigned int card, unsigned int cmd, void *arg); |
/* i2c */ |
extern void bttv_bit_setscl(void *data, int state); |
extern void bttv_bit_setsda(void *data, int state); |
406,7 → 265,9 |
unsigned char b2, int both); |
extern void bttv_readee(struct bttv *btv, unsigned char *eedata, int addr); |
struct pci_dev; |
extern struct bttv *bttv_find_matching_card( struct pci_dev *dev ); |
#endif /* _BTTV_H_ */ |
/* |
* Local variables: |
* c-basic-offset: 8 |
* End: |
*/ |
/shark/trunk/drivers/bttv/include/drivers/bttvp.h |
---|
0,0 → 1,399 |
/* |
bttv - Bt848 frame grabber driver |
bttv's *private* header file -- nobody other than bttv itself |
should ever include this file. |
(c) 2000-2002 Gerd Knorr <kraxel@bytesex.org> |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program; if not, write to the Free Software |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
*/ |
#ifndef _BTTVP_H_ |
#define _BTTVP_H_ |
#include <linux/version.h> |
#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,12) |
#include <linux/types.h> |
#include <linux/wait.h> |
#include <linux/i2c.h> |
#include <linux/i2c-algo-bit.h> |
#include <linux/videodev.h> |
#include <linux/pci.h> |
#include <linux/input.h> |
#include <asm/scatterlist.h> |
#include <asm/io.h> |
#include <linux/device.h> |
#include <drivers/video-buf.h> |
#include <drivers/audiochip.h> |
#include <drivers/tuner.h> |
#include "drivers/bt848.h" |
#include "drivers/bttv.h" |
#include "drivers/btcx-risc.h" |
#ifdef CONFIG_VIDEO_IR |
#include "ir-common.h" |
#endif |
#ifdef __KERNEL__ |
#define FORMAT_FLAGS_DITHER 0x01 |
#define FORMAT_FLAGS_PACKED 0x02 |
#define FORMAT_FLAGS_PLANAR 0x04 |
#define FORMAT_FLAGS_RAW 0x08 |
#define FORMAT_FLAGS_CrCb 0x10 |
#define RISC_SLOT_O_VBI 4 |
#define RISC_SLOT_O_FIELD 6 |
#define RISC_SLOT_E_VBI 10 |
#define RISC_SLOT_E_FIELD 12 |
#define RISC_SLOT_LOOP 14 |
#define RESOURCE_OVERLAY 1 |
#define RESOURCE_VIDEO 2 |
#define RESOURCE_VBI 4 |
#define RAW_LINES 640 |
#define RAW_BPL 1024 |
#define UNSET (-1U) |
/* ---------------------------------------------------------- */ |
struct bttv_tvnorm { |
int v4l2_id; |
char *name; |
u32 Fsc; |
u16 swidth, sheight; /* scaled standard width, height */ |
u16 totalwidth; |
u8 adelay, bdelay, iform; |
u32 scaledtwidth; |
u16 hdelayx1, hactivex1; |
u16 vdelay; |
u8 vbipack; |
u16 vtotal; |
int sram; |
}; |
extern const struct bttv_tvnorm bttv_tvnorms[]; |
extern const unsigned int 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_* */ |
int depth; /* bit/pixel */ |
int flags; |
int hshift,vshift; /* for planar modes */ |
}; |
extern const struct bttv_format bttv_formats[]; |
extern const unsigned int BTTV_FORMATS; |
/* ---------------------------------------------------------- */ |
struct bttv_geometry { |
u8 vtc,crop,comb; |
u16 width,hscale,hdelay; |
u16 sheight,vscale,vdelay,vtotal; |
}; |
struct bttv_buffer { |
/* common v4l buffer stuff -- must be first */ |
struct videobuf_buffer vb; |
/* bttv specific */ |
const struct bttv_format *fmt; |
int tvnorm; |
int btformat; |
int btswap; |
struct bttv_geometry geo; |
struct btcx_riscmem top; |
struct btcx_riscmem bottom; |
}; |
struct bttv_buffer_set { |
struct bttv_buffer *top; /* top field buffer */ |
struct bttv_buffer *bottom; /* bottom field buffer */ |
struct bttv_buffer *vbi; /* vbi buffer */ |
unsigned int irqflags; |
unsigned int topirq; |
}; |
struct bttv_overlay { |
int tvnorm; |
struct v4l2_rect w; |
enum v4l2_field field; |
struct v4l2_clip *clips; |
int nclips; |
int setup_ok; |
}; |
struct bttv_fh { |
struct bttv *btv; |
int resources; |
#ifdef VIDIOC_G_PRIORITY |
enum v4l2_priority prio; |
#endif |
enum v4l2_buf_type type; |
/* video capture */ |
struct videobuf_queue cap; |
const struct bttv_format *fmt; |
int width; |
int height; |
/* current settings */ |
const struct bttv_format *ovfmt; |
struct bttv_overlay ov; |
/* video overlay */ |
struct videobuf_queue vbi; |
int lines; |
}; |
/* ---------------------------------------------------------- */ |
/* bttv-risc.c */ |
/* risc code generators - capture */ |
int bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc, |
struct scatterlist *sglist, |
unsigned int offset, unsigned int bpl, |
unsigned int pitch, unsigned int lines); |
int bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc, |
struct scatterlist *sglist, |
unsigned int yoffset, unsigned int ybpl, |
unsigned int ypadding, unsigned int ylines, |
unsigned int uoffset, unsigned int voffset, |
unsigned int hshift, unsigned int vshift, |
unsigned int cpadding); |
int bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, |
const struct bttv_format *fmt, |
struct bttv_overlay *ov, |
int skip_top, int skip_bottom); |
/* calculate / apply geometry settings */ |
void bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo, |
int width, int height, int interleaved, int norm); |
void bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int top); |
/* control dma register + risc main loop */ |
void bttv_set_dma(struct bttv *btv, int override, int irqflags); |
int bttv_risc_init_main(struct bttv *btv); |
int bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc, |
int irqflags); |
/* capture buffer handling */ |
int bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf); |
int bttv_buffer_set_activate(struct bttv *btv, |
struct bttv_buffer_set *set); |
void bttv_dma_free(struct bttv *btv, struct bttv_buffer *buf); |
/* overlay handling */ |
int bttv_overlay_risc(struct bttv *btv, struct bttv_overlay *ov, |
const struct bttv_format *fmt, |
struct bttv_buffer *buf); |
/* ---------------------------------------------------------- */ |
/* bttv-vbi.c */ |
void bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_format *f); |
void bttv_vbi_get_fmt(struct bttv_fh *fh, struct v4l2_format *f); |
void bttv_vbi_setlines(struct bttv_fh *fh, struct bttv *btv, int lines); |
extern struct videobuf_queue_ops bttv_vbi_qops; |
/* ---------------------------------------------------------- */ |
/* bttv-input.c */ |
int bttv_input_init(struct bttv *btv); |
void bttv_input_fini(struct bttv *btv); |
void bttv_input_irq(struct bttv *btv); |
/* ---------------------------------------------------------- */ |
/* bttv-driver.c */ |
/* insmod options */ |
extern unsigned int bttv_verbose; |
extern unsigned int bttv_debug; |
extern unsigned int bttv_gpio; |
extern void bttv_gpio_tracking(struct bttv *btv, char *comment); |
extern int init_bttv_i2c(struct bttv *btv); |
extern int fini_bttv_i2c(struct bttv *btv); |
extern int pvr_boot(struct bttv *btv); |
extern int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg); |
extern void bttv_reinit_bt848(struct bttv *btv); |
extern void bttv_field_count(struct bttv *btv); |
#define vprintk if (bttv_verbose) printk |
#define dprintk if (bttv_debug >= 1) printk |
#define d2printk if (bttv_debug >= 2) printk |
/* our devices */ |
#define BTTV_MAX 16 |
extern unsigned int bttv_num; |
extern struct bttv bttvs[BTTV_MAX]; |
#define BTTV_MAX_FBUF 0x208000 |
#define VBIBUF_SIZE (2048*VBI_MAXLINES*2) |
#define BTTV_TIMEOUT (HZ/2) /* 0.5 seconds */ |
#define BTTV_FREE_IDLE (HZ) /* one second */ |
struct bttv_pll_info { |
unsigned int pll_ifreq; /* PLL input frequency */ |
unsigned int pll_ofreq; /* PLL output frequency */ |
unsigned int pll_crystal; /* Crystal used for input */ |
unsigned int pll_current; /* Currently programmed ofreq */ |
}; |
#ifdef CONFIG_VIDEO_IR |
/* for gpio-connected remote control */ |
struct bttv_input { |
struct input_dev dev; |
struct ir_input_state ir; |
char name[32]; |
char phys[32]; |
u32 mask_keycode; |
u32 mask_keydown; |
}; |
#endif |
struct bttv { |
/* pci device config */ |
struct pci_dev *dev; |
unsigned short id; |
unsigned char revision; |
unsigned char *bt848_mmio; /* pointer to mmio */ |
/* card configuration info */ |
unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */ |
char name[8]; /* dev name */ |
unsigned int cardid; /* pci subsystem id (bt878 based ones) */ |
unsigned int type; /* card type (pointer into tvcards[]) */ |
unsigned int tuner_type; /* tuner chip type */ |
unsigned int pinnacle_id; |
unsigned int svhs; |
struct bttv_pll_info pll; |
int triton1; |
/* gpio interface */ |
wait_queue_head_t gpioq; |
int shutdown; |
void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set); |
/* i2c layer */ |
struct i2c_adapter i2c_adap; |
struct i2c_algo_bit_data i2c_algo; |
struct i2c_client i2c_client; |
int i2c_state, i2c_rc; |
/* video4linux (1) */ |
struct video_device *video_dev; |
struct video_device *radio_dev; |
struct video_device *vbi_dev; |
/* infrared remote */ |
int has_remote; |
#ifdef CONFIG_VIDEO_IR |
struct bttv_input *remote; |
#endif |
/* locking */ |
spinlock_t s_lock; |
struct semaphore lock; |
int resources; |
struct semaphore reslock; |
#ifdef VIDIOC_G_PRIORITY |
struct v4l2_prio_state prio; |
#endif |
/* video state */ |
unsigned int input; |
unsigned int audio; |
unsigned long freq; |
int tvnorm,hue,contrast,bright,saturation; |
struct v4l2_framebuffer fbuf; |
unsigned int field_count; |
/* various options */ |
int opt_combfilter; |
int opt_lumafilter; |
int opt_automute; |
int opt_chroma_agc; |
int opt_adc_crush; |
int opt_vcr_hack; |
/* radio data/state */ |
int has_radio; |
int radio_user; |
/* miro/pinnacle + Aimslab VHX |
philips matchbox (tea5757 radio tuner) support */ |
int has_matchbox; |
int mbox_we; |
int mbox_data; |
int mbox_clk; |
int mbox_most; |
int mbox_mask; |
/* ISA stuff (Terratec Active Radio Upgrade) */ |
int mbox_ior; |
int mbox_iow; |
int mbox_csel; |
/* risc memory management data |
- must aquire s_lock before changing these |
- only the irq handler is supported to touch top + bottom + vcurr */ |
struct btcx_riscmem main; |
struct bttv_buffer *screen; /* overlay */ |
struct list_head capture; /* video capture queue */ |
struct list_head vcapture; /* vbi capture queue */ |
struct bttv_buffer_set curr; /* active buffers */ |
int new_input; |
unsigned long cap_ctl; |
unsigned long dma_on; |
struct timer_list timeout; |
unsigned int errors; |
unsigned int users; |
struct bttv_fh init; |
}; |
/* 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), (char *) (btv->bt848_mmio+(adr))) |
#define btread(adr) readl(btv->bt848_mmio+(adr)) |
#define btand(dat,adr) btwrite((dat) & btread(adr), adr) |
#define btor(dat,adr) btwrite((dat) | btread(adr), adr) |
#define btaor(dat,mask,adr) btwrite((dat) | ((mask) & btread(adr)), adr) |
#endif /* _BTTVP_H_ */ |
/* |
* Local variables: |
* c-basic-offset: 8 |
* End: |
*/ |
/shark/trunk/drivers/bttv/include/drivers/video-buf.h |
---|
0,0 → 1,244 |
/* |
* generic helper functions for video4linux capture buffers, to handle |
* memory management and PCI DMA. Right now bttv + saa7134 use it. |
* |
* The functions expect the hardware being able to scatter gatter |
* (i.e. the buffers are not linear in physical memory, but fragmented |
* into PAGE_SIZE chunks). They also assume the driver does not need |
* to touch the video data (thus it is probably not useful for USB as |
* data often must be uncompressed by the drivers). |
* |
* (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
* |
* This program is free software; you can redistribute it and/or modify |
* it under the terms of the GNU General Public License as published by |
* the Free Software Foundation; either version 2 of the License, or |
* (at your option) any later version. |
*/ |
#include <linux/videodev.h> |
/* --------------------------------------------------------------------- */ |
/* |
* Return a scatterlist for some page-aligned vmalloc()'ed memory |
* block (NULL on errors). Memory for the scatterlist is allocated |
* using kmalloc. The caller must free the memory. |
*/ |
struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); |
/* |
* Return a scatterlist for a an array of userpages (NULL on errors). |
* Memory for the scatterlist is allocated using kmalloc. The caller |
* must free the memory. |
*/ |
struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, |
int offset); |
int videobuf_lock(struct page **pages, int nr_pages); |
int videobuf_unlock(struct page **pages, int nr_pages); |
/* --------------------------------------------------------------------- */ |
/* |
* A small set of helper functions to manage buffers (both userland |
* and kernel) for DMA. |
* |
* videobuf_dma_init_*() |
* creates a buffer. The userland version takes a userspace |
* pointer + length. The kernel version just wants the size and |
* does memory allocation too using vmalloc_32(). |
* |
* videobuf_dma_pci_*() |
* see Documentation/DMA-mapping.txt, these functions to |
* basically the same. The map function does also build a |
* scatterlist for the buffer (and unmap frees it ...) |
* |
* videobuf_dma_free() |
* no comment ... |
* |
*/ |
struct videobuf_dmabuf { |
/* for userland buffer */ |
int offset; |
struct page **pages; |
/* for kernel buffers */ |
void *vmalloc; |
/* for overlay buffers (pci-pci dma) */ |
dma_addr_t bus_addr; |
/* common */ |
struct scatterlist *sglist; |
int sglen; |
int nr_pages; |
int direction; |
}; |
int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, |
unsigned long data, unsigned long size); |
int videobuf_dma_init_kernel(struct videobuf_dmabuf *dma, int direction, |
int nr_pages); |
int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, |
dma_addr_t addr, int nr_pages); |
int videobuf_dma_pci_map(struct pci_dev *dev, struct videobuf_dmabuf *dma); |
int videobuf_dma_pci_sync(struct pci_dev *dev, |
struct videobuf_dmabuf *dma); |
int videobuf_dma_pci_unmap(struct pci_dev *dev, struct videobuf_dmabuf *dma); |
int videobuf_dma_free(struct videobuf_dmabuf *dma); |
/* --------------------------------------------------------------------- */ |
/* |
* A small set of helper functions to manage video4linux buffers. |
* |
* struct videobuf_buffer holds the data structures used by the helper |
* functions, additionally some commonly used fields for v4l buffers |
* (width, height, lists, waitqueue) are in there. That struct should |
* be used as first element in the drivers buffer struct. |
* |
* about the mmap helpers (videobuf_mmap_*): |
* |
* The mmaper function allows to map any subset of contingous buffers. |
* This includes one mmap() call for all buffers (which the original |
* video4linux API uses) as well as one mmap() for every single buffer |
* (which v4l2 uses). |
* |
* If there is a valid mapping for a buffer, buffer->baddr/bsize holds |
* userspace address + size which can be feeded into the |
* videobuf_dma_init_user function listed above. |
* |
*/ |
struct videobuf_buffer; |
struct videobuf_queue; |
struct videobuf_mapping { |
unsigned int count; |
int highmem_ok; |
unsigned long start; |
unsigned long end; |
struct videobuf_queue *q; |
}; |
enum videobuf_state { |
STATE_NEEDS_INIT = 0, |
STATE_PREPARED = 1, |
STATE_QUEUED = 2, |
STATE_ACTIVE = 3, |
STATE_DONE = 4, |
STATE_ERROR = 5, |
STATE_IDLE = 6, |
}; |
struct videobuf_buffer { |
unsigned int i; |
/* info about the buffer */ |
unsigned int width; |
unsigned int height; |
unsigned int bytesperline; /* use only if != 0 */ |
unsigned long size; |
enum v4l2_field field; |
enum videobuf_state state; |
struct videobuf_dmabuf dma; |
struct list_head stream; /* QBUF/DQBUF list */ |
/* for mmap'ed buffers */ |
enum v4l2_memory memory; |
size_t boff; /* buffer offset (mmap + overlay) */ |
size_t bsize; /* buffer size */ |
unsigned long baddr; /* buffer addr (userland ptr!) */ |
struct videobuf_mapping *map; |
/* touched by irq handler */ |
struct list_head queue; |
wait_queue_head_t done; |
unsigned int field_count; |
struct timeval ts; |
}; |
struct videobuf_queue_ops { |
int (*buf_setup)(struct file *file, |
unsigned int *count, unsigned int *size); |
int (*buf_prepare)(struct file *file,struct videobuf_buffer *vb, |
enum v4l2_field field); |
void (*buf_queue)(struct file *file,struct videobuf_buffer *vb); |
void (*buf_release)(struct file *file,struct videobuf_buffer *vb); |
}; |
struct videobuf_queue { |
struct semaphore lock; |
spinlock_t *irqlock; |
struct pci_dev *pci; |
enum v4l2_buf_type type; |
unsigned int msize; |
enum v4l2_field field; |
enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */ |
struct videobuf_buffer *bufs[VIDEO_MAX_FRAME]; |
struct videobuf_queue_ops *ops; |
/* capture via mmap() + ioctl(QBUF/DQBUF) */ |
unsigned int streaming; |
struct list_head stream; |
/* capture via read() */ |
unsigned int reading; |
unsigned int read_off; |
struct videobuf_buffer *read_buf; |
}; |
void* videobuf_alloc(unsigned int size); |
int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); |
int videobuf_iolock(struct pci_dev *pci, struct videobuf_buffer *vb, |
struct v4l2_framebuffer *fbuf); |
void videobuf_queue_init(struct videobuf_queue *q, |
struct videobuf_queue_ops *ops, |
struct pci_dev *pci, spinlock_t *irqlock, |
enum v4l2_buf_type type, |
enum v4l2_field field, |
unsigned int msize); |
int videobuf_queue_is_busy(struct videobuf_queue *q); |
void videobuf_queue_cancel(struct file *file, struct videobuf_queue *q); |
enum v4l2_field videobuf_next_field(struct videobuf_queue *q); |
void videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb, |
enum v4l2_buf_type type); |
int videobuf_reqbufs(struct file *file, struct videobuf_queue *q, |
struct v4l2_requestbuffers *req); |
int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b); |
int videobuf_qbuf(struct file *file, struct videobuf_queue *q, |
struct v4l2_buffer *b); |
int videobuf_dqbuf(struct file *file, struct videobuf_queue *q, |
struct v4l2_buffer *b); |
int videobuf_streamon(struct file *file, struct videobuf_queue *q); |
int videobuf_streamoff(struct file *file, struct videobuf_queue *q); |
int videobuf_read_start(struct file *file, struct videobuf_queue *q); |
void videobuf_read_stop(struct file *file, struct videobuf_queue *q); |
ssize_t videobuf_read_stream(struct file *file, struct videobuf_queue *q, |
char *data, size_t count, loff_t *ppos, |
int vbihack); |
ssize_t videobuf_read_one(struct file *file, struct videobuf_queue *q, |
char *data, size_t count, loff_t *ppos); |
unsigned int videobuf_poll_stream(struct file *file, |
struct videobuf_queue *q, |
poll_table *wait); |
int videobuf_mmap_setup(struct file *file, struct videobuf_queue *q, |
unsigned int bcount, unsigned int bsize, |
enum v4l2_memory memory); |
int videobuf_mmap_free(struct file *file, struct videobuf_queue *q); |
int videobuf_mmap_mapper(struct vm_area_struct *vma, |
struct videobuf_queue *q); |
/* --------------------------------------------------------------------- */ |
/* |
* Local variables: |
* c-basic-offset: 8 |
* End: |
*/ |
/shark/trunk/drivers/bttv/include/drivers/bt832.h |
---|
0,0 → 1,305 |
/* Bt832 CMOS Camera Video Processor (VP) |
The Bt832 CMOS Camera Video Processor chip connects a Quartsight CMOS |
color digital camera directly to video capture devices via an 8-bit, |
4:2:2 YUV or YCrCb video interface. |
i2c addresses: 0x88 or 0x8a |
*/ |
/* The 64 registers: */ |
// Input Processor |
#define BT832_OFFSET 0 |
#define BT832_RCOMP 1 |
#define BT832_G1COMP 2 |
#define BT832_G2COMP 3 |
#define BT832_BCOMP 4 |
// Exposures: |
#define BT832_FINEH 5 |
#define BT832_FINEL 6 |
#define BT832_COARSEH 7 |
#define BT832_COARSEL 8 |
#define BT832_CAMGAIN 9 |
// Main Processor: |
#define BT832_M00 10 |
#define BT832_M01 11 |
#define BT832_M02 12 |
#define BT832_M10 13 |
#define BT832_M11 14 |
#define BT832_M12 15 |
#define BT832_M20 16 |
#define BT832_M21 17 |
#define BT832_M22 18 |
#define BT832_APCOR 19 |
#define BT832_GAMCOR 20 |
// Level Accumulator Inputs |
#define BT832_VPCONTROL2 21 |
#define BT832_ZONECODE0 22 |
#define BT832_ZONECODE1 23 |
#define BT832_ZONECODE2 24 |
#define BT832_ZONECODE3 25 |
// Level Accumulator Outputs: |
#define BT832_RACC 26 |
#define BT832_GACC 27 |
#define BT832_BACC 28 |
#define BT832_BLACKACC 29 |
#define BT832_EXP_AGC 30 |
#define BT832_LACC0 31 |
#define BT832_LACC1 32 |
#define BT832_LACC2 33 |
#define BT832_LACC3 34 |
#define BT832_LACC4 35 |
#define BT832_LACC5 36 |
#define BT832_LACC6 37 |
#define BT832_LACC7 38 |
// System: |
#define BT832_VP_CONTROL0 39 |
#define BT832_VP_CONTROL1 40 |
#define BT832_THRESH 41 |
#define BT832_VP_TESTCONTROL0 42 |
#define BT832_VP_DMCODE 43 |
#define BT832_ACB_CONFIG 44 |
#define BT832_ACB_GNBASE 45 |
#define BT832_ACB_MU 46 |
#define BT832_CAM_TEST0 47 |
#define BT832_AEC_CONFIG 48 |
#define BT832_AEC_TL 49 |
#define BT832_AEC_TC 50 |
#define BT832_AEC_TH 51 |
// Status: |
#define BT832_VP_STATUS 52 |
#define BT832_VP_LINECOUNT 53 |
#define BT832_CAM_DEVICEL 54 // e.g. 0x19 |
#define BT832_CAM_DEVICEH 55 // e.g. 0x40 == 0x194 Mask0, 0x194 = 404 decimal (VVL-404 camera) |
#define BT832_CAM_STATUS 56 |
#define BT832_56_CAMERA_PRESENT 0x20 |
//Camera Setups: |
#define BT832_CAM_SETUP0 57 |
#define BT832_CAM_SETUP1 58 |
#define BT832_CAM_SETUP2 59 |
#define BT832_CAM_SETUP3 60 |
// System: |
#define BT832_DEFCOR 61 |
#define BT832_VP_TESTCONTROL1 62 |
#define BT832_DEVICE_ID 63 |
# define BT832_DEVICE_ID__31 0x31 // Bt832 has ID 0x31 |
/* STMicroelectronivcs VV5404 camera module |
i2c: 0x20: sensor address |
i2c: 0xa0: eeprom for ccd defect map |
*/ |
#define VV5404_device_h 0x00 // 0x19 |
#define VV5404_device_l 0x01 // 0x40 |
#define VV5404_status0 0x02 |
#define VV5404_linecountc 0x03 // current line counter |
#define VV5404_linecountl 0x04 |
#define VV5404_setup0 0x10 |
#define VV5404_setup1 0x11 |
#define VV5404_setup2 0x12 |
#define VV5404_setup4 0x14 |
#define VV5404_setup5 0x15 |
#define VV5404_fine_h 0x20 // fine exposure |
#define VV5404_fine_l 0x21 |
#define VV5404_coarse_h 0x22 //coarse exposure |
#define VV5404_coarse_l 0x23 |
#define VV5404_gain 0x24 // ADC pre-amp gain setting |
#define VV5404_clk_div 0x25 |
#define VV5404_cr 0x76 // control register |
#define VV5404_as0 0x77 // ADC setup register |
// IOCTL |
#define BT832_HEXDUMP _IOR('b',1,int) |
#define BT832_REATTACH _IOR('b',2,int) |
/* from BT8x8VXD/capdrv/dialogs.cpp */ |
/* |
typedef enum { SVI, Logitech, Rockwell } CAMERA; |
static COMBOBOX_ENTRY gwCameraOptions[] = |
{ |
{ SVI, "Silicon Vision 512N" }, |
{ Logitech, "Logitech VideoMan 1.3" }, |
{ Rockwell, "Rockwell QuartzSight PCI 1.0" } |
}; |
// SRAM table values |
//=========================================================================== |
typedef enum { TGB_NTSC624, TGB_NTSC780, TGB_NTSC858, TGB_NTSC392 } TimeGenByte; |
BYTE SRAMTable[][ 60 ] = |
{ |
// TGB_NTSC624 |
{ |
0x33, // size of table = 51 |
0x0E, 0xC0, 0x00, 0x00, 0x90, 0x02, 0x03, 0x10, 0x03, 0x06, |
0x10, 0x04, 0x12, 0x12, 0x05, 0x02, 0x13, 0x04, 0x19, 0x00, |
0x04, 0x39, 0x00, 0x06, 0x59, 0x08, 0x03, 0x85, 0x08, 0x07, |
0x03, 0x50, 0x00, 0x91, 0x40, 0x00, 0x11, 0x01, 0x01, 0x4D, |
0x0D, 0x02, 0x03, 0x11, 0x01, 0x05, 0x37, 0x00, 0x37, 0x21, 0x00 |
}, |
// TGB_NTSC780 |
{ |
0x33, // size of table = 51 |
0x0e, 0xc0, 0x00, 0x00, 0x90, 0xe2, 0x03, 0x10, 0x03, 0x06, |
0x10, 0x34, 0x12, 0x12, 0x65, 0x02, 0x13, 0x24, 0x19, 0x00, |
0x24, 0x39, 0x00, 0x96, 0x59, 0x08, 0x93, 0x85, 0x08, 0x97, |
0x03, 0x50, 0x50, 0xaf, 0x40, 0x30, 0x5f, 0x01, 0xf1, 0x7f, |
0x0d, 0xf2, 0x03, 0x11, 0xf1, 0x05, 0x37, 0x30, 0x85, 0x21, 0x50 |
}, |
// TGB_NTSC858 |
{ |
0x33, // size of table = 51 |
0x0c, 0xc0, 0x00, 0x00, 0x90, 0xc2, 0x03, 0x10, 0x03, 0x06, |
0x10, 0x34, 0x12, 0x12, 0x65, 0x02, 0x13, 0x24, 0x19, 0x00, |
0x24, 0x39, 0x00, 0x96, 0x59, 0x08, 0x93, 0x83, 0x08, 0x97, |
0x03, 0x50, 0x30, 0xc0, 0x40, 0x30, 0x86, 0x01, 0x01, 0xa6, |
0x0d, 0x62, 0x03, 0x11, 0x61, 0x05, 0x37, 0x30, 0xac, 0x21, 0x50 |
}, |
// TGB_NTSC392 |
// This table has been modified to be used for Fusion Rev D |
{ |
0x2A, // size of table = 42 |
0x06, 0x08, 0x04, 0x0a, 0xc0, 0x00, 0x18, 0x08, 0x03, 0x24, |
0x08, 0x07, 0x02, 0x90, 0x02, 0x08, 0x10, 0x04, 0x0c, 0x10, |
0x05, 0x2c, 0x11, 0x04, 0x55, 0x48, 0x00, 0x05, 0x50, 0x00, |
0xbf, 0x0c, 0x02, 0x2f, 0x3d, 0x00, 0x2f, 0x3f, 0x00, 0xc3, |
0x20, 0x00 |
} |
}; |
//=========================================================================== |
// This is the structure of the camera specifications |
//=========================================================================== |
typedef struct tag_cameraSpec |
{ |
SignalFormat signal; // which digital signal format the camera has |
VideoFormat vidFormat; // video standard |
SyncVideoRef syncRef; // which sync video reference is used |
State syncOutput; // enable sync output for sync video input? |
DecInputClk iClk; // which input clock is used |
TimeGenByte tgb; // which timing generator byte does the camera use |
int HReset; // select 64, 48, 32, or 16 CLKx1 for HReset |
PLLFreq pllFreq; // what synthesized frequency to set PLL to |
VSIZEPARMS vSize; // video size the camera produces |
int lineCount; // expected total number of half-line per frame - 1 |
BOOL interlace; // interlace signal? |
} CameraSpec; |
//=========================================================================== |
// <UPDATE REQUIRED> |
// Camera specifications database. Update this table whenever camera spec |
// has been changed or added/deleted supported camera models |
//=========================================================================== |
static CameraSpec dbCameraSpec[ N_CAMERAOPTIONS ] = |
{ // Silicon Vision 512N |
{ Signal_CCIR656, VFormat_NTSC, VRef_alignedCb, Off, DecClk_GPCLK, TGB_NTSC624, 64, KHz19636, |
// Clkx1_HACTIVE, Clkx1_HDELAY, VActive, VDelay, linesPerField; lineCount, Interlace |
{ 512, 0x64, 480, 0x13, 240 }, 0, TRUE |
}, |
// Logitech VideoMan 1.3 |
{ Signal_CCIR656, VFormat_NTSC, VRef_alignedCb, Off, DecClk_GPCLK, TGB_NTSC780, 64, KHz24545, |
// Clkx1_HACTIVE, Clkx1_HDELAY, VActive, VDelay, linesPerField; lineCount, Interlace |
{ 640, 0x80, 480, 0x1A, 240 }, 0, TRUE |
}, |
// Rockwell QuartzSight |
// Note: Fusion Rev D (rev ID 0x02) and later supports 16 pixels for HReset which is preferable. |
// Use 32 for earlier version of hardware. Clkx1_HDELAY also changed from 0x27 to 0x20. |
{ Signal_CCIR656, VFormat_NTSC, VRef_alignedCb, Off, DecClk_GPCLK, TGB_NTSC392, 16, KHz28636, |
// Clkx1_HACTIVE, Clkx1_HDELAY, VActive, VDelay, linesPerField; lineCount, Interlace |
{ 352, 0x20, 576, 0x08, 288 }, 607, FALSE |
} |
}; |
*/ |
/* |
The corresponding APIs required to be invoked are: |
SetConnector( ConCamera, TRUE/FALSE ); |
SetSignalFormat( spec.signal ); |
SetVideoFormat( spec.vidFormat ); |
SetSyncVideoRef( spec.syncRef ); |
SetEnableSyncOutput( spec.syncOutput ); |
SetTimGenByte( SRAMTable[ spec.tgb ], SRAMTableSize[ spec.tgb ] ); |
SetHReset( spec.HReset ); |
SetPLL( spec.pllFreq ); |
SetDecInputClock( spec.iClk ); |
SetVideoInfo( spec.vSize ); |
SetTotalLineCount( spec.lineCount ); |
SetInterlaceMode( spec.interlace ); |
*/ |
/* from web: |
Video Sampling |
Digital video is a sampled form of analog video. The most common sampling schemes in use today are: |
Pixel Clock Horiz Horiz Vert |
Rate Total Active |
NTSC square pixel 12.27 MHz 780 640 525 |
NTSC CCIR-601 13.5 MHz 858 720 525 |
NTSC 4FSc 14.32 MHz 910 768 525 |
PAL square pixel 14.75 MHz 944 768 625 |
PAL CCIR-601 13.5 MHz 864 720 625 |
PAL 4FSc 17.72 MHz 1135 948 625 |
For the CCIR-601 standards, the sampling is based on a static orthogonal sampling grid. The luminance component (Y) is sampled at 13.5 MHz, while the two color difference signals, Cr and Cb are sampled at half that, or 6.75 MHz. The Cr and Cb samples are colocated with alternate Y samples, and they are taken at the same position on each line, such that one sample is coincident with the 50% point of the falling edge of analog sync. The samples are coded to either 8 or 10 bits per component. |
*/ |
/* from DScaler:*/ |
/* |
//=========================================================================== |
// CCIR656 Digital Input Support: The tables were taken from DScaler proyect |
// |
// 13 Dec 2000 - Michael Eskin, Conexant Systems - Initial version |
// |
//=========================================================================== |
// Timing generator SRAM table values for CCIR601 720x480 NTSC |
//=========================================================================== |
// For NTSC CCIR656 |
BYTE BtCard::SRAMTable_NTSC[] = |
{ |
// SRAM Timing Table for NTSC |
0x0c, 0xc0, 0x00, |
0x00, 0x90, 0xc2, |
0x03, 0x10, 0x03, |
0x06, 0x10, 0x34, |
0x12, 0x12, 0x65, |
0x02, 0x13, 0x24, |
0x19, 0x00, 0x24, |
0x39, 0x00, 0x96, |
0x59, 0x08, 0x93, |
0x83, 0x08, 0x97, |
0x03, 0x50, 0x30, |
0xc0, 0x40, 0x30, |
0x86, 0x01, 0x01, |
0xa6, 0x0d, 0x62, |
0x03, 0x11, 0x61, |
0x05, 0x37, 0x30, |
0xac, 0x21, 0x50 |
}; |
//=========================================================================== |
// Timing generator SRAM table values for CCIR601 720x576 NTSC |
//=========================================================================== |
// For PAL CCIR656 |
BYTE BtCard::SRAMTable_PAL[] = |
{ |
// SRAM Timing Table for PAL |
0x36, 0x11, 0x01, |
0x00, 0x90, 0x02, |
0x05, 0x10, 0x04, |
0x16, 0x14, 0x05, |
0x11, 0x00, 0x04, |
0x12, 0xc0, 0x00, |
0x31, 0x00, 0x06, |
0x51, 0x08, 0x03, |
0x89, 0x08, 0x07, |
0xc0, 0x44, 0x00, |
0x81, 0x01, 0x01, |
0xa9, 0x0d, 0x02, |
0x02, 0x50, 0x03, |
0x37, 0x3d, 0x00, |
0xaf, 0x21, 0x00, |
}; |
*/ |
/shark/trunk/drivers/bttv/include/drivers/audiochip.h |
---|
3,9 → 3,6 |
/* ---------------------------------------------------------------------- */ |
#define MIN(a,b) (((a)>(b))?(b):(a)) |
#define MAX(a,b) (((a)>(b))?(a):(b)) |
/* v4l device was opened in Radio mode */ |
#define AUDC_SET_RADIO _IO('m',2) |
/* select from TV,radio,extern,MUTE */ |
30,41 → 27,7 |
* make sense in v4l context only. So I think that's acceptable... |
*/ |
#if 0 |
/* misc stuff to pass around config info to i2c chips */ |
#define AUDC_CONFIG_PINNACLE _IOW('m',32,int) |
/* TODO (if it is ever [to be] accessible in the V4L[2] spec): |
* maybe fade? (back/front) |
* notes: |
* NEWCHANNEL and SWITCH_MUTE are here because the MSP3400 has a special |
* routine to go through when it tunes in to a new channel before turning |
* back on the sound. |
* Either SET_RADIO, NEWCHANNEL, and SWITCH_MUTE or SET_INPUT need to be |
* implemented (MSP3400 uses SET_RADIO to select inputs, and SWITCH_MUTE for |
* channel-change mute -- TEA6300 et al use SET_AUDIO to select input [TV, |
* radio, external, or MUTE]). If both methods are implemented, you get a |
* cookie for doing such a good job! :) |
*/ |
#define AUDC_SET_TVNORM _IOW('m',1,int) /* TV mode + PAL/SECAM/NTSC */ |
#define AUDC_NEWCHANNEL _IO('m',3) /* indicate new chan - off mute */ |
#define AUDC_GET_VOLUME_LEFT _IOR('m',4,__u16) |
#define AUDC_GET_VOLUME_RIGHT _IOR('m',5,__u16) |
#define AUDC_SET_VOLUME_LEFT _IOW('m',6,__u16) |
#define AUDC_SET_VOLUME_RIGHT _IOW('m',7,__u16) |
#define AUDC_GET_STEREO _IOR('m',8,__u16) |
#define AUDC_SET_STEREO _IOW('m',9,__u16) |
#define AUDC_GET_DC _IOR('m',10,__u16)/* ??? */ |
#define AUDC_GET_BASS _IOR('m',11,__u16) |
#define AUDC_SET_BASS _IOW('m',12,__u16) |
#define AUDC_GET_TREBLE _IOR('m',13,__u16) |
#define AUDC_SET_TREBLE _IOW('m',14,__u16) |
#define AUDC_GET_UNIT _IOR('m',15,int) /* ??? - unimplemented in MSP3400 */ |
#define AUDC_SWITCH_MUTE _IO('m',16) /* turn on mute */ |
#endif |
#endif /* AUDIOCHIP_H */ |