~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/atmel/atmel-pcm.h

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC.
  3  *
  4  *  Copyright (C) 2005 SAN People
  5  *  Copyright (C) 2008 Atmel
  6  *
  7  * Authors: Sedji Gaouaou <sedji.gaouaou@atmel.com>
  8  *
  9  * Based on at91-pcm. by:
 10  * Frank Mandarino <fmandarino@endrelia.com>
 11  * Copyright 2006 Endrelia Technologies Inc.
 12  *
 13  * Based on pxa2xx-pcm.c by:
 14  *
 15  * Author:      Nicolas Pitre
 16  * Created:     Nov 30, 2004
 17  * Copyright:   (C) 2004 MontaVista Software, Inc.
 18  *
 19  * This program is free software; you can redistribute it and/or modify
 20  * it under the terms of the GNU General Public License as published by
 21  * the Free Software Foundation; either version 2 of the License, or
 22  * (at your option) any later version.
 23  *
 24  * This program is distributed in the hope that it will be useful,
 25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 27  * GNU General Public License for more details.
 28  *
 29  * You should have received a copy of the GNU General Public License
 30  * along with this program; if not, write to the Free Software
 31  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 32  */
 33 
 34 #ifndef _ATMEL_PCM_H
 35 #define _ATMEL_PCM_H
 36 
 37 #include <linux/atmel-ssc.h>
 38 
 39 #define ATMEL_SSC_DMABUF_SIZE   (64 * 1024)
 40 
 41 /*
 42  * Registers and status bits that are required by the PCM driver.
 43  */
 44 struct atmel_pdc_regs {
 45         unsigned int    xpr;            /* PDC recv/trans pointer */
 46         unsigned int    xcr;            /* PDC recv/trans counter */
 47         unsigned int    xnpr;           /* PDC next recv/trans pointer */
 48         unsigned int    xncr;           /* PDC next recv/trans counter */
 49         unsigned int    ptcr;           /* PDC transfer control */
 50 };
 51 
 52 struct atmel_ssc_mask {
 53         u32     ssc_enable;             /* SSC recv/trans enable */
 54         u32     ssc_disable;            /* SSC recv/trans disable */
 55         u32     ssc_error;              /* SSC error conditions */
 56         u32     ssc_endx;               /* SSC ENDTX or ENDRX */
 57         u32     ssc_endbuf;             /* SSC TXBUFE or RXBUFF */
 58         u32     pdc_enable;             /* PDC recv/trans enable */
 59         u32     pdc_disable;            /* PDC recv/trans disable */
 60 };
 61 
 62 /*
 63  * This structure, shared between the PCM driver and the interface,
 64  * contains all information required by the PCM driver to perform the
 65  * PDC DMA operation.  All fields except dma_intr_handler() are initialized
 66  * by the interface.  The dma_intr_handler() pointer is set by the PCM
 67  * driver and called by the interface SSC interrupt handler if it is
 68  * non-NULL.
 69  */
 70 struct atmel_pcm_dma_params {
 71         char *name;                     /* stream identifier */
 72         int pdc_xfer_size;              /* PDC counter increment in bytes */
 73         struct ssc_device *ssc;         /* SSC device for stream */
 74         struct atmel_pdc_regs *pdc;     /* PDC receive or transmit registers */
 75         struct atmel_ssc_mask *mask;    /* SSC & PDC status bits */
 76         struct snd_pcm_substream *substream;
 77         void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
 78 };
 79 
 80 /*
 81  * SSC register access (since ssc_writel() / ssc_readl() require literal name)
 82  */
 83 #define ssc_readx(base, reg)            (__raw_readl((base) + (reg)))
 84 #define ssc_writex(base, reg, value)    __raw_writel((value), (base) + (reg))
 85 
 86 #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC)
 87 int atmel_pcm_pdc_platform_register(struct device *dev);
 88 void atmel_pcm_pdc_platform_unregister(struct device *dev);
 89 #else
 90 static inline int atmel_pcm_pdc_platform_register(struct device *dev)
 91 {
 92         return 0;
 93 }
 94 static inline void atmel_pcm_pdc_platform_unregister(struct device *dev)
 95 {
 96 }
 97 #endif
 98 
 99 #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA)
100 int atmel_pcm_dma_platform_register(struct device *dev);
101 void atmel_pcm_dma_platform_unregister(struct device *dev);
102 #else
103 static inline int atmel_pcm_dma_platform_register(struct device *dev)
104 {
105         return 0;
106 }
107 static inline void atmel_pcm_dma_platform_unregister(struct device *dev)
108 {
109 }
110 #endif
111 
112 #endif /* _ATMEL_PCM_H */
113 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp