📄 cx88.h
字号:
struct semaphore lock; /* various v4l controls */ u32 freq;};struct cx8800_dev;struct cx8802_dev;/* ----------------------------------------------------------- *//* function 0: video stuff */struct cx8800_fh { struct cx8800_dev *dev; enum v4l2_buf_type type; int radio; unsigned int resources; /* video overlay */ struct v4l2_window win; struct v4l2_clip *clips; unsigned int nclips; /* video capture */ struct cx8800_fmt *fmt; unsigned int width,height; struct videobuf_queue vidq; /* vbi capture */ struct videobuf_queue vbiq;};struct cx8800_suspend_state { int disabled;};struct cx8800_dev { struct cx88_core *core; struct list_head devlist; spinlock_t slock; /* various device info */ unsigned int resources; struct video_device *video_dev; struct video_device *vbi_dev; struct video_device *radio_dev; /* pci i/o */ struct pci_dev *pci; unsigned char pci_rev,pci_lat; /* capture queues */ struct cx88_dmaqueue vidq; struct cx88_dmaqueue vbiq; /* various v4l controls */ /* other global state info */ struct cx8800_suspend_state state;};/* ----------------------------------------------------------- *//* function 1: audio/alsa stuff *//* =============> moved to cx88-alsa.c <====================== *//* ----------------------------------------------------------- *//* function 2: mpeg stuff */struct cx8802_fh { struct cx8802_dev *dev; struct videobuf_queue mpegq;};struct cx8802_suspend_state { int disabled;};/* TODO: move this to struct v4l2_mpeg_compression ? */struct blackbird_dnr { u32 mode; u32 type; u32 spatial; u32 temporal;};struct cx8802_dev { struct cx88_core *core; spinlock_t slock; /* pci i/o */ struct pci_dev *pci; unsigned char pci_rev,pci_lat; /* dma queues */ struct cx88_dmaqueue mpegq; u32 ts_packet_size; u32 ts_packet_count; /* other global state info */ struct cx8802_suspend_state state; /* for blackbird only */ struct list_head devlist; struct video_device *mpeg_dev; u32 mailbox; int width; int height; /* for dvb only */ struct videobuf_dvb dvb; void* fe_handle; int (*fe_release)(void *handle); /* for switching modulation types */ unsigned char ts_gen_cntrl; /* mpeg params */ struct v4l2_mpeg_compression params; struct blackbird_dnr dnr_params;};/* ----------------------------------------------------------- */#define cx_read(reg) readl(core->lmmio + ((reg)>>2))#define cx_write(reg,value) writel((value), core->lmmio + ((reg)>>2))#define cx_writeb(reg,value) writeb((value), core->bmmio + (reg))#define cx_andor(reg,mask,value) \ writel((readl(core->lmmio+((reg)>>2)) & ~(mask)) |\ ((value) & (mask)), core->lmmio+((reg)>>2))#define cx_set(reg,bit) cx_andor((reg),(bit),(bit))#define cx_clear(reg,bit) cx_andor((reg),(bit),0)#define cx_wait(d) { if (need_resched()) schedule(); else udelay(d); }/* shadow registers */#define cx_sread(sreg) (core->shadow[sreg])#define cx_swrite(sreg,reg,value) \ (core->shadow[sreg] = value, \ writel(core->shadow[sreg], core->lmmio + ((reg)>>2)))#define cx_sandor(sreg,reg,mask,value) \ (core->shadow[sreg] = (core->shadow[sreg] & ~(mask)) | ((value) & (mask)), \ writel(core->shadow[sreg], core->lmmio + ((reg)>>2)))/* ----------------------------------------------------------- *//* cx88-core.c */extern void cx88_print_irqbits(char *name, char *tag, char **strings, u32 bits, u32 mask);extern void cx88_print_ioctl(char *name, unsigned int cmd);extern int cx88_core_irq(struct cx88_core *core, u32 status);extern void cx88_wakeup(struct cx88_core *core, struct cx88_dmaqueue *q, u32 count);extern void cx88_shutdown(struct cx88_core *core);extern int cx88_reset(struct cx88_core *core);extern intcx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, struct scatterlist *sglist, unsigned int top_offset, unsigned int bottom_offset, unsigned int bpl, unsigned int padding, unsigned int lines);extern intcx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, struct scatterlist *sglist, unsigned int bpl, unsigned int lines);extern intcx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, u32 reg, u32 mask, u32 value);extern voidcx88_free_buffer(struct pci_dev *pci, struct cx88_buffer *buf);extern void cx88_risc_disasm(struct cx88_core *core, struct btcx_riscmem *risc);extern int cx88_sram_channel_setup(struct cx88_core *core, struct sram_channel *ch, unsigned int bpl, u32 risc);extern void cx88_sram_channel_dump(struct cx88_core *core, struct sram_channel *ch);extern int cx88_set_scale(struct cx88_core *core, unsigned int width, unsigned int height, enum v4l2_field field);extern int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm);extern struct video_device *cx88_vdev_init(struct cx88_core *core, struct pci_dev *pci, struct video_device *template, char *type);extern struct cx88_core* cx88_core_get(struct pci_dev *pci);extern void cx88_core_put(struct cx88_core *core, struct pci_dev *pci);extern int cx88_start_audio_dma(struct cx88_core *core);extern int cx88_stop_audio_dma(struct cx88_core *core);/* ----------------------------------------------------------- *//* cx88-vbi.c */void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f);/*int cx8800_start_vbi_dma(struct cx8800_dev *dev, struct cx88_dmaqueue *q, struct cx88_buffer *buf);*/int cx8800_stop_vbi_dma(struct cx8800_dev *dev);int cx8800_restart_vbi_queue(struct cx8800_dev *dev, struct cx88_dmaqueue *q);void cx8800_vbi_timeout(unsigned long data);extern struct videobuf_queue_ops cx8800_vbi_qops;/* ----------------------------------------------------------- *//* cx88-i2c.c */extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci);extern void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg);/* ----------------------------------------------------------- *//* cx88-cards.c */extern struct cx88_board cx88_boards[];extern const unsigned int cx88_bcount;extern struct cx88_subid cx88_subids[];extern const unsigned int cx88_idcount;extern void cx88_card_list(struct cx88_core *core, struct pci_dev *pci);extern void cx88_card_setup(struct cx88_core *core);/* ----------------------------------------------------------- *//* cx88-tvaudio.c */#define WW_NONE 1#define WW_BTSC 2#define WW_BG 3#define WW_DK 4#define WW_I 5#define WW_L 6#define WW_EIAJ 7#define WW_I2SPT 8#define WW_FM 9void cx88_set_tvaudio(struct cx88_core *core);void cx88_newstation(struct cx88_core *core);void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t);void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual);int cx88_audio_thread(void *data);int cx88_detect_nicam(struct cx88_core *core);/* ----------------------------------------------------------- *//* cx88-input.c */int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci);int cx88_ir_fini(struct cx88_core *core);void cx88_ir_irq(struct cx88_core *core);/* ----------------------------------------------------------- *//* cx88-mpeg.c */int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf, enum v4l2_field field);void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf);void cx8802_cancel_buffers(struct cx8802_dev *dev);int cx8802_init_common(struct cx8802_dev *dev);void cx8802_fini_common(struct cx8802_dev *dev);int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state);int cx8802_resume_common(struct pci_dev *pci_dev);/* ----------------------------------------------------------- *//* cx88-video.c */extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl);/* ----------------------------------------------------------- *//* cx88-blackbird.c */extern int (*cx88_ioctl_hook)(struct inode *inode, struct file *file, unsigned int cmd, void *arg);extern unsigned int (*cx88_ioctl_translator)(unsigned int cmd);void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression *params);void blackbird_set_dnr_params(struct cx8802_dev *dev, struct blackbird_dnr* dnr_params);/* * Local variables: * c-basic-offset: 8 * End: * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -