aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-driver.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-23 09:13:15 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:06:48 -0400
commitfd8b281a2809d2bd9119df1fbd717ab2371297cd (patch)
treec5ebdbc3ba9febddded3d4cddd4deb0e75b9c027 /drivers/media/video/ivtv/ivtv-driver.h
parent33c0fcad2160bc211272295e862c6f708118d006 (diff)
V4L/DVB (6093): ivtv: reorganized and cleanup ivtv struct
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-driver.h')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h243
1 files changed, 122 insertions, 121 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index b9dfdab6636..2c27515d873 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -550,133 +550,134 @@ struct ivtv_card;
550 550
551/* Struct to hold info about ivtv cards */ 551/* Struct to hold info about ivtv cards */
552struct ivtv { 552struct ivtv {
553 int num; /* board number, -1 during init! */ 553 /* General fixed card data */
554 char name[8]; /* board name for printk and interrupts (e.g. 'ivtv0') */ 554 int num; /* board number, -1 during init! */
555 struct pci_dev *dev; /* PCI device */ 555 char name[8]; /* board name for printk and interrupts (e.g. 'ivtv0') */
556 struct pci_dev *dev; /* PCI device */
556 const struct ivtv_card *card; /* card information */ 557 const struct ivtv_card *card; /* card information */
557 const char *card_name; /* full name of the card */ 558 const char *card_name; /* full name of the card */
558 u8 has_cx23415; /* 1 if it is a cx23415 based card, 0 for cx23416 */ 559 u8 has_cx23415; /* 1 if it is a cx23415 based card, 0 for cx23416 */
559 u8 is_50hz; 560 u8 pvr150_workaround; /* 1 if the cx25840 needs to workaround a PVR150 bug */
560 u8 is_60hz; 561 u8 nof_inputs; /* number of video inputs */
561 u8 is_out_50hz; 562 u8 nof_audio_inputs; /* number of audio inputs */
562 u8 is_out_60hz; 563 u32 v4l2_cap; /* V4L2 capabilities of card */
563 u8 pvr150_workaround; /* 1 if the cx25840 needs to workaround a PVR150 bug */ 564 u32 hw_flags; /* hardware description of the board */
564 u8 nof_inputs; /* number of video inputs */ 565 int tunerid; /* userspace tuner ID for experimental Xceive tuner support */
565 u8 nof_audio_inputs; /* number of audio inputs */ 566 v4l2_std_id tuner_std; /* the norm of the card's tuner (fixed) */
566 u32 v4l2_cap; /* V4L2 capabilities of card */ 567 /* controlling video decoder function */
567 u32 hw_flags; /* Hardware description of the board */
568 int tunerid; /* Userspace tuner ID for experimental Xceive tuner support */
569
570 /* controlling Video decoder function */
571 int (*video_dec_func)(struct ivtv *, unsigned int, void *); 568 int (*video_dec_func)(struct ivtv *, unsigned int, void *);
569 u32 base_addr; /* PCI resource base address */
570 volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */
571 volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */
572 volatile void __iomem *reg_mem; /* pointer to mapped registers */
573 struct ivtv_options options; /* user options */
574
575
576 /* High-level state info */
577 unsigned long i_flags; /* global ivtv flags */
578 u8 is_50hz; /* 1 if the current capture standard is 50 Hz */
579 u8 is_60hz /* 1 if the current capture standard is 60 Hz */;
580 u8 is_out_50hz /* 1 if the current TV output standard is 50 Hz */;
581 u8 is_out_60hz /* 1 if the current TV output standard is 60 Hz */;
582 int output_mode; /* decoder output mode: NONE, MPG, YUV, UDMA YUV, passthrough */
583 u32 audio_input; /* current audio input */
584 u32 active_input; /* current video input */
585 u32 active_output; /* current video output */
586 v4l2_std_id std; /* current capture TV standard */
587 v4l2_std_id std_out; /* current TV output standard */
588 u8 audio_stereo_mode; /* decoder setting how to handle stereo MPEG audio */
589 u8 audio_bilingual_mode; /* decoder setting how to handle bilingual MPEG audio */
590 struct cx2341x_mpeg_params params; /* current encoder parameters */
591
592
593 /* Locking */
594 spinlock_t lock; /* lock access to this struct */
595 /* mutex used to serialize open/close/start/stop/ioctl operations */
596 struct mutex serialize_lock;
597
598
599 /* Streams */
600 int stream_buf_size[IVTV_MAX_STREAMS]; /* stream buffer size */
601 struct ivtv_stream streams[IVTV_MAX_STREAMS]; /* stream data */
602 atomic_t capturing; /* count number of active capture streams */
603 atomic_t decoding; /* count number of active decoding streams */
604
605
606 /* Interrupts & DMA */
607 u32 irqmask; /* active interrupts */
608 u32 irq_rr_idx; /* round-robin stream index */
609 struct workqueue_struct *irq_work_queues; /* workqueue for PIO/YUV/VBI actions */
610 struct work_struct irq_work_queue; /* work entry */
611 spinlock_t dma_reg_lock; /* lock access to DMA engine registers */
612 int cur_dma_stream; /* index of current stream doing DMA (-1 if none) */
613 int cur_pio_stream; /* index of current stream doing PIO (-1 if none) */
614 u32 dma_data_req_offset; /* store offset in decoder memory of current DMA request */
615 u32 dma_data_req_size; /* store size of current DMA request */
616 int dma_retries; /* current DMA retry attempt */
617 struct ivtv_user_dma udma; /* user based DMA for OSD */
618 struct timer_list dma_timer; /* timer used to catch unfinished DMAs */
619 u32 last_vsync_frame; /* last seen vsync field */
620 wait_queue_head_t dma_waitq; /* wake up when the current DMA is finished */
621 wait_queue_head_t eos_waitq; /* wake up when EOS arrives */
622 wait_queue_head_t event_waitq; /* wake up when the next decoder event arrives */
623 wait_queue_head_t vsync_waitq; /* wake up when the next decoder vsync arrives */
624
625
626 /* Mailbox */
627 struct ivtv_mailbox_data enc_mbox; /* encoder mailboxes */
628 struct ivtv_mailbox_data dec_mbox; /* decoder mailboxes */
629 struct ivtv_api_cache api_cache[256]; /* cached API commands */
630
631
632 /* I2C */
633 struct i2c_adapter i2c_adap;
634 struct i2c_algo_bit_data i2c_algo;
635 struct i2c_client i2c_client;
636 struct i2c_client *i2c_clients[I2C_CLIENTS_MAX];/* pointers to all I2C clients */
637 int i2c_state; /* i2c bit state */
638 struct mutex i2c_bus_lock; /* lock i2c bus */
639
640
641 /* Program Index information */
642 u32 pgm_info_offset; /* start of pgm info in encoder memory */
643 u32 pgm_info_num; /* number of elements in the pgm cyclic buffer in encoder memory */
644 u32 pgm_info_write_idx; /* last index written by the card that was transferred to pgm_info[] */
645 u32 pgm_info_read_idx; /* last index in pgm_info read by the application */
646 struct v4l2_enc_idx_entry pgm_info[IVTV_MAX_PGM_INDEX]; /* filled from the pgm cyclic buffer on the card */
647
648
649 /* Miscellaneous */
650 u32 open_id; /* incremented each time an open occurs, is >= 1 */
651 struct v4l2_prio_state prio; /* priority state */
652 int search_pack_header; /* 1 if ivtv_copy_buf_to_user() is scanning for a pack header (0xba) */
653 int speed; /* current playback speed setting */
654 u8 speed_mute_audio; /* 1 if audio should be muted when fast forward */
655 u64 mpg_data_received; /* number of bytes received from the MPEG stream */
656 u64 vbi_data_inserted; /* number of VBI bytes inserted into the MPEG stream */
657 u32 last_dec_timing[3]; /* cache last retrieved pts/scr/frame values */
658 unsigned long dualwatch_jiffies;/* jiffies value of the previous dualwatch check */
659 u16 dualwatch_stereo_mode; /* current detected dualwatch stereo mode */
660
661
662 /* VBI state info */
663 struct vbi_info vbi; /* VBI-specific data */
664
665
666 /* YUV playback */
667 struct yuv_playback_info yuv_info; /* YUV playback data */
572 668
573 struct ivtv_options options; /* User options */
574 int stream_buf_size[IVTV_MAX_STREAMS]; /* Stream buffer size */
575 struct ivtv_stream streams[IVTV_MAX_STREAMS]; /* Stream data */
576 int speed;
577 u8 speed_mute_audio;
578 unsigned long i_flags; /* global ivtv flags */
579 atomic_t capturing; /* count number of active capture streams */
580 atomic_t decoding; /* count number of active decoding streams */
581 u32 irq_rr_idx; /* Round-robin stream index */
582 int cur_dma_stream; /* index of stream doing DMA */
583 int cur_pio_stream; /* index of stream doing PIO */
584 u32 dma_data_req_offset;
585 u32 dma_data_req_size;
586 int dma_retries;
587 int output_mode; /* NONE, MPG, YUV, UDMA YUV, passthrough */
588 spinlock_t lock; /* lock access to this struct */
589 int search_pack_header;
590
591 spinlock_t dma_reg_lock; /* lock access to DMA engine registers */
592 struct mutex serialize_lock; /* lock used to serialize starting streams */
593
594 /* User based DMA for OSD */
595 struct ivtv_user_dma udma;
596
597 int open_id; /* incremented each time an open occurs, used as unique ID.
598 starts at 1, so 0 can be used as uninitialized value
599 in the stream->id. */
600
601 u32 base_addr;
602 u32 irqmask;
603
604 struct v4l2_prio_state prio;
605 struct workqueue_struct *irq_work_queues;
606 struct work_struct irq_work_queue;
607 struct timer_list dma_timer; /* Timer used to catch unfinished DMAs */
608
609 struct vbi_info vbi;
610
611 struct ivtv_mailbox_data enc_mbox;
612 struct ivtv_mailbox_data dec_mbox;
613 struct ivtv_api_cache api_cache[256]; /* Cached API Commands */
614
615 u8 card_rev;
616 volatile void __iomem *enc_mem, *dec_mem, *reg_mem;
617
618 u32 pgm_info_offset;
619 u32 pgm_info_num;
620 u32 pgm_info_write_idx;
621 u32 pgm_info_read_idx;
622 struct v4l2_enc_idx_entry pgm_info[IVTV_MAX_PGM_INDEX];
623
624 u64 mpg_data_received;
625 u64 vbi_data_inserted;
626
627 wait_queue_head_t cap_w;
628 /* when the next decoder event arrives this queue is woken up */
629 wait_queue_head_t event_waitq;
630 /* when the next decoder vsync arrives this queue is woken up */
631 wait_queue_head_t vsync_waitq;
632 /* when the current DMA is finished this queue is woken up */
633 wait_queue_head_t dma_waitq;
634 669
635 /* OSD support */ 670 /* OSD support */
636 unsigned long osd_video_pbase; 671 unsigned long osd_video_pbase;
637 int osd_global_alpha_state; /* 0=off : 1=on */ 672 int osd_global_alpha_state; /* 1 = global alpha is on */
638 int osd_local_alpha_state; /* 0=off : 1=on */ 673 int osd_local_alpha_state; /* 1 = local alpha is on */
639 int osd_color_key_state; /* 0=off : 1=on */ 674 int osd_chroma_key_state; /* 1 = chroma-keying is on */
640 u8 osd_global_alpha; /* Current global alpha */ 675 u8 osd_global_alpha; /* current global alpha */
641 u32 osd_color_key; /* Current color key */ 676 u32 osd_chroma_key; /* current chroma key */
642 u32 osd_pixelformat; /* Current pixel format */ 677 u32 osd_pixelformat; /* current pixel format */
643 struct v4l2_rect osd_rect; /* Current OSD position and size */ 678 struct v4l2_rect osd_rect; /* current OSD position and size */
644 struct v4l2_rect main_rect; /* Current Main window position and size */ 679 struct v4l2_rect main_rect; /* current Main window position and size */
645 680 struct osd_info *osd_info; /* ivtv-fb private OSD info */
646 u32 last_dec_timing[3]; /* Store last retrieved pts/scr/frame values */
647
648 /* i2c */
649 struct i2c_adapter i2c_adap;
650 struct i2c_algo_bit_data i2c_algo;
651 struct i2c_client i2c_client;
652 struct mutex i2c_bus_lock;
653 int i2c_state;
654 struct i2c_client *i2c_clients[I2C_CLIENTS_MAX];
655
656 /* v4l2 and User settings */
657
658 /* codec settings */
659 struct cx2341x_mpeg_params params;
660 u32 audio_input;
661 u32 active_input;
662 u32 active_output;
663 v4l2_std_id std;
664 v4l2_std_id std_out;
665 v4l2_std_id tuner_std; /* The norm of the tuner (fixed) */
666 u8 audio_stereo_mode;
667 u8 audio_bilingual_mode;
668
669 /* dualwatch */
670 unsigned long dualwatch_jiffies;
671 u16 dualwatch_stereo_mode;
672
673 /* Digitizer type */
674 int digitizer; /* 0x00EF = saa7114 0x00FO = saa7115 0x0106 = mic */
675
676 u32 lastVsyncFrame;
677
678 struct yuv_playback_info yuv_info;
679 struct osd_info *osd_info;
680}; 681};
681 682
682/* Globals */ 683/* Globals */