2006-10-06 18:39:29 +02:00
|
|
|
/*
|
2006-11-24 15:49:39 +01:00
|
|
|
* at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC
|
2006-10-06 18:39:29 +02:00
|
|
|
*
|
|
|
|
* Author: Frank Mandarino <fmandarino@endrelia.com>
|
|
|
|
* Endrelia Technologies Inc.
|
|
|
|
* Created: Mar 3, 2006
|
|
|
|
*
|
|
|
|
* Based on pxa2xx-pcm.h by:
|
|
|
|
*
|
|
|
|
* Author: Nicolas Pitre
|
|
|
|
* Created: Nov 30, 2004
|
|
|
|
* Copyright: MontaVista Software, Inc.
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*/
|
|
|
|
|
2007-02-02 17:19:24 +01:00
|
|
|
#ifndef _AT91_PCM_H
|
|
|
|
#define _AT91_PCM_H
|
|
|
|
|
2006-11-24 15:49:39 +01:00
|
|
|
#include <asm/arch/hardware.h>
|
|
|
|
|
|
|
|
struct at91_ssc_periph {
|
|
|
|
void __iomem *base;
|
|
|
|
u32 pid;
|
|
|
|
};
|
|
|
|
|
2006-10-06 18:39:29 +02:00
|
|
|
/*
|
|
|
|
* Registers and status bits that are required by the PCM driver.
|
|
|
|
*/
|
2006-11-24 15:49:39 +01:00
|
|
|
struct at91_pdc_regs {
|
|
|
|
unsigned int xpr; /* PDC recv/trans pointer */
|
|
|
|
unsigned int xcr; /* PDC recv/trans counter */
|
|
|
|
unsigned int xnpr; /* PDC next recv/trans pointer */
|
|
|
|
unsigned int xncr; /* PDC next recv/trans counter */
|
|
|
|
unsigned int ptcr; /* PDC transfer control */
|
2006-10-06 18:39:29 +02:00
|
|
|
};
|
|
|
|
|
2006-11-24 15:49:39 +01:00
|
|
|
struct at91_ssc_mask {
|
2006-10-06 18:39:29 +02:00
|
|
|
u32 ssc_enable; /* SSC recv/trans enable */
|
|
|
|
u32 ssc_disable; /* SSC recv/trans disable */
|
|
|
|
u32 ssc_endx; /* SSC ENDTX or ENDRX */
|
|
|
|
u32 ssc_endbuf; /* SSC TXBUFE or RXBUFF */
|
|
|
|
u32 pdc_enable; /* PDC recv/trans enable */
|
|
|
|
u32 pdc_disable; /* PDC recv/trans disable */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This structure, shared between the PCM driver and the interface,
|
|
|
|
* contains all information required by the PCM driver to perform the
|
|
|
|
* PDC DMA operation. All fields except dma_intr_handler() are initialized
|
|
|
|
* by the interface. The dms_intr_handler() pointer is set by the PCM
|
|
|
|
* driver and called by the interface SSC interrupt handler if it is
|
|
|
|
* non-NULL.
|
|
|
|
*/
|
2006-11-24 15:49:39 +01:00
|
|
|
struct at91_pcm_dma_params {
|
2006-10-06 18:39:29 +02:00
|
|
|
char *name; /* stream identifier */
|
|
|
|
int pdc_xfer_size; /* PDC counter increment in bytes */
|
2006-11-24 15:49:39 +01:00
|
|
|
void __iomem *ssc_base; /* SSC base address */
|
|
|
|
struct at91_pdc_regs *pdc; /* PDC receive or transmit registers */
|
|
|
|
struct at91_ssc_mask *mask;/* SSC & PDC status bits */
|
|
|
|
struct snd_pcm_substream *substream;
|
|
|
|
void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
|
|
|
|
};
|
2006-10-06 18:39:29 +02:00
|
|
|
|
2006-11-24 15:49:39 +01:00
|
|
|
extern struct snd_soc_platform at91_soc_platform;
|
2006-10-06 18:39:29 +02:00
|
|
|
|
|
|
|
#define at91_ssc_read(a) ((unsigned long) __raw_readl(a))
|
|
|
|
#define at91_ssc_write(a,v) __raw_writel((v),(a))
|
2007-02-02 17:19:24 +01:00
|
|
|
|
|
|
|
#endif /* _AT91_PCM_H */
|