bci: some more code for testing
[pandora-kernel.git] / sound / oss / omap-audio-dma-intfc.h
1 /*  
2  * linux/sound/oss/omap-audio-dma-intfc.h
3  *
4  * Common audio DMA handling for the OMAP processors
5  *
6  * Copyright (C) 2004 Texas Instruments, Inc.
7  *
8  * Copyright (C) 2000, 2001 Nicolas Pitre <nico@cam.org>
9  *
10  * This package is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  *
14  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  *
18  * History:
19  *
20  * 2004/08/12  Nishanth Menon - Modified to integrate Audio requirements on 1610,1710 platforms
21  */
22
23 #ifndef __OMAP_AUDIO_DMA_INTFC_H
24 #define __OMAP_AUDIO_DMA_INTFC_H
25
26 /************************** INCLUDES *************************************/
27
28 /* Requires omap-audio.h */
29 #include "omap-audio.h"
30
31 /************************** GLOBAL MACROS *************************************/
32
33 /* Provide the Macro interfaces common across platforms */
34 #define DMA_REQUEST(e,s, cb)    {e=omap_request_sound_dma(s->dma_dev, s->id, s, &s->lch);}
35 #define DMA_FREE(s)             omap_free_sound_dma(s, &s->lch)
36 #define DMA_CLEAR(s)            omap_clear_sound_dma(s)
37
38 /************************** GLOBAL DATA STRUCTURES *********************************/
39
40 typedef void (*dma_callback_t) (int lch, u16 ch_status, void *data);
41
42 /************************** GLOBAL FUNCTIONS ***************************************/
43
44 dma_callback_t audio_get_dma_callback(void);
45 int audio_setup_buf(audio_stream_t * s);
46 int audio_process_dma(audio_stream_t * s);
47 void audio_prime_rx(audio_state_t * state);
48 int audio_set_fragments(audio_stream_t * s, int val);
49 int audio_sync(struct file *file);
50 void audio_stop_dma(audio_stream_t * s);
51 u_int audio_get_dma_pos(audio_stream_t * s);
52 void audio_reset(audio_stream_t * s);
53 void audio_discard_buf(audio_stream_t * s);
54
55 /**************** ARCH SPECIFIC FUNCIONS *******************************************/
56
57 void omap_clear_sound_dma(audio_stream_t * s);
58
59 int omap_request_sound_dma(int device_id, const char *device_name, void *data,
60                            int **channels);
61 int omap_free_sound_dma(void *data, int **channels);
62
63 #endif                          /* #ifndef __OMAP_AUDIO_DMA_INTFC_H */