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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC.
  4  *
  5  *  Copyright (C) 2005 SAN People
  6  *  Copyright (C) 2008 Atmel
  7  *
  8  * Authors: Sedji Gaouaou <sedji.gaouaou@atmel.com>
  9  *
 10  * Based on at91-pcm. by:
 11  * Frank Mandarino <fmandarino@endrelia.com>
 12  * Copyright 2006 Endrelia Technologies Inc.
 13  *
 14  * Based on pxa2xx-pcm.c by:
 15  *
 16  * Author:      Nicolas Pitre
 17  * Created:     Nov 30, 2004
 18  * Copyright:   (C) 2004 MontaVista Software, Inc.
 19  */
 20 
 21 #ifndef _ATMEL_PCM_H
 22 #define _ATMEL_PCM_H
 23 
 24 #include <linux/atmel-ssc.h>
 25 
 26 #define ATMEL_SSC_DMABUF_SIZE   (64 * 1024)
 27 
 28 /*
 29  * Registers and status bits that are required by the PCM driver.
 30  */
 31 struct atmel_pdc_regs {
 32         unsigned int    xpr;            /* PDC recv/trans pointer */
 33         unsigned int    xcr;            /* PDC recv/trans counter */
 34         unsigned int    xnpr;           /* PDC next recv/trans pointer */
 35         unsigned int    xncr;           /* PDC next recv/trans counter */
 36         unsigned int    ptcr;           /* PDC transfer control */
 37 };
 38 
 39 struct atmel_ssc_mask {
 40         u32     ssc_enable;             /* SSC recv/trans enable */
 41         u32     ssc_disable;            /* SSC recv/trans disable */
 42         u32     ssc_error;              /* SSC error conditions */
 43         u32     ssc_endx;               /* SSC ENDTX or ENDRX */
 44         u32     ssc_endbuf;             /* SSC TXBUFE or RXBUFF */
 45         u32     pdc_enable;             /* PDC recv/trans enable */
 46         u32     pdc_disable;            /* PDC recv/trans disable */
 47 };
 48 
 49 /*
 50  * This structure, shared between the PCM driver and the interface,
 51  * contains all information required by the PCM driver to perform the
 52  * PDC DMA operation.  All fields except dma_intr_handler() are initialized
 53  * by the interface.  The dma_intr_handler() pointer is set by the PCM
 54  * driver and called by the interface SSC interrupt handler if it is
 55  * non-NULL.
 56  */
 57 struct atmel_pcm_dma_params {
 58         char *name;                     /* stream identifier */
 59         int pdc_xfer_size;              /* PDC counter increment in bytes */
 60         struct ssc_device *ssc;         /* SSC device for stream */
 61         struct atmel_pdc_regs *pdc;     /* PDC receive or transmit registers */
 62         struct atmel_ssc_mask *mask;    /* SSC & PDC status bits */
 63         struct snd_pcm_substream *substream;
 64         void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
 65 };
 66 
 67 /*
 68  * SSC register access (since ssc_writel() / ssc_readl() require literal name)
 69  */
 70 #define ssc_readx(base, reg)            (__raw_readl((base) + (reg)))
 71 #define ssc_writex(base, reg, value)    __raw_writel((value), (base) + (reg))
 72 
 73 #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC)
 74 int atmel_pcm_pdc_platform_register(struct device *dev);
 75 #else
 76 static inline int atmel_pcm_pdc_platform_register(struct device *dev)
 77 {
 78         return 0;
 79 }
 80 #endif
 81 
 82 #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA)
 83 int atmel_pcm_dma_platform_register(struct device *dev);
 84 #else
 85 static inline int atmel_pcm_dma_platform_register(struct device *dev)
 86 {
 87         return 0;
 88 }
 89 #endif
 90 
 91 #endif /* _ATMEL_PCM_H */
 92 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php