cx88.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /*
  2. *
  3. * v4l2 device driver for cx2388x based TV cards
  4. *
  5. * (c) 2003,04 Gerd Knorr <kraxel@bytesex.org> [SUSE Labs]
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/pci.h>
  22. #include <linux/i2c.h>
  23. #include <linux/i2c-algo-bit.h>
  24. #include <linux/videodev2.h>
  25. #include <linux/kdev_t.h>
  26. #include <media/v4l2-common.h>
  27. #include <media/tuner.h>
  28. #include <media/tveeprom.h>
  29. #include <media/videobuf-dma-sg.h>
  30. #include <media/cx2341x.h>
  31. #include <media/audiochip.h>
  32. #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
  33. #include <media/video-buf-dvb.h>
  34. #endif
  35. #include "btcx-risc.h"
  36. #include "cx88-reg.h"
  37. #include <linux/version.h>
  38. #include <linux/mutex.h>
  39. #define CX88_VERSION_CODE KERNEL_VERSION(0,0,6)
  40. #define UNSET (-1U)
  41. #define CX88_MAXBOARDS 8
  42. /* Max number of inputs by card */
  43. #define MAX_CX88_INPUT 8
  44. /* ----------------------------------------------------------- */
  45. /* defines and enums */
  46. /* Currently unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */
  47. #define CX88_NORMS (\
  48. V4L2_STD_NTSC_M| V4L2_STD_NTSC_M_JP| V4L2_STD_NTSC_443 | \
  49. V4L2_STD_PAL_BG| V4L2_STD_PAL_DK | V4L2_STD_PAL_I | \
  50. V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | \
  51. V4L2_STD_PAL_60| V4L2_STD_SECAM_L | V4L2_STD_SECAM_DK )
  52. #define FORMAT_FLAGS_PACKED 0x01
  53. #define FORMAT_FLAGS_PLANAR 0x02
  54. #define VBI_LINE_COUNT 17
  55. #define VBI_LINE_LENGTH 2048
  56. /* need "shadow" registers for some write-only ones ... */
  57. #define SHADOW_AUD_VOL_CTL 1
  58. #define SHADOW_AUD_BAL_CTL 2
  59. #define SHADOW_MAX 3
  60. /* FM Radio deemphasis type */
  61. enum cx88_deemph_type {
  62. FM_NO_DEEMPH = 0,
  63. FM_DEEMPH_50,
  64. FM_DEEMPH_75
  65. };
  66. enum cx88_board_type {
  67. CX88_BOARD_NONE = 0,
  68. CX88_MPEG_DVB,
  69. CX88_MPEG_BLACKBIRD
  70. };
  71. enum cx8802_board_access {
  72. CX8802_DRVCTL_SHARED = 1,
  73. CX8802_DRVCTL_EXCLUSIVE = 2,
  74. };
  75. /* ----------------------------------------------------------- */
  76. /* tv norms */
  77. static unsigned int inline norm_maxw(v4l2_std_id norm)
  78. {
  79. return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 720 : 768;
  80. }
  81. static unsigned int inline norm_maxh(v4l2_std_id norm)
  82. {
  83. return (norm & V4L2_STD_625_50) ? 576 : 480;
  84. }
  85. /* ----------------------------------------------------------- */
  86. /* static data */
  87. struct cx8800_fmt {
  88. char *name;
  89. u32 fourcc; /* v4l2 format id */
  90. int depth;
  91. int flags;
  92. u32 cxformat;
  93. };
  94. struct cx88_ctrl {
  95. struct v4l2_queryctrl v;
  96. u32 off;
  97. u32 reg;
  98. u32 sreg;
  99. u32 mask;
  100. u32 shift;
  101. };
  102. /* ----------------------------------------------------------- */
  103. /* SRAM memory management data (see cx88-core.c) */
  104. #define SRAM_CH21 0 /* video */
  105. #define SRAM_CH22 1
  106. #define SRAM_CH23 2
  107. #define SRAM_CH24 3 /* vbi */
  108. #define SRAM_CH25 4 /* audio */
  109. #define SRAM_CH26 5
  110. #define SRAM_CH28 6 /* mpeg */
  111. /* more */
  112. struct sram_channel {
  113. char *name;
  114. u32 cmds_start;
  115. u32 ctrl_start;
  116. u32 cdt;
  117. u32 fifo_start;
  118. u32 fifo_size;
  119. u32 ptr1_reg;
  120. u32 ptr2_reg;
  121. u32 cnt1_reg;
  122. u32 cnt2_reg;
  123. };
  124. extern struct sram_channel cx88_sram_channels[];
  125. /* ----------------------------------------------------------- */
  126. /* card configuration */
  127. #define CX88_BOARD_NOAUTO UNSET
  128. #define CX88_BOARD_UNKNOWN 0
  129. #define CX88_BOARD_HAUPPAUGE 1
  130. #define CX88_BOARD_GDI 2
  131. #define CX88_BOARD_PIXELVIEW 3
  132. #define CX88_BOARD_ATI_WONDER_PRO 4
  133. #define CX88_BOARD_WINFAST2000XP_EXPERT 5
  134. #define CX88_BOARD_AVERTV_STUDIO_303 6
  135. #define CX88_BOARD_MSI_TVANYWHERE_MASTER 7
  136. #define CX88_BOARD_WINFAST_DV2000 8
  137. #define CX88_BOARD_LEADTEK_PVR2000 9
  138. #define CX88_BOARD_IODATA_GVVCP3PCI 10
  139. #define CX88_BOARD_PROLINK_PLAYTVPVR 11
  140. #define CX88_BOARD_ASUS_PVR_416 12
  141. #define CX88_BOARD_MSI_TVANYWHERE 13
  142. #define CX88_BOARD_KWORLD_DVB_T 14
  143. #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1 15
  144. #define CX88_BOARD_KWORLD_LTV883 16
  145. #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q 17
  146. #define CX88_BOARD_HAUPPAUGE_DVB_T1 18
  147. #define CX88_BOARD_CONEXANT_DVB_T1 19
  148. #define CX88_BOARD_PROVIDEO_PV259 20
  149. #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS 21
  150. #define CX88_BOARD_PCHDTV_HD3000 22
  151. #define CX88_BOARD_DNTV_LIVE_DVB_T 23
  152. #define CX88_BOARD_HAUPPAUGE_ROSLYN 24
  153. #define CX88_BOARD_DIGITALLOGIC_MEC 25
  154. #define CX88_BOARD_IODATA_GVBCTV7E 26
  155. #define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27
  156. #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28
  157. #define CX88_BOARD_ADSTECH_DVB_T_PCI 29
  158. #define CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 30
  159. #define CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD 31
  160. #define CX88_BOARD_AVERMEDIA_ULTRATV_MC_550 32
  161. #define CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD 33
  162. #define CX88_BOARD_ATI_HDTVWONDER 34
  163. #define CX88_BOARD_WINFAST_DTV1000 35
  164. #define CX88_BOARD_AVERTV_303 36
  165. #define CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1 37
  166. #define CX88_BOARD_HAUPPAUGE_NOVASE2_S1 38
  167. #define CX88_BOARD_KWORLD_DVBS_100 39
  168. #define CX88_BOARD_HAUPPAUGE_HVR1100 40
  169. #define CX88_BOARD_HAUPPAUGE_HVR1100LP 41
  170. #define CX88_BOARD_DNTV_LIVE_DVB_T_PRO 42
  171. #define CX88_BOARD_KWORLD_DVB_T_CX22702 43
  172. #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL 44
  173. #define CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT 45
  174. #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID 46
  175. #define CX88_BOARD_PCHDTV_HD5500 47
  176. #define CX88_BOARD_KWORLD_MCE200_DELUXE 48
  177. #define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49
  178. #define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50
  179. #define CX88_BOARD_WINFAST_DTV2000H 51
  180. #define CX88_BOARD_GENIATECH_DVBS 52
  181. #define CX88_BOARD_HAUPPAUGE_HVR3000 53
  182. #define CX88_BOARD_NORWOOD_MICRO 54
  183. #define CX88_BOARD_TE_DTV_250_OEM_SWANN 55
  184. #define CX88_BOARD_HAUPPAUGE_HVR1300 56
  185. #define CX88_BOARD_ADSTECH_PTV_390 57
  186. enum cx88_itype {
  187. CX88_VMUX_COMPOSITE1 = 1,
  188. CX88_VMUX_COMPOSITE2,
  189. CX88_VMUX_COMPOSITE3,
  190. CX88_VMUX_COMPOSITE4,
  191. CX88_VMUX_SVIDEO,
  192. CX88_VMUX_TELEVISION,
  193. CX88_VMUX_CABLE,
  194. CX88_VMUX_DVB,
  195. CX88_VMUX_DEBUG,
  196. CX88_RADIO,
  197. };
  198. struct cx88_input {
  199. enum cx88_itype type;
  200. u32 gpio0, gpio1, gpio2, gpio3;
  201. unsigned int vmux:2;
  202. unsigned int extadc:1;
  203. };
  204. struct cx88_board {
  205. char *name;
  206. unsigned int tuner_type;
  207. unsigned int radio_type;
  208. unsigned char tuner_addr;
  209. unsigned char radio_addr;
  210. int tda9887_conf;
  211. struct cx88_input input[MAX_CX88_INPUT];
  212. struct cx88_input radio;
  213. enum cx88_board_type mpeg;
  214. enum audiochip audio_chip;
  215. };
  216. struct cx88_subid {
  217. u16 subvendor;
  218. u16 subdevice;
  219. u32 card;
  220. };
  221. #define INPUT(nr) (core->board.input[nr])
  222. /* ----------------------------------------------------------- */
  223. /* device / file handle status */
  224. #define RESOURCE_OVERLAY 1
  225. #define RESOURCE_VIDEO 2
  226. #define RESOURCE_VBI 4
  227. #define BUFFER_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */
  228. /* buffer for one video frame */
  229. struct cx88_buffer {
  230. /* common v4l buffer stuff -- must be first */
  231. struct videobuf_buffer vb;
  232. /* cx88 specific */
  233. unsigned int bpl;
  234. struct btcx_riscmem risc;
  235. struct cx8800_fmt *fmt;
  236. u32 count;
  237. };
  238. struct cx88_dmaqueue {
  239. struct list_head active;
  240. struct list_head queued;
  241. struct timer_list timeout;
  242. struct btcx_riscmem stopper;
  243. u32 count;
  244. };
  245. struct cx88_core {
  246. struct list_head devlist;
  247. atomic_t refcount;
  248. /* board name */
  249. int nr;
  250. char name[32];
  251. /* pci stuff */
  252. int pci_bus;
  253. int pci_slot;
  254. u32 __iomem *lmmio;
  255. u8 __iomem *bmmio;
  256. u32 shadow[SHADOW_MAX];
  257. int pci_irqmask;
  258. /* i2c i/o */
  259. struct i2c_adapter i2c_adap;
  260. struct i2c_algo_bit_data i2c_algo;
  261. struct i2c_client i2c_client;
  262. u32 i2c_state, i2c_rc;
  263. /* config info -- analog */
  264. unsigned int boardnr;
  265. struct cx88_board board;
  266. /* Supported V4L _STD_ tuner formats */
  267. unsigned int tuner_formats;
  268. /* config info -- dvb */
  269. #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
  270. int (*prev_set_voltage)(struct dvb_frontend* fe, fe_sec_voltage_t voltage);
  271. #endif
  272. /* state info */
  273. struct task_struct *kthread;
  274. v4l2_std_id tvnorm;
  275. u32 tvaudio;
  276. u32 audiomode_manual;
  277. u32 audiomode_current;
  278. u32 input;
  279. u32 astat;
  280. u32 use_nicam;
  281. /* IR remote control state */
  282. struct cx88_IR *ir;
  283. struct mutex lock;
  284. /* various v4l controls */
  285. u32 freq;
  286. /* cx88-video needs to access cx8802 for hybrid tuner pll access. */
  287. struct cx8802_dev *dvbdev;
  288. enum cx88_board_type active_type_id;
  289. };
  290. struct cx8800_dev;
  291. struct cx8802_dev;
  292. /* ----------------------------------------------------------- */
  293. /* function 0: video stuff */
  294. struct cx8800_fh {
  295. struct cx8800_dev *dev;
  296. enum v4l2_buf_type type;
  297. int radio;
  298. unsigned int resources;
  299. /* video overlay */
  300. struct v4l2_window win;
  301. struct v4l2_clip *clips;
  302. unsigned int nclips;
  303. /* video capture */
  304. struct cx8800_fmt *fmt;
  305. unsigned int width,height;
  306. struct videobuf_queue vidq;
  307. /* vbi capture */
  308. struct videobuf_queue vbiq;
  309. };
  310. struct cx8800_suspend_state {
  311. int disabled;
  312. };
  313. struct cx8800_dev {
  314. struct cx88_core *core;
  315. struct list_head devlist;
  316. spinlock_t slock;
  317. /* various device info */
  318. unsigned int resources;
  319. struct video_device *video_dev;
  320. struct video_device *vbi_dev;
  321. struct video_device *radio_dev;
  322. /* pci i/o */
  323. struct pci_dev *pci;
  324. unsigned char pci_rev,pci_lat;
  325. /* capture queues */
  326. struct cx88_dmaqueue vidq;
  327. struct cx88_dmaqueue vbiq;
  328. /* various v4l controls */
  329. /* other global state info */
  330. struct cx8800_suspend_state state;
  331. };
  332. /* ----------------------------------------------------------- */
  333. /* function 1: audio/alsa stuff */
  334. /* =============> moved to cx88-alsa.c <====================== */
  335. /* ----------------------------------------------------------- */
  336. /* function 2: mpeg stuff */
  337. struct cx8802_fh {
  338. struct cx8802_dev *dev;
  339. struct videobuf_queue mpegq;
  340. };
  341. struct cx8802_suspend_state {
  342. int disabled;
  343. };
  344. struct cx8802_driver {
  345. struct cx88_core *core;
  346. struct list_head devlist;
  347. /* Type of driver and access required */
  348. enum cx88_board_type type_id;
  349. enum cx8802_board_access hw_access;
  350. /* MPEG 8802 internal only */
  351. int (*suspend)(struct pci_dev *pci_dev, pm_message_t state);
  352. int (*resume)(struct pci_dev *pci_dev);
  353. /* MPEG 8802 -> mini driver - Driver probe and configuration */
  354. int (*probe)(struct cx8802_driver *drv);
  355. int (*remove)(struct cx8802_driver *drv);
  356. /* MPEG 8802 -> mini driver - Access for hardware control */
  357. int (*advise_acquire)(struct cx8802_driver *drv);
  358. int (*advise_release)(struct cx8802_driver *drv);
  359. /* MPEG 8802 <- mini driver - Access for hardware control */
  360. int (*request_acquire)(struct cx8802_driver *drv);
  361. int (*request_release)(struct cx8802_driver *drv);
  362. };
  363. struct cx8802_dev {
  364. struct cx88_core *core;
  365. spinlock_t slock;
  366. /* pci i/o */
  367. struct pci_dev *pci;
  368. unsigned char pci_rev,pci_lat;
  369. /* dma queues */
  370. struct cx88_dmaqueue mpegq;
  371. u32 ts_packet_size;
  372. u32 ts_packet_count;
  373. /* other global state info */
  374. struct cx8802_suspend_state state;
  375. /* for blackbird only */
  376. struct list_head devlist;
  377. struct video_device *mpeg_dev;
  378. u32 mailbox;
  379. int width;
  380. int height;
  381. #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
  382. /* for dvb only */
  383. struct videobuf_dvb dvb;
  384. void *card_priv;
  385. #endif
  386. /* for switching modulation types */
  387. unsigned char ts_gen_cntrl;
  388. /* mpeg params */
  389. struct cx2341x_mpeg_params params;
  390. /* List of attached drivers */
  391. struct cx8802_driver drvlist;
  392. struct work_struct request_module_wk;
  393. };
  394. /* ----------------------------------------------------------- */
  395. #define cx_read(reg) readl(core->lmmio + ((reg)>>2))
  396. #define cx_write(reg,value) writel((value), core->lmmio + ((reg)>>2))
  397. #define cx_writeb(reg,value) writeb((value), core->bmmio + (reg))
  398. #define cx_andor(reg,mask,value) \
  399. writel((readl(core->lmmio+((reg)>>2)) & ~(mask)) |\
  400. ((value) & (mask)), core->lmmio+((reg)>>2))
  401. #define cx_set(reg,bit) cx_andor((reg),(bit),(bit))
  402. #define cx_clear(reg,bit) cx_andor((reg),(bit),0)
  403. #define cx_wait(d) { if (need_resched()) schedule(); else udelay(d); }
  404. /* shadow registers */
  405. #define cx_sread(sreg) (core->shadow[sreg])
  406. #define cx_swrite(sreg,reg,value) \
  407. (core->shadow[sreg] = value, \
  408. writel(core->shadow[sreg], core->lmmio + ((reg)>>2)))
  409. #define cx_sandor(sreg,reg,mask,value) \
  410. (core->shadow[sreg] = (core->shadow[sreg] & ~(mask)) | ((value) & (mask)), \
  411. writel(core->shadow[sreg], core->lmmio + ((reg)>>2)))
  412. /* ----------------------------------------------------------- */
  413. /* cx88-core.c */
  414. extern void cx88_print_irqbits(char *name, char *tag, char **strings,
  415. int len, u32 bits, u32 mask);
  416. extern int cx88_core_irq(struct cx88_core *core, u32 status);
  417. extern void cx88_wakeup(struct cx88_core *core,
  418. struct cx88_dmaqueue *q, u32 count);
  419. extern void cx88_shutdown(struct cx88_core *core);
  420. extern int cx88_reset(struct cx88_core *core);
  421. extern int
  422. cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
  423. struct scatterlist *sglist,
  424. unsigned int top_offset, unsigned int bottom_offset,
  425. unsigned int bpl, unsigned int padding, unsigned int lines);
  426. extern int
  427. cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
  428. struct scatterlist *sglist, unsigned int bpl,
  429. unsigned int lines, unsigned int lpi);
  430. extern int
  431. cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
  432. u32 reg, u32 mask, u32 value);
  433. extern void
  434. cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf);
  435. extern void cx88_risc_disasm(struct cx88_core *core,
  436. struct btcx_riscmem *risc);
  437. extern int cx88_sram_channel_setup(struct cx88_core *core,
  438. struct sram_channel *ch,
  439. unsigned int bpl, u32 risc);
  440. extern void cx88_sram_channel_dump(struct cx88_core *core,
  441. struct sram_channel *ch);
  442. extern int cx88_set_scale(struct cx88_core *core, unsigned int width,
  443. unsigned int height, enum v4l2_field field);
  444. extern int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm);
  445. extern struct video_device *cx88_vdev_init(struct cx88_core *core,
  446. struct pci_dev *pci,
  447. struct video_device *template,
  448. char *type);
  449. extern struct cx88_core* cx88_core_get(struct pci_dev *pci);
  450. extern void cx88_core_put(struct cx88_core *core,
  451. struct pci_dev *pci);
  452. extern int cx88_start_audio_dma(struct cx88_core *core);
  453. extern int cx88_stop_audio_dma(struct cx88_core *core);
  454. /* ----------------------------------------------------------- */
  455. /* cx88-vbi.c */
  456. /* Can be used as g_vbi_fmt, try_vbi_fmt and s_vbi_fmt */
  457. int cx8800_vbi_fmt (struct file *file, void *priv,
  458. struct v4l2_format *f);
  459. /*
  460. int cx8800_start_vbi_dma(struct cx8800_dev *dev,
  461. struct cx88_dmaqueue *q,
  462. struct cx88_buffer *buf);
  463. */
  464. int cx8800_stop_vbi_dma(struct cx8800_dev *dev);
  465. int cx8800_restart_vbi_queue(struct cx8800_dev *dev,
  466. struct cx88_dmaqueue *q);
  467. void cx8800_vbi_timeout(unsigned long data);
  468. extern struct videobuf_queue_ops cx8800_vbi_qops;
  469. /* ----------------------------------------------------------- */
  470. /* cx88-i2c.c */
  471. extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci);
  472. extern void cx88_call_i2c_clients(struct cx88_core *core,
  473. unsigned int cmd, void *arg);
  474. /* ----------------------------------------------------------- */
  475. /* cx88-cards.c */
  476. extern int cx88_get_resources(const struct cx88_core *core,
  477. struct pci_dev *pci);
  478. extern struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr);
  479. /* ----------------------------------------------------------- */
  480. /* cx88-tvaudio.c */
  481. #define WW_NONE 1
  482. #define WW_BTSC 2
  483. #define WW_BG 3
  484. #define WW_DK 4
  485. #define WW_I 5
  486. #define WW_L 6
  487. #define WW_EIAJ 7
  488. #define WW_I2SPT 8
  489. #define WW_FM 9
  490. void cx88_set_tvaudio(struct cx88_core *core);
  491. void cx88_newstation(struct cx88_core *core);
  492. void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t);
  493. void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual);
  494. int cx88_audio_thread(void *data);
  495. int cx8802_register_driver(struct cx8802_driver *drv);
  496. int cx8802_unregister_driver(struct cx8802_driver *drv);
  497. struct cx8802_dev * cx8802_get_device(struct inode *inode);
  498. struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype);
  499. /* ----------------------------------------------------------- */
  500. /* cx88-input.c */
  501. int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci);
  502. int cx88_ir_fini(struct cx88_core *core);
  503. void cx88_ir_irq(struct cx88_core *core);
  504. void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir);
  505. void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir);
  506. /* ----------------------------------------------------------- */
  507. /* cx88-mpeg.c */
  508. int cx8802_buf_prepare(struct videobuf_queue *q,struct cx8802_dev *dev,
  509. struct cx88_buffer *buf, enum v4l2_field field);
  510. void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf);
  511. void cx8802_cancel_buffers(struct cx8802_dev *dev);
  512. int cx8802_init_common(struct cx8802_dev *dev);
  513. void cx8802_fini_common(struct cx8802_dev *dev);
  514. int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state);
  515. int cx8802_resume_common(struct pci_dev *pci_dev);
  516. /* ----------------------------------------------------------- */
  517. /* cx88-video.c*/
  518. extern const u32 cx88_user_ctrls[];
  519. extern int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl);
  520. int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i);
  521. int cx88_set_freq (struct cx88_core *core,struct v4l2_frequency *f);
  522. int cx88_get_control(struct cx88_core *core, struct v4l2_control *ctl);
  523. int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl);
  524. int cx88_video_mux(struct cx88_core *core, unsigned int input);
  525. /*
  526. * Local variables:
  527. * c-basic-offset: 8
  528. * End:
  529. * 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
  530. */