Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Driver for the Conexant CX25821 PCIe bridge |
| 3 | * |
| 4 | * Copyright (C) 2009 Conexant Systems Inc. |
| 5 | * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com> |
| 6 | * Based on Steven Toth <stoth@linuxtv.org> cx23885 driver |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ |
| 23 | |
| 24 | |
| 25 | #ifndef CX25821_H_ |
| 26 | #define CX25821_H_ |
| 27 | |
| 28 | #include <linux/pci.h> |
| 29 | #include <linux/i2c.h> |
| 30 | #include <linux/i2c-algo-bit.h> |
| 31 | #include <linux/interrupt.h> |
| 32 | #include <linux/delay.h> |
| 33 | #include <linux/sched.h> |
| 34 | #include <linux/kdev_t.h> |
Mauro Carvalho Chehab | 466a1c15 | 2009-09-13 11:24:22 -0300 | [diff] [blame^] | 35 | #include <linux/smp_lock.h> |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 36 | |
| 37 | #include <media/v4l2-common.h> |
| 38 | #include <media/v4l2-device.h> |
| 39 | #include <media/tuner.h> |
| 40 | #include <media/tveeprom.h> |
| 41 | #include <media/videobuf-dma-sg.h> |
| 42 | #include <media/videobuf-dvb.h> |
| 43 | |
| 44 | #include "btcx-risc.h" |
| 45 | #include "cx25821-reg.h" |
| 46 | #include "cx25821-medusa-reg.h" |
| 47 | #include "cx25821-sram.h" |
| 48 | #include "cx25821-audio.h" |
| 49 | #include "media/cx2341x.h" |
| 50 | |
| 51 | #include <linux/version.h> |
| 52 | #include <linux/mutex.h> |
| 53 | |
| 54 | #define CX25821_VERSION_CODE KERNEL_VERSION(0, 0, 106) |
| 55 | |
| 56 | #define UNSET (-1U) |
| 57 | #define NO_SYNC_LINE (-1U) |
| 58 | |
| 59 | #define CX25821_MAXBOARDS 2 |
| 60 | |
| 61 | #define TRUE 1 |
| 62 | #define FALSE 0 |
| 63 | #define LINE_SIZE_D1 1440 |
| 64 | |
| 65 | // Number of decoders and encoders |
| 66 | #define MAX_DECODERS 8 |
| 67 | #define MAX_ENCODERS 2 |
| 68 | #define QUAD_DECODERS 4 |
| 69 | #define MAX_CAMERAS 16 |
| 70 | |
| 71 | /* Max number of inputs by card */ |
| 72 | #define MAX_CX25821_INPUT 8 |
| 73 | #define INPUT(nr) (&cx25821_boards[dev->board].input[nr]) |
| 74 | #define RESOURCE_VIDEO0 1 |
| 75 | #define RESOURCE_VIDEO1 2 |
| 76 | #define RESOURCE_VIDEO2 4 |
| 77 | #define RESOURCE_VIDEO3 8 |
| 78 | #define RESOURCE_VIDEO4 16 |
| 79 | #define RESOURCE_VIDEO5 32 |
| 80 | #define RESOURCE_VIDEO6 64 |
| 81 | #define RESOURCE_VIDEO7 128 |
| 82 | #define RESOURCE_VIDEO8 256 |
| 83 | #define RESOURCE_VIDEO9 512 |
| 84 | #define RESOURCE_VIDEO10 1024 |
| 85 | #define RESOURCE_VIDEO11 2048 |
| 86 | #define RESOURCE_VIDEO_IOCTL 4096 |
| 87 | |
| 88 | |
| 89 | #define BUFFER_TIMEOUT (HZ) /* 0.5 seconds */ |
| 90 | |
| 91 | #define UNKNOWN_BOARD 0 |
| 92 | #define CX25821_BOARD 1 |
| 93 | |
| 94 | /* Currently supported by the driver */ |
| 95 | #define CX25821_NORMS (\ |
| 96 | V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR | \ |
| 97 | V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_I | \ |
| 98 | V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_H | \ |
| 99 | V4L2_STD_PAL_Nc ) |
| 100 | |
| 101 | #define CX25821_BOARD_CONEXANT_ATHENA10 1 |
| 102 | #define MAX_VID_CHANNEL_NUM 12 |
| 103 | #define VID_CHANNEL_NUM 8 |
| 104 | |
| 105 | struct cx25821_fmt { |
| 106 | char *name; |
| 107 | u32 fourcc; /* v4l2 format id */ |
| 108 | int depth; |
| 109 | int flags; |
| 110 | u32 cxformat; |
| 111 | }; |
| 112 | |
| 113 | struct cx25821_ctrl { |
| 114 | struct v4l2_queryctrl v; |
| 115 | u32 off; |
| 116 | u32 reg; |
| 117 | u32 mask; |
| 118 | u32 shift; |
| 119 | }; |
| 120 | |
| 121 | struct cx25821_tvnorm { |
| 122 | char *name; |
| 123 | v4l2_std_id id; |
| 124 | u32 cxiformat; |
| 125 | u32 cxoformat; |
| 126 | }; |
| 127 | |
| 128 | struct cx25821_fh { |
| 129 | struct cx25821_dev *dev; |
| 130 | enum v4l2_buf_type type; |
| 131 | int radio; |
| 132 | u32 resources; |
| 133 | |
| 134 | enum v4l2_priority prio; |
| 135 | |
| 136 | /* video overlay */ |
| 137 | struct v4l2_window win; |
| 138 | struct v4l2_clip *clips; |
| 139 | unsigned int nclips; |
| 140 | |
| 141 | /* video capture */ |
| 142 | struct cx25821_fmt *fmt; |
| 143 | unsigned int width, height; |
| 144 | |
| 145 | /* vbi capture */ |
| 146 | struct videobuf_queue vidq; |
| 147 | struct videobuf_queue vbiq; |
| 148 | |
| 149 | /* H264 Encoder specifics ONLY */ |
| 150 | struct videobuf_queue mpegq; |
| 151 | atomic_t v4l_reading; |
| 152 | }; |
| 153 | |
| 154 | enum cx25821_itype { |
| 155 | CX25821_VMUX_COMPOSITE = 1, |
| 156 | CX25821_VMUX_SVIDEO, |
| 157 | CX25821_VMUX_DEBUG, |
| 158 | CX25821_RADIO, |
| 159 | }; |
| 160 | |
| 161 | enum cx25821_src_sel_type { |
| 162 | CX25821_SRC_SEL_EXT_656_VIDEO = 0, |
| 163 | CX25821_SRC_SEL_PARALLEL_MPEG_VIDEO |
| 164 | }; |
| 165 | |
| 166 | /* buffer for one video frame */ |
| 167 | struct cx25821_buffer { |
| 168 | /* common v4l buffer stuff -- must be first */ |
| 169 | struct videobuf_buffer vb; |
| 170 | |
| 171 | /* cx25821 specific */ |
| 172 | unsigned int bpl; |
| 173 | struct btcx_riscmem risc; |
| 174 | struct cx25821_fmt *fmt; |
| 175 | u32 count; |
| 176 | }; |
| 177 | |
| 178 | struct cx25821_input { |
| 179 | enum cx25821_itype type; |
| 180 | unsigned int vmux; |
| 181 | u32 gpio0, gpio1, gpio2, gpio3; |
| 182 | }; |
| 183 | |
| 184 | typedef enum { |
| 185 | CX25821_UNDEFINED = 0, |
| 186 | CX25821_RAW, |
| 187 | CX25821_264 |
| 188 | } port_t; |
| 189 | |
| 190 | struct cx25821_board { |
| 191 | char *name; |
| 192 | port_t porta, portb, portc; |
| 193 | unsigned int tuner_type; |
| 194 | unsigned int radio_type; |
| 195 | unsigned char tuner_addr; |
| 196 | unsigned char radio_addr; |
| 197 | |
| 198 | u32 clk_freq; |
| 199 | struct cx25821_input input[2]; |
| 200 | }; |
| 201 | |
| 202 | struct cx25821_subid { |
| 203 | u16 subvendor; |
| 204 | u16 subdevice; |
| 205 | u32 card; |
| 206 | }; |
| 207 | |
| 208 | struct cx25821_i2c { |
| 209 | struct cx25821_dev *dev; |
| 210 | |
| 211 | int nr; |
| 212 | |
| 213 | /* i2c i/o */ |
| 214 | struct i2c_adapter i2c_adap; |
| 215 | struct i2c_algo_bit_data i2c_algo; |
| 216 | struct i2c_client i2c_client; |
| 217 | u32 i2c_rc; |
| 218 | |
| 219 | /* cx25821 registers used for raw addess */ |
| 220 | u32 i2c_period; |
| 221 | u32 reg_ctrl; |
| 222 | u32 reg_stat; |
| 223 | u32 reg_addr; |
| 224 | u32 reg_rdata; |
| 225 | u32 reg_wdata; |
| 226 | }; |
| 227 | |
| 228 | struct cx25821_dmaqueue { |
| 229 | struct list_head active; |
| 230 | struct list_head queued; |
| 231 | struct timer_list timeout; |
| 232 | struct btcx_riscmem stopper; |
| 233 | u32 count; |
| 234 | }; |
| 235 | |
| 236 | struct cx25821_data { |
| 237 | struct cx25821_dev *dev; |
| 238 | struct sram_channel *channel; |
| 239 | }; |
| 240 | |
| 241 | struct cx25821_dev { |
| 242 | struct list_head devlist; |
| 243 | atomic_t refcount; |
| 244 | struct v4l2_device v4l2_dev; |
| 245 | |
| 246 | struct v4l2_prio_state prio; |
| 247 | |
| 248 | /* pci stuff */ |
| 249 | struct pci_dev *pci; |
| 250 | unsigned char pci_rev, pci_lat; |
| 251 | int pci_bus, pci_slot; |
| 252 | u32 base_io_addr; |
| 253 | u32 __iomem *lmmio; |
| 254 | u8 __iomem *bmmio; |
| 255 | int pci_irqmask; |
| 256 | int hwrevision; |
| 257 | |
| 258 | u32 clk_freq; |
| 259 | |
| 260 | /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */ |
| 261 | struct cx25821_i2c i2c_bus[3]; |
| 262 | |
| 263 | int nr; |
| 264 | struct mutex lock; |
| 265 | |
| 266 | /* board details */ |
| 267 | unsigned int board; |
| 268 | char name[32]; |
| 269 | |
| 270 | /* sram configuration */ |
| 271 | struct sram_channel *sram_channels; |
| 272 | |
| 273 | /* Analog video */ |
| 274 | u32 resources; |
| 275 | unsigned int input; |
| 276 | u32 tvaudio; |
| 277 | v4l2_std_id tvnorm; |
| 278 | unsigned int tuner_type; |
| 279 | unsigned char tuner_addr; |
| 280 | unsigned int radio_type; |
| 281 | unsigned char radio_addr; |
| 282 | unsigned int has_radio; |
| 283 | unsigned int videc_type; |
| 284 | unsigned char videc_addr; |
| 285 | unsigned short _max_num_decoders; |
| 286 | |
| 287 | int ctl_bright; |
| 288 | int ctl_contrast; |
| 289 | int ctl_hue; |
| 290 | int ctl_saturation; |
| 291 | |
| 292 | struct cx25821_data timeout_data[MAX_VID_CHANNEL_NUM]; |
| 293 | |
| 294 | /* Analog Audio Upstream */ |
| 295 | int _audio_is_running; |
| 296 | int _audiopixel_format; |
| 297 | int _is_first_audio_frame; |
| 298 | int _audiofile_status; |
| 299 | int _audio_lines_count; |
| 300 | int _audioframe_count; |
| 301 | int _audio_upstream_channel_select; |
| 302 | int _last_index_irq; //The last interrupt index processed. |
| 303 | |
| 304 | __le32 * _risc_audio_jmp_addr; |
| 305 | __le32 * _risc_virt_start_addr; |
| 306 | __le32 * _risc_virt_addr; |
| 307 | dma_addr_t _risc_phys_addr; |
| 308 | dma_addr_t _risc_phys_start_addr; |
| 309 | |
| 310 | unsigned int _audiorisc_size; |
| 311 | unsigned int _audiodata_buf_size; |
| 312 | __le32 * _audiodata_buf_virt_addr; |
| 313 | dma_addr_t _audiodata_buf_phys_addr; |
| 314 | char *_audiofilename; |
| 315 | |
| 316 | /* V4l */ |
| 317 | u32 freq; |
| 318 | struct video_device *video_dev[MAX_VID_CHANNEL_NUM]; |
| 319 | struct video_device *vbi_dev; |
| 320 | struct video_device *radio_dev; |
| 321 | struct video_device *ioctl_dev; |
| 322 | |
| 323 | struct cx25821_dmaqueue vidq[MAX_VID_CHANNEL_NUM]; |
| 324 | spinlock_t slock; |
| 325 | |
| 326 | /* Video Upstream */ |
| 327 | int _line_size; |
| 328 | int _prog_cnt; |
| 329 | int _pixel_format; |
| 330 | int _is_first_frame; |
| 331 | int _is_running; |
| 332 | int _file_status; |
| 333 | int _lines_count; |
| 334 | int _frame_count; |
| 335 | int _channel_upstream_select; |
| 336 | unsigned int _risc_size; |
| 337 | |
| 338 | __le32 * _dma_virt_start_addr; |
| 339 | __le32 * _dma_virt_addr; |
| 340 | dma_addr_t _dma_phys_addr; |
| 341 | dma_addr_t _dma_phys_start_addr; |
| 342 | |
| 343 | unsigned int _data_buf_size; |
| 344 | __le32 * _data_buf_virt_addr; |
| 345 | dma_addr_t _data_buf_phys_addr; |
| 346 | char * _filename; |
| 347 | char * _defaultname; |
| 348 | |
| 349 | |
| 350 | int _line_size_ch2; |
| 351 | int _prog_cnt_ch2; |
| 352 | int _pixel_format_ch2; |
| 353 | int _is_first_frame_ch2; |
| 354 | int _is_running_ch2; |
| 355 | int _file_status_ch2; |
| 356 | int _lines_count_ch2; |
| 357 | int _frame_count_ch2; |
| 358 | int _channel2_upstream_select; |
| 359 | unsigned int _risc_size_ch2; |
| 360 | |
| 361 | __le32 * _dma_virt_start_addr_ch2; |
| 362 | __le32 * _dma_virt_addr_ch2; |
| 363 | dma_addr_t _dma_phys_addr_ch2; |
| 364 | dma_addr_t _dma_phys_start_addr_ch2; |
| 365 | |
| 366 | unsigned int _data_buf_size_ch2; |
| 367 | __le32 * _data_buf_virt_addr_ch2; |
| 368 | dma_addr_t _data_buf_phys_addr_ch2; |
| 369 | char * _filename_ch2; |
| 370 | char * _defaultname_ch2; |
| 371 | |
| 372 | /* MPEG Encoder ONLY settings */ |
| 373 | u32 cx23417_mailbox; |
| 374 | struct cx2341x_mpeg_params mpeg_params; |
| 375 | struct video_device *v4l_device; |
| 376 | atomic_t v4l_reader_count; |
| 377 | struct cx25821_tvnorm encodernorm; |
| 378 | |
| 379 | u32 upstream_riscbuf_size; |
| 380 | u32 upstream_databuf_size; |
| 381 | u32 upstream_riscbuf_size_ch2; |
| 382 | u32 upstream_databuf_size_ch2; |
| 383 | u32 audio_upstream_riscbuf_size; |
| 384 | u32 audio_upstream_databuf_size; |
| 385 | int _isNTSC; |
| 386 | int _frame_index; |
| 387 | int _audioframe_index; |
| 388 | struct workqueue_struct * _irq_queues; |
| 389 | struct work_struct _irq_work_entry; |
| 390 | struct workqueue_struct * _irq_queues_ch2; |
| 391 | struct work_struct _irq_work_entry_ch2; |
| 392 | struct workqueue_struct * _irq_audio_queues; |
| 393 | struct work_struct _audio_work_entry; |
| 394 | char *input_filename; |
| 395 | char *input_filename_ch2; |
| 396 | int _frame_index_ch2; |
| 397 | int _isNTSC_ch2; |
| 398 | char *vid_stdname_ch2; |
| 399 | int pixel_format_ch2; |
| 400 | int channel_select_ch2; |
| 401 | int command_ch2; |
| 402 | char *input_audiofilename; |
| 403 | char *vid_stdname; |
| 404 | int pixel_format; |
| 405 | int channel_select; |
| 406 | int command; |
| 407 | int pixel_formats[VID_CHANNEL_NUM]; |
| 408 | int use_cif_resolution[VID_CHANNEL_NUM]; |
| 409 | int cif_width[VID_CHANNEL_NUM]; |
| 410 | int channel_opened; |
| 411 | }; |
| 412 | |
| 413 | |
| 414 | struct upstream_user_struct { |
| 415 | char *input_filename; |
| 416 | char *vid_stdname; |
| 417 | int pixel_format; |
| 418 | int channel_select; |
| 419 | int command; |
| 420 | }; |
| 421 | |
| 422 | struct downstream_user_struct { |
| 423 | char *vid_stdname; |
| 424 | int pixel_format; |
| 425 | int cif_resolution_enable; |
| 426 | int cif_width; |
| 427 | int decoder_select; |
| 428 | int command; |
| 429 | int reg_address; |
| 430 | int reg_data; |
| 431 | }; |
| 432 | |
| 433 | extern struct upstream_user_struct *up_data; |
| 434 | |
| 435 | static inline struct cx25821_dev *get_cx25821(struct v4l2_device *v4l2_dev) |
| 436 | { |
| 437 | return container_of(v4l2_dev, struct cx25821_dev, v4l2_dev); |
| 438 | } |
| 439 | |
| 440 | #define cx25821_call_all(dev, o, f, args...) \ |
| 441 | v4l2_device_call_all(&dev->v4l2_dev, 0, o, f, ##args) |
| 442 | |
| 443 | extern struct list_head cx25821_devlist; |
| 444 | extern struct cx25821_board cx25821_boards[]; |
| 445 | extern struct cx25821_subid cx25821_subids[]; |
| 446 | |
| 447 | #define SRAM_CH00 0 /* Video A */ |
| 448 | #define SRAM_CH01 1 /* Video B */ |
| 449 | #define SRAM_CH02 2 /* Video C */ |
| 450 | #define SRAM_CH03 3 /* Video D */ |
| 451 | #define SRAM_CH04 4 /* Video E */ |
| 452 | #define SRAM_CH05 5 /* Video F */ |
| 453 | #define SRAM_CH06 6 /* Video G */ |
| 454 | #define SRAM_CH07 7 /* Video H */ |
| 455 | |
| 456 | #define SRAM_CH08 8 /* Audio A */ |
| 457 | #define SRAM_CH09 9 /* Video Upstream I */ |
| 458 | #define SRAM_CH10 10 /* Video Upstream J */ |
| 459 | #define SRAM_CH11 11 /* Audio Upstream AUD_CHANNEL_B */ |
| 460 | |
| 461 | |
| 462 | |
| 463 | #define VID_UPSTREAM_SRAM_CHANNEL_I SRAM_CH09 |
| 464 | #define VID_UPSTREAM_SRAM_CHANNEL_J SRAM_CH10 |
| 465 | #define AUDIO_UPSTREAM_SRAM_CHANNEL_B SRAM_CH11 |
| 466 | #define VIDEO_IOCTL_CH 11 |
| 467 | |
| 468 | struct sram_channel { |
| 469 | char *name; |
| 470 | u32 i; |
| 471 | u32 cmds_start; |
| 472 | u32 ctrl_start; |
| 473 | u32 cdt; |
| 474 | u32 fifo_start; |
| 475 | u32 fifo_size; |
| 476 | u32 ptr1_reg; |
| 477 | u32 ptr2_reg; |
| 478 | u32 cnt1_reg; |
| 479 | u32 cnt2_reg; |
| 480 | u32 int_msk; |
| 481 | u32 int_stat; |
| 482 | u32 int_mstat; |
| 483 | u32 dma_ctl; |
| 484 | u32 gpcnt_ctl; |
| 485 | u32 gpcnt; |
| 486 | u32 aud_length; |
| 487 | u32 aud_cfg; |
| 488 | u32 fld_aud_fifo_en; |
| 489 | u32 fld_aud_risc_en; |
| 490 | |
| 491 | //For Upstream Video |
| 492 | u32 vid_fmt_ctl; |
| 493 | u32 vid_active_ctl1; |
| 494 | u32 vid_active_ctl2; |
| 495 | u32 vid_cdt_size; |
| 496 | |
| 497 | u32 vip_ctl; |
| 498 | u32 pix_frmt; |
| 499 | u32 jumponly; |
| 500 | u32 irq_bit; |
| 501 | }; |
| 502 | extern struct sram_channel cx25821_sram_channels[]; |
| 503 | |
| 504 | #define STATUS_SUCCESS 0 |
| 505 | #define STATUS_UNSUCCESSFUL -1 |
| 506 | |
| 507 | #define cx_read(reg) readl(dev->lmmio + ((reg)>>2)) |
| 508 | #define cx_write(reg, value) writel((value), dev->lmmio + ((reg)>>2)) |
| 509 | |
| 510 | #define cx_andor(reg, mask, value) \ |
| 511 | writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\ |
| 512 | ((value) & (mask)), dev->lmmio+((reg)>>2)) |
| 513 | |
| 514 | #define cx_set(reg, bit) cx_andor((reg), (bit), (bit)) |
| 515 | #define cx_clear(reg, bit) cx_andor((reg), (bit), 0) |
| 516 | |
| 517 | #define Set_GPIO_Bit(Bit) (1 << Bit) |
| 518 | #define Clear_GPIO_Bit(Bit) (~(1 << Bit)) |
| 519 | |
| 520 | #define CX25821_ERR(fmt, args...) printk(KERN_ERR "cx25821(%d): " fmt, dev->board, ## args) |
| 521 | #define CX25821_WARN(fmt, args...) printk(KERN_WARNING "cx25821(%d): " fmt, dev->board , ## args) |
| 522 | #define CX25821_INFO(fmt, args...) printk(KERN_INFO "cx25821(%d): " fmt, dev->board , ## args) |
| 523 | |
| 524 | extern int cx25821_i2c_register(struct cx25821_i2c *bus); |
| 525 | extern void cx25821_card_setup(struct cx25821_dev *dev); |
| 526 | extern int cx25821_ir_init(struct cx25821_dev *dev); |
| 527 | extern int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value); |
| 528 | extern int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value); |
| 529 | extern int cx25821_i2c_unregister(struct cx25821_i2c *bus); |
| 530 | extern void cx25821_gpio_init(struct cx25821_dev *dev); |
| 531 | extern void cx25821_set_gpiopin_direction( struct cx25821_dev *dev, |
| 532 | int pin_number, |
| 533 | int pin_logic_value); |
| 534 | |
| 535 | extern int medusa_video_init(struct cx25821_dev *dev); |
| 536 | extern int medusa_set_videostandard(struct cx25821_dev *dev); |
| 537 | extern void medusa_set_resolution(struct cx25821_dev *dev, int width, int decoder_select); |
| 538 | extern int medusa_set_brightness(struct cx25821_dev *dev, int brightness, int decoder); |
| 539 | extern int medusa_set_contrast(struct cx25821_dev *dev, int contrast, int decoder); |
| 540 | extern int medusa_set_hue(struct cx25821_dev *dev, int hue, int decoder); |
| 541 | extern int medusa_set_saturation(struct cx25821_dev *dev, int saturation, int decoder); |
| 542 | |
| 543 | extern int cx25821_sram_channel_setup(struct cx25821_dev *dev, struct sram_channel *ch, unsigned int bpl, u32 risc); |
| 544 | |
| 545 | extern int cx25821_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, |
| 546 | struct scatterlist *sglist, |
| 547 | unsigned int top_offset, |
| 548 | unsigned int bottom_offset, |
| 549 | unsigned int bpl, |
| 550 | unsigned int padding, |
| 551 | unsigned int lines); |
| 552 | extern int cx25821_risc_databuffer_audio(struct pci_dev *pci, |
| 553 | struct btcx_riscmem *risc, |
| 554 | struct scatterlist *sglist, |
| 555 | unsigned int bpl, |
| 556 | unsigned int lines, |
| 557 | unsigned int lpi); |
| 558 | extern void cx25821_free_buffer(struct videobuf_queue *q, struct cx25821_buffer *buf); |
| 559 | extern int cx25821_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,u32 reg, u32 mask, u32 value); |
| 560 | extern void cx25821_sram_channel_dump(struct cx25821_dev *dev, struct sram_channel *ch); |
| 561 | extern void cx25821_sram_channel_dump_audio(struct cx25821_dev *dev, struct sram_channel *ch); |
| 562 | |
| 563 | |
| 564 | extern struct cx25821_dev* cx25821_dev_get(struct pci_dev *pci); |
| 565 | extern void cx25821_print_irqbits(char *name, char *tag, char **strings, int len, u32 bits, u32 mask); |
| 566 | extern void cx25821_dev_unregister(struct cx25821_dev *dev); |
| 567 | extern int cx25821_sram_channel_setup_audio(struct cx25821_dev *dev, |
| 568 | struct sram_channel *ch, |
| 569 | unsigned int bpl, u32 risc); |
| 570 | |
| 571 | extern int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, int pixel_format); |
| 572 | extern int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, int pixel_format); |
| 573 | extern int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select); |
| 574 | extern void cx25821_free_mem_upstream_ch1(struct cx25821_dev *dev); |
| 575 | extern void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev); |
| 576 | extern void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev); |
| 577 | extern void cx25821_start_upstream_video_ch1(struct cx25821_dev *dev, struct upstream_user_struct *up_data); |
| 578 | extern void cx25821_start_upstream_video_ch2(struct cx25821_dev *dev, struct upstream_user_struct *up_data); |
| 579 | extern void cx25821_start_upstream_audio(struct cx25821_dev *dev, struct upstream_user_struct *up_data); |
| 580 | extern void cx25821_stop_upstream_video_ch1(struct cx25821_dev *dev); |
| 581 | extern void cx25821_stop_upstream_video_ch2(struct cx25821_dev *dev); |
| 582 | extern void cx25821_stop_upstream_audio(struct cx25821_dev *dev); |
| 583 | extern int cx25821_sram_channel_setup_upstream( struct cx25821_dev *dev, struct sram_channel *ch, unsigned int bpl, u32 risc); |
| 584 | extern void cx25821_set_pixel_format(struct cx25821_dev *dev, int channel, u32 format); |
| 585 | extern void cx25821_videoioctl_unregister(struct cx25821_dev *dev); |
| 586 | extern struct video_device *cx25821_vdev_init(struct cx25821_dev *dev, |
| 587 | struct pci_dev *pci, |
| 588 | struct video_device *template, |
| 589 | char *type); |
| 590 | #endif |