diff options
Diffstat (limited to 'drivers/staging/cx25821/cx25821.h')
-rw-r--r-- | drivers/staging/cx25821/cx25821.h | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/drivers/staging/cx25821/cx25821.h b/drivers/staging/cx25821/cx25821.h index cf2286d83b6a..c94000125782 100644 --- a/drivers/staging/cx25821/cx25821.h +++ b/drivers/staging/cx25821/cx25821.h @@ -61,7 +61,7 @@ #define FALSE 0 #define LINE_SIZE_D1 1440 -// Number of decoders and encoders +/* Number of decoders and encoders */ #define MAX_DECODERS 8 #define MAX_ENCODERS 2 #define QUAD_DECODERS 4 @@ -91,10 +91,10 @@ /* Currently supported by the driver */ #define CX25821_NORMS (\ - V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR | \ - V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_I | \ - V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_H | \ - V4L2_STD_PAL_Nc ) + V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR | \ + V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_I | \ + V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_H | \ + V4L2_STD_PAL_Nc) #define CX25821_BOARD_CONEXANT_ATHENA10 1 #define MAX_VID_CHANNEL_NUM 12 @@ -139,6 +139,7 @@ struct cx25821_fh { /* video capture */ struct cx25821_fmt *fmt; unsigned int width, height; + int channel_id; /* vbi capture */ struct videobuf_queue vidq; @@ -236,13 +237,33 @@ struct cx25821_data { struct sram_channel *channel; }; +struct cx25821_channel { + struct v4l2_prio_state prio; + + int ctl_bright; + int ctl_contrast; + int ctl_hue; + int ctl_saturation; + struct cx25821_data timeout_data; + + struct video_device *video_dev; + struct cx25821_dmaqueue vidq; + + struct sram_channel *sram_channels; + + struct mutex lock; + int resources; + + int pixel_formats; + int use_cif_resolution; + int cif_width; +}; + struct cx25821_dev { struct list_head devlist; atomic_t refcount; struct v4l2_device v4l2_dev; - struct v4l2_prio_state prio; - /* pci stuff */ struct pci_dev *pci; unsigned char pci_rev, pci_lat; @@ -261,13 +282,12 @@ struct cx25821_dev { int nr; struct mutex lock; + struct cx25821_channel channels[MAX_VID_CHANNEL_NUM]; + /* board details */ unsigned int board; char name[32]; - /* sram configuration */ - struct sram_channel *sram_channels; - /* Analog video */ u32 resources; unsigned int input; @@ -282,13 +302,6 @@ struct cx25821_dev { unsigned char videc_addr; unsigned short _max_num_decoders; - int ctl_bright; - int ctl_contrast; - int ctl_hue; - int ctl_saturation; - - struct cx25821_data timeout_data[MAX_VID_CHANNEL_NUM]; - /* Analog Audio Upstream */ int _audio_is_running; int _audiopixel_format; @@ -297,7 +310,7 @@ struct cx25821_dev { int _audio_lines_count; int _audioframe_count; int _audio_upstream_channel_select; - int _last_index_irq; //The last interrupt index processed. + int _last_index_irq; /* The last interrupt index processed. */ __le32 *_risc_audio_jmp_addr; __le32 *_risc_virt_start_addr; @@ -313,12 +326,10 @@ struct cx25821_dev { /* V4l */ u32 freq; - struct video_device *video_dev[MAX_VID_CHANNEL_NUM]; struct video_device *vbi_dev; struct video_device *radio_dev; struct video_device *ioctl_dev; - struct cx25821_dmaqueue vidq[MAX_VID_CHANNEL_NUM]; spinlock_t slock; /* Video Upstream */ @@ -401,9 +412,6 @@ struct cx25821_dev { int pixel_format; int channel_select; int command; - int pixel_formats[VID_CHANNEL_NUM]; - int use_cif_resolution[VID_CHANNEL_NUM]; - int cif_width[VID_CHANNEL_NUM]; int channel_opened; }; @@ -434,7 +442,7 @@ static inline struct cx25821_dev *get_cx25821(struct v4l2_device *v4l2_dev) } #define cx25821_call_all(dev, o, f, args...) \ - v4l2_device_call_all(&dev->v4l2_dev, 0, o, f, ##args) + v4l2_device_call_all(&dev->v4l2_dev, 0, o, f, ##args) extern struct list_head cx25821_devlist; extern struct cx25821_board cx25821_boards[]; @@ -482,7 +490,7 @@ struct sram_channel { u32 fld_aud_fifo_en; u32 fld_aud_risc_en; - //For Upstream Video + /* For Upstream Video */ u32 vid_fmt_ctl; u32 vid_active_ctl1; u32 vid_active_ctl2; @@ -502,8 +510,8 @@ extern struct sram_channel cx25821_sram_channels[]; #define cx_write(reg, value) writel((value), dev->lmmio + ((reg)>>2)) #define cx_andor(reg, mask, value) \ - writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\ - ((value) & (mask)), dev->lmmio+((reg)>>2)) + writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\ + ((value) & (mask)), dev->lmmio+((reg)>>2)) #define cx_set(reg, bit) cx_andor((reg), (bit), (bit)) #define cx_clear(reg, bit) cx_andor((reg), (bit), 0) |