/*1* at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC.2*3* Copyright (C) 2005 SAN People4* Copyright (C) 2008 Atmel5*6* Authors: Sedji Gaouaou <[email protected]>7*8* Based on at91-pcm. by:9* Frank Mandarino <[email protected]>10* Copyright 2006 Endrelia Technologies Inc.11*12* Based on pxa2xx-pcm.c by:13*14* Author: Nicolas Pitre15* Created: Nov 30, 200416* Copyright: (C) 2004 MontaVista Software, Inc.17*18* This program is free software; you can redistribute it and/or modify19* it under the terms of the GNU General Public License as published by20* the Free Software Foundation; either version 2 of the License, or21* (at your option) any later version.22*23* This program is distributed in the hope that it will be useful,24* but WITHOUT ANY WARRANTY; without even the implied warranty of25* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the26* GNU General Public License for more details.27*28* You should have received a copy of the GNU General Public License29* along with this program; if not, write to the Free Software30* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA31*/3233#ifndef _ATMEL_PCM_H34#define _ATMEL_PCM_H3536#include <linux/atmel-ssc.h>3738/*39* Registers and status bits that are required by the PCM driver.40*/41struct atmel_pdc_regs {42unsigned int xpr; /* PDC recv/trans pointer */43unsigned int xcr; /* PDC recv/trans counter */44unsigned int xnpr; /* PDC next recv/trans pointer */45unsigned int xncr; /* PDC next recv/trans counter */46unsigned int ptcr; /* PDC transfer control */47};4849struct atmel_ssc_mask {50u32 ssc_enable; /* SSC recv/trans enable */51u32 ssc_disable; /* SSC recv/trans disable */52u32 ssc_endx; /* SSC ENDTX or ENDRX */53u32 ssc_endbuf; /* SSC TXBUFE or RXBUFF */54u32 pdc_enable; /* PDC recv/trans enable */55u32 pdc_disable; /* PDC recv/trans disable */56};5758/*59* This structure, shared between the PCM driver and the interface,60* contains all information required by the PCM driver to perform the61* PDC DMA operation. All fields except dma_intr_handler() are initialized62* by the interface. The dms_intr_handler() pointer is set by the PCM63* driver and called by the interface SSC interrupt handler if it is64* non-NULL.65*/66struct atmel_pcm_dma_params {67char *name; /* stream identifier */68int pdc_xfer_size; /* PDC counter increment in bytes */69struct ssc_device *ssc; /* SSC device for stream */70struct atmel_pdc_regs *pdc; /* PDC receive or transmit registers */71struct atmel_ssc_mask *mask; /* SSC & PDC status bits */72struct snd_pcm_substream *substream;73void (*dma_intr_handler)(u32, struct snd_pcm_substream *);74};7576/*77* SSC register access (since ssc_writel() / ssc_readl() require literal name)78*/79#define ssc_readx(base, reg) (__raw_readl((base) + (reg)))80#define ssc_writex(base, reg, value) __raw_writel((value), (base) + (reg))8182#endif /* _ATMEL_PCM_H */838485