Commit 4ed2ff0a authored by Tony Lindgren's avatar Tony Lindgren

Add OMAP audio driver

Adds OMAP audio driver.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 33a2ee4d
This diff is collapsed.
......@@ -4,6 +4,33 @@
# More hacking for modularisation.
#
# Prompt user for primary drivers.
config SOUND_OMAP
tristate "OMAP Sound Driver"
depends on SOUND_PRIME!=n && SOUND && ARCH_OMAP
---help---
OMAP Audio driver
config SOUND_OMAP_TSC2101
tristate "TSC2101 Stereo Codec"
depends on SOUND_OMAP && ( MACH_OMAP_H2 || MACH_OMAP_H3 )
select OMAP_TSC2101
select OMAP_UWIRE if ARCH_OMAP
---help---
Tsc2101 Audio Codec Driver for OMAP will be enabled.
Will also Enable the following:
1. uWire Driver based on Platform
2. TSC2101 Glue driver
config SOUND_OMAP_AIC23
tristate "AIC23 Stereo Codec"
depends on SOUND_OMAP && ( MACH_OMAP_INNOVATOR || MACH_OMAP_OSK )
select OMAP_DSP if ARCH_OMAP
select SENSORS_TLV320AIC23 if ARCH_OMAP
---help---
AIC23 Audio Codec Driver for OMAP will be enabled.
This will also enable OMAP DSP support because McBSP needed for
this is a DSP peripheral. Additionally, AIC23 I2C support is enabled.
config SOUND_BT878
tristate "BT878 audio dma"
depends on SOUND_PRIME!=n && SOUND
......
......@@ -8,6 +8,10 @@
obj-$(CONFIG_SOUND_OSS) += sound.o
obj-$(CONFIG_SOUND_CS4232) += cs4232.o ad1848.o
obj-$(CONFIG_SOUND_OMAP) += omap-audio-dma-intfc.o omap-audio.o
obj-$(CONFIG_SOUND_OMAP_TSC2101)+= omap-audio-tsc2101.o
obj-$(CONFIG_SOUND_OMAP_AIC23) += omap-audio-aic23.o
# Please leave it as is, cause the link order is significant !
obj-$(CONFIG_SOUND_SH_DAC_AUDIO) += sh_dac_audio.o
......
This diff is collapsed.
This diff is collapsed.
/*
* linux/sound/oss/omap-audio-dma-intfc.h
*
* Common audio DMA handling for the OMAP processors
*
* Copyright (C) 2004 Texas Instruments, Inc.
*
* Copyright (C) 2000, 2001 Nicolas Pitre <nico@cam.org>
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* History:
*
* 2004/08/12 Nishanth Menon - Modified to integrate Audio requirements on 1610,1710 platforms
*/
#ifndef __OMAP_AUDIO_DMA_INTFC_H
#define __OMAP_AUDIO_DMA_INTFC_H
/************************** INCLUDES *************************************/
/* Requires omap-audio.h */
#include "omap-audio.h"
/************************** GLOBAL MACROS *************************************/
/* Provide the Macro interfaces common across platforms */
#define DMA_REQUEST(e,s, cb) {e=omap_request_sound_dma(s->dma_dev, s->id, s, &s->lch);}
#define DMA_FREE(s) omap_free_sound_dma(s, &s->lch)
#define DMA_CLEAR(s) omap_clear_sound_dma(s)
/************************** GLOBAL DATA STRUCTURES *********************************/
typedef void (*dma_callback_t) (int lch, u16 ch_status, void *data);
/************************** GLOBAL FUNCTIONS ***************************************/
dma_callback_t audio_get_dma_callback(void);
int audio_setup_buf(audio_stream_t * s);
int audio_process_dma(audio_stream_t * s);
void audio_prime_rx(audio_state_t * state);
int audio_set_fragments(audio_stream_t * s, int val);
int audio_sync(struct file *file);
void audio_stop_dma(audio_stream_t * s);
u_int audio_get_dma_pos(audio_stream_t * s);
void audio_reset(audio_stream_t * s);
void audio_discard_buf(audio_stream_t * s);
/**************** ARCH SPECIFIC FUNCIONS *******************************************/
void omap_clear_sound_dma(audio_stream_t * s);
int omap_request_sound_dma(int device_id, const char *device_name, void *data,
int **channels);
int omap_free_sound_dma(void *data, int **channels);
#endif /* #ifndef __OMAP_AUDIO_DMA_INTFC_H */
This diff is collapsed.
This diff is collapsed.
/*
* linux/sound/oss/omap-audio.h
*
* Common audio handling for the OMAP processors
*
* Copyright (C) 2004 Texas Instruments, Inc.
*
* Copyright (C) 2000, 2001 Nicolas Pitre <nico@cam.org>
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* History
* -------
* 2004/08/12 Nishanth Menon - Modified to integrate Audio requirements on 1610,1710 platforms
*
* 2004/04/04 Nishanth menon - Added hooks for power management
*/
#ifndef __OMAP_AUDIO_H
#define __OMAP_AUDIO_H
/* Requires dma.h */
#include <asm/arch/dma.h>
/*
* Buffer Management
*/
typedef struct {
int offset; /* current offset */
char *data; /* points to actual buffer */
dma_addr_t dma_addr; /* physical buffer address */
int dma_ref; /* DMA refcount */
int master; /* owner for buffer allocation, contain size when true */
} audio_buf_t;
/*
* Structure describing the data stream related information
*/
typedef struct {
char *id; /* identification string */
audio_buf_t *buffers; /* pointer to audio buffer structures */
u_int usr_head; /* user fragment index */
u_int dma_head; /* DMA fragment index to go */
u_int dma_tail; /* DMA fragment index to complete */
u_int fragsize; /* fragment i.e. buffer size */
u_int nbfrags; /* nbr of fragments i.e. buffers */
u_int pending_frags; /* Fragments sent to DMA */
int dma_dev; /* device identifier for DMA */
#ifdef OMAP_DMA_CHAINING_SUPPORT
lch_chain *dma_chain;
dma_regs_t *dma_regs; /* points to our DMA registers */
#else
char started; /* to store if the chain was started or not */
int dma_q_head; /* DMA Channel Q Head */
int dma_q_tail; /* DMA Channel Q Tail */
char dma_q_count; /* DMA Channel Q Count */
char in_use; /* Is this is use? */
int *lch; /* Chain of channels this stream is linked to */
#endif
int input_or_output; /* Direction of this data stream */
int bytecount; /* nbr of processed bytes */
int fragcount; /* nbr of fragment transitions */
struct semaphore sem; /* account for fragment usage */
wait_queue_head_t wq; /* for poll */
int dma_spinref; /* DMA is spinning */
unsigned mapped:1; /* mmap()'ed buffers */
unsigned active:1; /* actually in progress */
unsigned stopped:1; /* might be active but stopped */
unsigned spin_idle:1; /* have DMA spin on zeros when idle */
unsigned linked:1; /* dma channels linked */
} audio_stream_t;
/*
* State structure for one instance
*/
typedef struct {
struct module *owner; /* Codec module ID */
audio_stream_t *output_stream;
audio_stream_t *input_stream;
unsigned rd_ref:1; /* open reference for recording */
unsigned wr_ref:1; /* open reference for playback */
unsigned need_tx_for_rx:1; /* if data must be sent while receiving */
void *data;
void (*hw_init) (void *);
void (*hw_shutdown) (void *);
int (*client_ioctl) (struct inode *, struct file *, uint, ulong);
int (*hw_probe) (void);
void (*hw_remove) (void);
void (*hw_cleanup) (void);
int (*hw_suspend) (void);
int (*hw_resume) (void);
struct pm_dev *pm_dev;
struct semaphore sem; /* to protect against races in attach() */
} audio_state_t;
#ifdef AUDIO_PM
void audio_ldm_suspend(void *data);
void audio_ldm_resume(void *data);
#endif
/* Register a Codec using this function */
extern int audio_register_codec(audio_state_t * codec_state);
/* Un-Register a Codec using this function */
extern int audio_unregister_codec(audio_state_t * codec_state);
/* Function to provide fops of omap audio driver */
extern struct file_operations *audio_get_fops(void);
/* Function to initialize the device info for audio driver */
extern int audio_dev_init(void);
/* Function to un-initialize the device info for audio driver */
void audio_dev_uninit(void);
#endif /* End of #ifndef __OMAP_AUDIO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment