2 * linux/sound/oss/omap-audio-dma-intfc.h
4 * Common audio DMA handling for the OMAP processors
6 * Copyright (C) 2004 Texas Instruments, Inc.
8 * Copyright (C) 2000, 2001 Nicolas Pitre <nico@cam.org>
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.
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.
20 * 2004/08/12 Nishanth Menon - Modified to integrate Audio requirements on 1610,1710 platforms
23 #ifndef __OMAP_AUDIO_DMA_INTFC_H
24 #define __OMAP_AUDIO_DMA_INTFC_H
26 /************************** INCLUDES *************************************/
28 /* Requires omap-audio.h */
29 #include "omap-audio.h"
31 /************************** GLOBAL MACROS *************************************/
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)
38 /************************** GLOBAL DATA STRUCTURES *********************************/
40 typedef void (*dma_callback_t
) (int lch
, u16 ch_status
, void *data
);
42 /************************** GLOBAL FUNCTIONS ***************************************/
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
);
55 /**************** ARCH SPECIFIC FUNCIONS *******************************************/
57 void omap_clear_sound_dma(audio_stream_t
* s
);
59 int omap_request_sound_dma(int device_id
, const char *device_name
, void *data
,
61 int omap_free_sound_dma(void *data
, int **channels
);
63 #endif /* #ifndef __OMAP_AUDIO_DMA_INTFC_H */