cx25821.h 16 KB

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