[PATCH] v4l: 720: alsa support for saa7134 that should work wonderful
[linux-2.6] / drivers / media / video / saa7134 / saa7134.h
1 /*
2  *
3  * v4l2 device driver for philips saa7134 based TV cards
4  *
5  * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org>
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
22 #include <linux/version.h>
23 #define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,14)
24
25 #include <linux/pci.h>
26 #include <linux/i2c.h>
27 #include <linux/videodev.h>
28 #include <linux/kdev_t.h>
29 #include <linux/input.h>
30
31 #include <asm/io.h>
32
33 #include <media/tuner.h>
34 #include <media/audiochip.h>
35 #include <media/id.h>
36 #include <media/ir-common.h>
37 #include <media/video-buf.h>
38 #include <media/video-buf-dvb.h>
39
40 #ifndef TRUE
41 # define TRUE (1==1)
42 #endif
43 #ifndef FALSE
44 # define FALSE (1==0)
45 #endif
46 #define UNSET (-1U)
47
48 #include <sound/driver.h>
49 #include <sound/core.h>
50 #include <sound/pcm.h>
51
52 /* ----------------------------------------------------------- */
53 /* enums                                                       */
54
55 enum saa7134_tvaudio_mode {
56         TVAUDIO_FM_MONO       = 1,
57         TVAUDIO_FM_BG_STEREO  = 2,
58         TVAUDIO_FM_SAT_STEREO = 3,
59         TVAUDIO_FM_K_STEREO   = 4,
60         TVAUDIO_NICAM_AM      = 5,
61         TVAUDIO_NICAM_FM      = 6,
62 };
63
64 enum saa7134_audio_in {
65         TV    = 1,
66         LINE1 = 2,
67         LINE2 = 3,
68         LINE2_LEFT,
69 };
70
71 enum saa7134_video_out {
72         CCIR656 = 1,
73 };
74
75 /* ----------------------------------------------------------- */
76 /* static data                                                 */
77
78 struct saa7134_tvnorm {
79         char          *name;
80         v4l2_std_id   id;
81
82         /* video decoder */
83         unsigned int  sync_control;
84         unsigned int  luma_control;
85         unsigned int  chroma_ctrl1;
86         unsigned int  chroma_gain;
87         unsigned int  chroma_ctrl2;
88         unsigned int  vgate_misc;
89
90         /* video scaler */
91         unsigned int  h_start;
92         unsigned int  h_stop;
93         unsigned int  video_v_start;
94         unsigned int  video_v_stop;
95         unsigned int  vbi_v_start_0;
96         unsigned int  vbi_v_stop_0;
97         unsigned int  src_timing;
98         unsigned int  vbi_v_start_1;
99 };
100
101 struct saa7134_tvaudio {
102         char         *name;
103         v4l2_std_id  std;
104         enum         saa7134_tvaudio_mode mode;
105         int          carr1;
106         int          carr2;
107 };
108
109 struct saa7134_format {
110         char           *name;
111         unsigned int   fourcc;
112         unsigned int   depth;
113         unsigned int   pm;
114         unsigned int   vshift;   /* vertical downsampling (for planar yuv) */
115         unsigned int   hshift;   /* horizontal downsampling (for planar yuv) */
116         unsigned int   bswap:1;
117         unsigned int   wswap:1;
118         unsigned int   yuv:1;
119         unsigned int   planar:1;
120         unsigned int   uvswap:1;
121 };
122
123 /* ----------------------------------------------------------- */
124 /* card configuration                                          */
125
126 #define SAA7134_BOARD_NOAUTO        UNSET
127 #define SAA7134_BOARD_UNKNOWN           0
128 #define SAA7134_BOARD_PROTEUS_PRO       1
129 #define SAA7134_BOARD_FLYVIDEO3000      2
130 #define SAA7134_BOARD_FLYVIDEO2000      3
131 #define SAA7134_BOARD_EMPRESS           4
132 #define SAA7134_BOARD_MONSTERTV         5
133 #define SAA7134_BOARD_MD9717            6
134 #define SAA7134_BOARD_TVSTATION_RDS     7
135 #define SAA7134_BOARD_CINERGY400        8
136 #define SAA7134_BOARD_MD5044            9
137 #define SAA7134_BOARD_KWORLD           10
138 #define SAA7134_BOARD_CINERGY600       11
139 #define SAA7134_BOARD_MD7134           12
140 #define SAA7134_BOARD_TYPHOON_90031    13
141 #define SAA7134_BOARD_ELSA             14
142 #define SAA7134_BOARD_ELSA_500TV       15
143 #define SAA7134_BOARD_ASUSTeK_TVFM7134 16
144 #define SAA7134_BOARD_VA1000POWER      17
145 #define SAA7134_BOARD_BMK_MPEX_NOTUNER 18
146 #define SAA7134_BOARD_VIDEOMATE_TV     19
147 #define SAA7134_BOARD_CRONOS_PLUS      20
148 #define SAA7134_BOARD_10MOONSTVMASTER  21
149 #define SAA7134_BOARD_MD2819           22
150 #define SAA7134_BOARD_BMK_MPEX_TUNER   23
151 #define SAA7134_BOARD_TVSTATION_DVR    24
152 #define SAA7134_BOARD_ASUSTEK_TVFM7133  25
153 #define SAA7134_BOARD_PINNACLE_PCTV_STEREO 26
154 #define SAA7134_BOARD_MANLI_MTV002     27
155 #define SAA7134_BOARD_MANLI_MTV001     28
156 #define SAA7134_BOARD_TG3000TV         29
157 #define SAA7134_BOARD_ECS_TVP3XP       30
158 #define SAA7134_BOARD_ECS_TVP3XP_4CB5  31
159 #define SAA7134_BOARD_AVACSSMARTTV     32
160 #define SAA7134_BOARD_AVERMEDIA_DVD_EZMAKER 33
161 #define SAA7134_BOARD_NOVAC_PRIMETV7133 34
162 #define SAA7134_BOARD_AVERMEDIA_STUDIO_305 35
163 #define SAA7134_BOARD_UPMOST_PURPLE_TV 36
164 #define SAA7134_BOARD_ITEMS_MTV005     37
165 #define SAA7134_BOARD_CINERGY200       38
166 #define SAA7134_BOARD_FLYTVPLATINUM_MINI 39
167 #define SAA7134_BOARD_VIDEOMATE_TV_PVR 40
168 #define SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUS 41
169 #define SAA7134_BOARD_SABRENT_SBTTVFM  42
170 #define SAA7134_BOARD_ZOLID_XPERT_TV7134 43
171 #define SAA7134_BOARD_EMPIRE_PCI_TV_RADIO_LE 44
172 #define SAA7134_BOARD_AVERMEDIA_STUDIO_307    45
173 #define SAA7134_BOARD_AVERMEDIA_CARDBUS 46
174 #define SAA7134_BOARD_CINERGY400_CARDBUS 47
175 #define SAA7134_BOARD_CINERGY600_MK3   48
176 #define SAA7134_BOARD_VIDEOMATE_GOLD_PLUS 49
177 #define SAA7134_BOARD_PINNACLE_300I_DVBT_PAL 50
178 #define SAA7134_BOARD_PROVIDEO_PV952   51
179 #define SAA7134_BOARD_AVERMEDIA_305    52
180 #define SAA7134_BOARD_ASUSTeK_TVFM7135 53
181 #define SAA7134_BOARD_FLYTVPLATINUM_FM 54
182 #define SAA7134_BOARD_FLYDVBTDUO 55
183 #define SAA7134_BOARD_AVERMEDIA_307    56
184 #define SAA7134_BOARD_AVERMEDIA_GO_007_FM 57
185 #define SAA7134_BOARD_ADS_INSTANT_TV 58
186 #define SAA7134_BOARD_KWORLD_VSTREAM_XPERT 59
187 #define SAA7134_BOARD_THYPHOON_DVBT_DUO_CARDBUS 60
188 #define SAA7134_BOARD_PHILIPS_TOUGH 61
189 #define SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII 62
190 #define SAA7134_BOARD_KWORLD_XPERT 63
191 #define SAA7134_BOARD_FLYTV_DIGIMATRIX 64
192 #define SAA7134_BOARD_KWORLD_TERMINATOR 65
193 #define SAA7134_BOARD_YUAN_TUN900 66
194 #define SAA7134_BOARD_BEHOLD_409FM 67
195 #define SAA7134_BOARD_GOTVIEW_7135 68
196 #define SAA7134_BOARD_PHILIPS_EUROPA  69
197 #define SAA7134_BOARD_VIDEOMATE_DVBT_300 70
198 #define SAA7134_BOARD_VIDEOMATE_DVBT_200 71
199 #define SAA7134_BOARD_RTD_VFG7350 72
200 #define SAA7134_BOARD_RTD_VFG7330 73
201 #define SAA7134_BOARD_FLYTVPLATINUM_MINI2 74
202
203 #define SAA7134_MAXBOARDS 8
204 #define SAA7134_INPUT_MAX 8
205
206 /* ----------------------------------------------------------- */
207 /* Video Output Port Register Initialization Options           */
208
209 #define SET_T_CODE_POLARITY_NON_INVERTED        (1 << 0)
210 #define SET_CLOCK_NOT_DELAYED                   (1 << 1)
211 #define SET_CLOCK_INVERTED                      (1 << 2)
212 #define SET_VSYNC_OFF                           (1 << 3)
213
214 struct saa7134_input {
215         char                    *name;
216         unsigned int            vmux;
217         enum saa7134_audio_in   amux;
218         unsigned int            gpio;
219         unsigned int            tv:1;
220 };
221
222 enum saa7134_mpeg_type {
223         SAA7134_MPEG_UNUSED,
224         SAA7134_MPEG_EMPRESS,
225         SAA7134_MPEG_DVB,
226 };
227
228 struct saa7134_board {
229         char                    *name;
230         unsigned int            audio_clock;
231
232         /* input switching */
233         unsigned int            gpiomask;
234         struct saa7134_input    inputs[SAA7134_INPUT_MAX];
235         struct saa7134_input    radio;
236         struct saa7134_input    mute;
237
238         /* i2c chip info */
239         unsigned int            tuner_type;
240         unsigned int            radio_type;
241         unsigned char           tuner_addr;
242         unsigned char           radio_addr;
243
244         unsigned int            tda9887_conf;
245
246         /* peripheral I/O */
247         enum saa7134_video_out  video_out;
248         enum saa7134_mpeg_type  mpeg;
249         unsigned int            vid_port_opts;
250 };
251
252 #define card_has_radio(dev)   (NULL != saa7134_boards[dev->board].radio.name)
253 #define card_is_empress(dev)  (SAA7134_MPEG_EMPRESS == saa7134_boards[dev->board].mpeg)
254 #define card_is_dvb(dev)      (SAA7134_MPEG_DVB     == saa7134_boards[dev->board].mpeg)
255 #define card_has_mpeg(dev)    (SAA7134_MPEG_UNUSED  != saa7134_boards[dev->board].mpeg)
256 #define card(dev)             (saa7134_boards[dev->board])
257 #define card_in(dev,n)        (saa7134_boards[dev->board].inputs[n])
258
259 /* ----------------------------------------------------------- */
260 /* device / file handle status                                 */
261
262 #define RESOURCE_OVERLAY       1
263 #define RESOURCE_VIDEO         2
264 #define RESOURCE_VBI           4
265
266 #define INTERLACE_AUTO         0
267 #define INTERLACE_ON           1
268 #define INTERLACE_OFF          2
269
270 #define BUFFER_TIMEOUT     (HZ/2)  /* 0.5 seconds */
271
272 struct saa7134_dev;
273 struct saa7134_dma;
274
275 /* saa7134 page table */
276 struct saa7134_pgtable {
277         unsigned int               size;
278         __le32                     *cpu;
279         dma_addr_t                 dma;
280 };
281
282 /* tvaudio thread status */
283 struct saa7134_thread {
284         pid_t                      pid;
285         struct completion          exit;
286         wait_queue_head_t          wq;
287         unsigned int               shutdown;
288         unsigned int               scan1;
289         unsigned int               scan2;
290         unsigned int               mode;
291 };
292
293 /* buffer for one video/vbi/ts frame */
294 struct saa7134_buf {
295         /* common v4l buffer stuff -- must be first */
296         struct videobuf_buffer vb;
297
298         /* saa7134 specific */
299         struct saa7134_format   *fmt;
300         unsigned int            top_seen;
301         int (*activate)(struct saa7134_dev *dev,
302                         struct saa7134_buf *buf,
303                         struct saa7134_buf *next);
304
305         /* page tables */
306         struct saa7134_pgtable  *pt;
307 };
308
309 struct saa7134_dmaqueue {
310         struct saa7134_dev         *dev;
311         struct saa7134_buf         *curr;
312         struct list_head           queue;
313         struct timer_list          timeout;
314         unsigned int               need_two;
315 };
316
317 /* video filehandle status */
318 struct saa7134_fh {
319         struct saa7134_dev         *dev;
320         unsigned int               radio;
321         enum v4l2_buf_type         type;
322         unsigned int               resources;
323 #ifdef VIDIOC_G_PRIORITY
324         enum v4l2_priority         prio;
325 #endif
326
327         /* video overlay */
328         struct v4l2_window         win;
329         struct v4l2_clip           clips[8];
330         unsigned int               nclips;
331
332         /* video capture */
333         struct saa7134_format      *fmt;
334         unsigned int               width,height;
335         struct videobuf_queue      cap;
336         struct saa7134_pgtable     pt_cap;
337
338         /* vbi capture */
339         struct videobuf_queue      vbi;
340         struct saa7134_pgtable     pt_vbi;
341 };
342
343 /* oss dsp status */
344 struct saa7134_oss {
345         struct semaphore           lock;
346         int                        minor_mixer;
347         int                        minor_dsp;
348         unsigned int               users_dsp;
349
350         /* mixer */
351         enum saa7134_audio_in      input;
352         unsigned int               count;
353         unsigned int               line1;
354         unsigned int               line2;
355
356         /* dsp */
357         unsigned int               afmt;
358         unsigned int               rate;
359         unsigned int               channels;
360         unsigned int               recording_on;
361         unsigned int               dma_running;
362         unsigned int               blocks;
363         unsigned int               blksize;
364         unsigned int               bufsize;
365         struct saa7134_pgtable     pt;
366         struct videobuf_dmabuf     dma;
367         wait_queue_head_t          wq;
368         unsigned int               dma_blk;
369         unsigned int               read_offset;
370         unsigned int               read_count;
371         snd_pcm_substream_t        *substream;
372 };
373
374 /* IR input */
375 struct saa7134_ir {
376         struct input_dev           *dev;
377         struct ir_input_state      ir;
378         char                       name[32];
379         char                       phys[32];
380         u32                        mask_keycode;
381         u32                        mask_keydown;
382         u32                        mask_keyup;
383         int                        polling;
384         u32                        last_gpio;
385         struct timer_list          timer;
386 };
387
388 /* ts/mpeg status */
389 struct saa7134_ts {
390         /* TS capture */
391         struct saa7134_pgtable     pt_ts;
392         int                        nr_packets;
393         int                        nr_bufs;
394 };
395
396 /* ts/mpeg ops */
397 struct saa7134_mpeg_ops {
398         enum saa7134_mpeg_type     type;
399         struct list_head           next;
400         int                        (*init)(struct saa7134_dev *dev);
401         int                        (*fini)(struct saa7134_dev *dev);
402         void                       (*signal_change)(struct saa7134_dev *dev);
403 };
404
405 /* global device status */
406 struct saa7134_dev {
407         struct list_head           devlist;
408         struct semaphore           lock;
409         spinlock_t                 slock;
410 #ifdef VIDIOC_G_PRIORITY
411         struct v4l2_prio_state     prio;
412 #endif
413
414         /* various device info */
415         unsigned int               resources;
416         struct video_device        *video_dev;
417         struct video_device        *radio_dev;
418         struct video_device        *vbi_dev;
419         struct saa7134_oss         oss;
420
421         /* infrared remote */
422         int                        has_remote;
423         struct saa7134_ir          *remote;
424
425         /* pci i/o */
426         char                       name[32];
427         int                        nr;
428         struct pci_dev             *pci;
429         unsigned char              pci_rev,pci_lat;
430         __u32                      __iomem *lmmio;
431         __u8                       __iomem *bmmio;
432
433         /* config info */
434         unsigned int               board;
435         unsigned int               tuner_type;
436         unsigned int               radio_type;
437         unsigned char              tuner_addr;
438         unsigned char              radio_addr;
439
440         unsigned int               tda9887_conf;
441         unsigned int               gpio_value;
442
443         /* i2c i/o */
444         struct i2c_adapter         i2c_adap;
445         struct i2c_client          i2c_client;
446         unsigned char              eedata[128];
447
448         /* video overlay */
449         struct v4l2_framebuffer    ovbuf;
450         struct saa7134_format      *ovfmt;
451         unsigned int               ovenable;
452         enum v4l2_field            ovfield;
453
454         /* video+ts+vbi capture */
455         struct saa7134_dmaqueue    video_q;
456         struct saa7134_dmaqueue    vbi_q;
457         unsigned int               video_fieldcount;
458         unsigned int               vbi_fieldcount;
459
460         /* various v4l controls */
461         struct saa7134_tvnorm      *tvnorm;              /* video */
462         struct saa7134_tvaudio     *tvaudio;
463         unsigned int               ctl_input;
464         int                        ctl_bright;
465         int                        ctl_contrast;
466         int                        ctl_hue;
467         int                        ctl_saturation;
468         int                        ctl_freq;
469         int                        ctl_mute;             /* audio */
470         int                        ctl_volume;
471         int                        ctl_invert;           /* private */
472         int                        ctl_mirror;
473         int                        ctl_y_odd;
474         int                        ctl_y_even;
475         int                        ctl_automute;
476
477         /* crop */
478         struct v4l2_rect           crop_bounds;
479         struct v4l2_rect           crop_defrect;
480         struct v4l2_rect           crop_current;
481
482         /* other global state info */
483         unsigned int               automute;
484         struct saa7134_thread      thread;
485         struct saa7134_input       *input;
486         struct saa7134_input       *hw_input;
487         unsigned int               hw_mute;
488         int                        last_carrier;
489         int                        nosignal;
490
491         /* SAA7134_MPEG_* */
492         struct saa7134_ts          ts;
493         struct saa7134_dmaqueue    ts_q;
494         struct saa7134_mpeg_ops    *mops;
495
496         /* SAA7134_MPEG_EMPRESS only */
497         struct video_device        *empress_dev;
498         struct videobuf_queue      empress_tsq;
499         unsigned int               empress_users;
500         struct work_struct         empress_workqueue;
501         int                        empress_started;
502
503         /* SAA7134_MPEG_DVB only */
504         struct videobuf_dvb        dvb;
505 };
506
507 /* ----------------------------------------------------------- */
508
509 #define saa_readl(reg)             readl(dev->lmmio + (reg))
510 #define saa_writel(reg,value)      writel((value), dev->lmmio + (reg));
511 #define saa_andorl(reg,mask,value) \
512   writel((readl(dev->lmmio+(reg)) & ~(mask)) |\
513   ((value) & (mask)), dev->lmmio+(reg))
514 #define saa_setl(reg,bit)          saa_andorl((reg),(bit),(bit))
515 #define saa_clearl(reg,bit)        saa_andorl((reg),(bit),0)
516
517 #define saa_readb(reg)             readb(dev->bmmio + (reg))
518 #define saa_writeb(reg,value)      writeb((value), dev->bmmio + (reg));
519 #define saa_andorb(reg,mask,value) \
520   writeb((readb(dev->bmmio+(reg)) & ~(mask)) |\
521   ((value) & (mask)), dev->bmmio+(reg))
522 #define saa_setb(reg,bit)          saa_andorb((reg),(bit),(bit))
523 #define saa_clearb(reg,bit)        saa_andorb((reg),(bit),0)
524
525 #define saa_wait(us) { udelay(us); }
526
527 /* ----------------------------------------------------------- */
528 /* saa7134-core.c                                              */
529
530 extern struct list_head  saa7134_devlist;
531
532 void saa7134_print_ioctl(char *name, unsigned int cmd);
533 void saa7134_track_gpio(struct saa7134_dev *dev, char *msg);
534
535 #define SAA7134_PGTABLE_SIZE 4096
536
537 int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt);
538 int  saa7134_pgtable_build(struct pci_dev *pci, struct saa7134_pgtable *pt,
539                            struct scatterlist *list, unsigned int length,
540                            unsigned int startpage);
541 void saa7134_pgtable_free(struct pci_dev *pci, struct saa7134_pgtable *pt);
542
543 int saa7134_buffer_count(unsigned int size, unsigned int count);
544 int saa7134_buffer_startpage(struct saa7134_buf *buf);
545 unsigned long saa7134_buffer_base(struct saa7134_buf *buf);
546
547 int saa7134_buffer_queue(struct saa7134_dev *dev, struct saa7134_dmaqueue *q,
548                          struct saa7134_buf *buf);
549 void saa7134_buffer_finish(struct saa7134_dev *dev, struct saa7134_dmaqueue *q,
550                            unsigned int state);
551 void saa7134_buffer_next(struct saa7134_dev *dev, struct saa7134_dmaqueue *q);
552 void saa7134_buffer_timeout(unsigned long data);
553 void saa7134_dma_free(struct saa7134_dev *dev,struct saa7134_buf *buf);
554
555 int saa7134_set_dmabits(struct saa7134_dev *dev);
556
557 /* ----------------------------------------------------------- */
558 /* saa7134-cards.c                                             */
559
560 extern struct saa7134_board saa7134_boards[];
561 extern const unsigned int saa7134_bcount;
562 extern struct pci_device_id __devinitdata saa7134_pci_tbl[];
563
564 extern int saa7134_board_init1(struct saa7134_dev *dev);
565 extern int saa7134_board_init2(struct saa7134_dev *dev);
566
567
568 /* ----------------------------------------------------------- */
569 /* saa7134-i2c.c                                               */
570
571 int saa7134_i2c_register(struct saa7134_dev *dev);
572 int saa7134_i2c_unregister(struct saa7134_dev *dev);
573 void saa7134_i2c_call_clients(struct saa7134_dev *dev,
574                               unsigned int cmd, void *arg);
575
576
577 /* ----------------------------------------------------------- */
578 /* saa7134-video.c                                             */
579
580 extern struct video_device saa7134_video_template;
581 extern struct video_device saa7134_radio_template;
582
583 int saa7134_common_ioctl(struct saa7134_dev *dev,
584                          unsigned int cmd, void *arg);
585
586 int saa7134_video_init1(struct saa7134_dev *dev);
587 int saa7134_video_init2(struct saa7134_dev *dev);
588 int saa7134_video_fini(struct saa7134_dev *dev);
589 void saa7134_irq_video_intl(struct saa7134_dev *dev);
590 void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status);
591
592
593 /* ----------------------------------------------------------- */
594 /* saa7134-ts.c                                                */
595
596 #define TS_PACKET_SIZE 188 /* TS packets 188 bytes */
597
598 extern struct videobuf_queue_ops saa7134_ts_qops;
599
600 int saa7134_ts_init1(struct saa7134_dev *dev);
601 int saa7134_ts_fini(struct saa7134_dev *dev);
602 void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status);
603
604 int saa7134_ts_register(struct saa7134_mpeg_ops *ops);
605 void saa7134_ts_unregister(struct saa7134_mpeg_ops *ops);
606
607 /* ----------------------------------------------------------- */
608 /* saa7134-vbi.c                                               */
609
610 extern struct videobuf_queue_ops saa7134_vbi_qops;
611 extern struct video_device saa7134_vbi_template;
612
613 int saa7134_vbi_init1(struct saa7134_dev *dev);
614 int saa7134_vbi_fini(struct saa7134_dev *dev);
615 void saa7134_irq_vbi_done(struct saa7134_dev *dev, unsigned long status);
616
617
618 /* ----------------------------------------------------------- */
619 /* saa7134-tvaudio.c                                           */
620
621 int saa7134_tvaudio_rx2mode(u32 rx);
622
623 void saa7134_tvaudio_setmute(struct saa7134_dev *dev);
624 void saa7134_tvaudio_setinput(struct saa7134_dev *dev,
625                               struct saa7134_input *in);
626 void saa7134_tvaudio_setvolume(struct saa7134_dev *dev, int level);
627 int saa7134_tvaudio_getstereo(struct saa7134_dev *dev);
628
629 int saa7134_tvaudio_init2(struct saa7134_dev *dev);
630 int saa7134_tvaudio_fini(struct saa7134_dev *dev);
631 int saa7134_tvaudio_do_scan(struct saa7134_dev *dev);
632
633 int saa_dsp_writel(struct saa7134_dev *dev, int reg, u32 value);
634
635 /* ----------------------------------------------------------- */
636 /* saa7134-oss.c                                               */
637
638 extern struct file_operations saa7134_dsp_fops;
639 extern struct file_operations saa7134_mixer_fops;
640
641 int saa7134_oss_init1(struct saa7134_dev *dev);
642 int saa7134_oss_fini(struct saa7134_dev *dev);
643 void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status);
644
645 /* ----------------------------------------------------------- */
646 /* saa7134-input.c                                             */
647
648 int  saa7134_input_init1(struct saa7134_dev *dev);
649 void saa7134_input_fini(struct saa7134_dev *dev);
650 void saa7134_input_irq(struct saa7134_dev *dev);
651
652 int alsa_card_saa7134_create(struct saa7134_dev *saadev);
653 void alsa_card_saa7134_exit(void);
654 void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status);
655
656
657 /*
658  * Local variables:
659  * c-basic-offset: 8
660  * End:
661  */