cleanup
[linux-2.4.21-pre4.git] / drivers / sound / emu10k1 / passthrough.h
1 /*
2  **********************************************************************
3  *     passthrough.h -- Emu10k1 digital passthrough header file
4  *     Copyright (C) 2001  Juha Yrjölä <jyrjola@cc.hut.fi>
5  *
6  **********************************************************************
7  *
8  *     Date                 Author          Summary of changes
9  *     ----                 ------          ------------------
10  *     May 15, 2001         Juha Yrjölä     base code release
11  *
12  **********************************************************************
13  *
14  *     This program is free software; you can redistribute it and/or
15  *     modify it under the terms of the GNU General Public License as
16  *     published by the Free Software Foundation; either version 2 of
17  *     the License, or (at your option) any later version.
18  *
19  *     This program is distributed in the hope that it will be useful,
20  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *     GNU General Public License for more details.
23  *
24  *     You should have received a copy of the GNU General Public
25  *     License along with this program; if not, write to the Free
26  *     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27  *     USA.
28  *
29  **********************************************************************
30  */
31
32 #ifndef _PASSTHROUGH_H
33 #define _PASSTHROUGH_H
34
35 #include "audio.h"
36
37 /* number of 16-bit stereo samples in XTRAM buffer */
38 #define PT_SAMPLES 0x8000
39 #define PT_BLOCKSAMPLES 0x400
40 #define PT_BLOCKSIZE (PT_BLOCKSAMPLES*4)
41 #define PT_BLOCKSIZE_LOG2 12
42 #define PT_BLOCKCOUNT (PT_SAMPLES/PT_BLOCKSAMPLES)
43 #define PT_INITPTR (PT_SAMPLES/2-1)
44
45 #define PT_STATE_INACTIVE 0
46 #define PT_STATE_ACTIVATED 1
47 #define PT_STATE_PLAYING 2
48
49 /* passthrough struct */
50 struct pt_data
51 {
52         u8      selected, state, spcs_to_use;
53         int     intr_gpr, enable_gpr, pos_gpr;
54         u32     blocks_played, blocks_copied, old_spcs[3];
55         u32     playptr, copyptr;
56         u32     prepend_size;
57         u8      *buf;
58         u8      ac3data;
59
60         char    *patch_name, *intr_gpr_name, *enable_gpr_name, *pos_gpr_name;
61
62         wait_queue_head_t wait;
63         spinlock_t lock;
64 };
65
66 ssize_t emu10k1_pt_write(struct file *file, const char *buf, size_t count);
67 void emu10k1_pt_stop(struct emu10k1_card *card);
68 void emu10k1_pt_waveout_update(struct emu10k1_wavedevice *wave_dev);
69
70 #endif /* _PASSTHROUGH_H */