cx88.h
来自「trident tm5600的linux驱动」· C头文件 代码 · 共 701 行 · 第 1/2 页
H
701 行
/* IR remote control state */ struct cx88_IR *ir; struct mutex lock; /* various v4l controls */ u32 freq; atomic_t users; /* cx88-video needs to access cx8802 for hybrid tuner pll access. */ struct cx8802_dev *dvbdev; enum cx88_board_type active_type_id; int active_ref; int active_fe_id;};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;#if 0 /* moved to cx88_core */ struct semaphore lock;#endif 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;#if 0 /* video overlay */ struct v4l2_framebuffer fbuf; struct cx88_buffer *screen;#endif /* capture queues */ struct cx88_dmaqueue vidq; struct cx88_dmaqueue vbiq; /* various v4l controls */#if 0 /* moved to cx88_core */ u32 freq;#endif /* 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;};struct cx8802_driver { struct cx88_core *core; /* List of drivers attached to device */ struct list_head drvlist; /* Type of driver and access required */ enum cx88_board_type type_id; enum cx8802_board_access hw_access; /* MPEG 8802 internal only */ int (*suspend)(struct pci_dev *pci_dev, pm_message_t state); int (*resume)(struct pci_dev *pci_dev); /* MPEG 8802 -> mini driver - Driver probe and configuration */ int (*probe)(struct cx8802_driver *drv); int (*remove)(struct cx8802_driver *drv); /* MPEG 8802 -> mini driver - Access for hardware control */ int (*advise_acquire)(struct cx8802_driver *drv); int (*advise_release)(struct cx8802_driver *drv); /* MPEG 8802 <- mini driver - Access for hardware control */ int (*request_acquire)(struct cx8802_driver *drv); int (*request_release)(struct cx8802_driver *drv);};struct cx8802_dev { struct cx88_core *core;#if 0 /* moved to cx88_core ? */ struct semaphore lock;#endif 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;#if defined(CONFIG_VIDEO_CX88_BLACKBIRD) || \ defined(CONFIG_VIDEO_CX88_BLACKBIRD_MODULE) struct video_device *mpeg_dev; u32 mailbox; int width; int height; unsigned char mpeg_active; /* nonzero if mpeg encoder is active */ /* mpeg params */ struct cx2341x_mpeg_params params;#endif#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) /* for dvb only */ struct videobuf_dvb_frontends frontends;#endif#if defined(CONFIG_VIDEO_CX88_VP3054) || \ defined(CONFIG_VIDEO_CX88_VP3054_MODULE) /* For VP3045 secondary I2C bus support */ struct vp3054_i2c_state *vp3054;#endif /* for switching modulation types */ unsigned char ts_gen_cntrl; /* List of attached drivers */ struct list_head drvlist; struct work_struct request_module_wk;};/* ----------------------------------------------------------- */#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, int len, u32 bits, u32 mask);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, unsigned int lpi);extern intcx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, u32 reg, u32 mask, u32 value);extern voidcx88_free_buffer(struct videobuf_queue *q, 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, v4l2_std_id 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 *//* Can be used as g_vbi_fmt, try_vbi_fmt and s_vbi_fmt */int cx8800_vbi_fmt (struct file *file, void *priv, 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 int cx88_tuner_callback(void *dev, int component, int command, int arg);extern int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci);extern struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr);extern void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl);/* ----------------------------------------------------------- *//* 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 9#define WW_I2SADC 10void 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 cx8802_register_driver(struct cx8802_driver *drv);int cx8802_unregister_driver(struct cx8802_driver *drv);struct cx8802_dev * cx8802_get_device(struct inode *inode);struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype);/* ----------------------------------------------------------- *//* 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);void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir);void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir);/* ----------------------------------------------------------- *//* cx88-mpeg.c */int cx8802_buf_prepare(struct videobuf_queue *q,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);/* ----------------------------------------------------------- *//* cx88-video.c*/extern const u32 cx88_user_ctrls[];extern int cx8800_ctrl_query(struct cx88_core *core, struct v4l2_queryctrl *qctrl);int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i);int cx88_set_freq (struct cx88_core *core,struct v4l2_frequency *f);int cx88_get_control(struct cx88_core *core, struct v4l2_control *ctl);int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl);int cx88_video_mux(struct cx88_core *core, unsigned int input);/* * 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 + =
减小字号Ctrl + -
显示快捷键?