*
* Common audio DMA handling for the OMAP processors
*
+ * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
+ *
* Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
*
* Copyright (C) 2004 Texas Instruments, Inc.
#include <asm/arch/mcbsp.h>
-#include "omap-aic23.h"
-
#undef DEBUG
-//#define DEBUG
+#define DEBUG
#ifdef DEBUG
#define DPRINTK(ARGS...) printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
#define FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
FN_OUT(0);
}
-int omap_request_sound_dma(int device_id, const char *device_name,
+int omap_request_alsa_sound_dma(int device_id, const char *device_name,
void *data, int **channels)
{
int i, err = 0;
}
spin_lock(&dma_list_lock);
for (i = 0; i < nr_linked_channels; i++) {
- err =
- omap_request_dma(device_id, device_name,
- sound_dma_irq_handler, data,
- &chan[i]);
+ err = omap_request_dma(device_id,
+ device_name,
+ sound_dma_irq_handler,
+ data,
+ &chan[i]);
/* Handle Failure condition here */
if (err < 0) {
**************************************************************************************/
static void omap_sound_dma_unlink_lch(void *data)
{
- struct audio_stream *s = (struct audio_stream *) data;
+ struct audio_stream *s = (struct audio_stream *)data;
int *chan = s->lch;
int i;
FN_OUT(0);
}
-int omap_free_sound_dma(void *data, int **channels)
+int omap_free_alsa_sound_dma(void *data, int **channels)
{
-
int i;
int *chan = NULL;
+
FN_IN;
if (unlikely(NULL == channels)) {
BUG();
* Stop all the DMA channels of the stream
*
**************************************************************************************/
-void omap_audio_stop_dma(struct audio_stream *s)
+void omap_stop_alsa_sound_dma(struct audio_stream *s)
{
int *chan = s->lch;
int i;
+
FN_IN;
if (unlikely(NULL == chan)) {
BUG();
* Clear any pending transfers
*
**************************************************************************************/
-void omap_clear_sound_dma(struct audio_stream * s)
+void omap_clear_alsa_sound_dma(struct audio_stream * s)
{
FN_IN;
omap_clear_dma(s->lch[s->dma_q_head]);
return;
}
-/*********************************** MODULE FUNCTIONS DEFINTIONS ***********************/
-
-#ifdef OMAP1610_MCBSP1_BASE
-#undef OMAP1610_MCBSP1_BASE
-#endif
-#define OMAP1610_MCBSP1_BASE 0xE1011000
-
/***************************************************************************************
*
* DMA related functions
int dt = 0x1; /* data type 16 */
int cen = 32; /* Stereo */
int cfn = dma_size / (2 * cen);
+
FN_IN;
omap_set_dma_dest_params(channel, 0x05, 0x00,
- (OMAP1610_MCBSP1_BASE + 0x806),
+ (OMAP1510_MCBSP1_BASE + 0x06),
0, 0);
omap_set_dma_src_params(channel, 0x00, 0x01, dma_ptr,
0, 0);
{
int dt = 0x1; /* data type 16 */
int cen = 32; /* stereo */
-
int cfn = dma_size / (2 * cen);
+
FN_IN;
omap_set_dma_src_params(channel, 0x05, 0x00,
- (OMAP1610_MCBSP1_BASE + 0x802),
+ (OMAP1510_MCBSP1_BASE + 0x02),
0, 0);
omap_set_dma_dest_params(channel, 0x00, 0x01, dma_ptr, 0, 0);
omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00, 0, 0);
int channel = s->lch[s->dma_q_head];
FN_IN;
if (!s->started) {
- s->hw_stop(); /* stops McBSP Interface */
+ s->hw_stop(); /* stops McBSP Interface */
omap_start_dma(channel);
s->started = 1;
s->hw_start(); /* start McBSP interface */
* Do the initial set of work to initialize all the channels as required.
* We shall then initate a transfer
*/
-int omap_start_sound_dma(struct audio_stream *s, dma_addr_t dma_ptr,
- u_int dma_size)
+int omap_start_alsa_sound_dma(struct audio_stream *s,
+ dma_addr_t dma_ptr,
+ u_int dma_size)
{
int ret = -EPERM;
}
if (ch_status & DCSR_END_BLOCK)
- audio_dma_callback(s);
+ callback_omap_alsa_sound_dma(s);
FN_OUT(0);
return;
}
MODULE_AUTHOR("Texas Instruments");
-MODULE_DESCRIPTION
- ("Common DMA handling for Audio driver on OMAP processors");
+MODULE_DESCRIPTION("Common DMA handling for Audio driver on OMAP processors");
MODULE_LICENSE("GPL");
-EXPORT_SYMBOL(omap_start_sound_dma);
-EXPORT_SYMBOL(omap_clear_sound_dma);
-EXPORT_SYMBOL(omap_request_sound_dma);
-EXPORT_SYMBOL(omap_free_sound_dma);
-EXPORT_SYMBOL(omap_audio_stop_dma);
+EXPORT_SYMBOL(omap_start_alsa_sound_dma);
+EXPORT_SYMBOL(omap_clear_alsa_sound_dma);
+EXPORT_SYMBOL(omap_request_alsa_sound_dma);
+EXPORT_SYMBOL(omap_free_alsa_sound_dma);
+EXPORT_SYMBOL(omap_stop_alsa_sound_dma);