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

TOMOYO Linux Cross Reference
Linux/sound/soc/fsl/fsl_asrc_common.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright 2019 NXP
  4  *
  5  */
  6 
  7 #ifndef _FSL_ASRC_COMMON_H
  8 #define _FSL_ASRC_COMMON_H
  9 
 10 /* directions */
 11 #define IN      0
 12 #define OUT     1
 13 
 14 enum asrc_pair_index {
 15         ASRC_INVALID_PAIR = -1,
 16         ASRC_PAIR_A = 0,
 17         ASRC_PAIR_B = 1,
 18         ASRC_PAIR_C = 2,
 19         ASRC_PAIR_D = 3,
 20 };
 21 
 22 #define PAIR_CTX_NUM  0x4
 23 
 24 /**
 25  * fsl_asrc_pair: ASRC Pair common data
 26  *
 27  * @asrc: pointer to its parent module
 28  * @error: error record
 29  * @index: pair index (ASRC_PAIR_A, ASRC_PAIR_B, ASRC_PAIR_C)
 30  * @channels: occupied channel number
 31  * @desc: input and output dma descriptors
 32  * @dma_chan: inputer and output DMA channels
 33  * @dma_data: private dma data
 34  * @pos: hardware pointer position
 35  * @req_dma_chan: flag to release dev_to_dev chan
 36  * @private: pair private area
 37  */
 38 struct fsl_asrc_pair {
 39         struct fsl_asrc *asrc;
 40         unsigned int error;
 41 
 42         enum asrc_pair_index index;
 43         unsigned int channels;
 44 
 45         struct dma_async_tx_descriptor *desc[2];
 46         struct dma_chan *dma_chan[2];
 47         struct imx_dma_data dma_data;
 48         unsigned int pos;
 49         bool req_dma_chan;
 50 
 51         void *private;
 52 };
 53 
 54 /**
 55  * fsl_asrc: ASRC common data
 56  *
 57  * @dma_params_rx: DMA parameters for receive channel
 58  * @dma_params_tx: DMA parameters for transmit channel
 59  * @pdev: platform device pointer
 60  * @regmap: regmap handler
 61  * @paddr: physical address to the base address of registers
 62  * @mem_clk: clock source to access register
 63  * @ipg_clk: clock source to drive peripheral
 64  * @spba_clk: SPBA clock (optional, depending on SoC design)
 65  * @lock: spin lock for resource protection
 66  * @pair: pair pointers
 67  * @channel_avail: non-occupied channel numbers
 68  * @asrc_rate: default sample rate for ASoC Back-Ends
 69  * @asrc_format: default sample format for ASoC Back-Ends
 70  * @use_edma: edma is used
 71  * @get_dma_channel: function pointer
 72  * @request_pair: function pointer
 73  * @release_pair: function pointer
 74  * @get_fifo_addr: function pointer
 75  * @pair_priv_size: size of pair private struct.
 76  * @private: private data structure
 77  */
 78 struct fsl_asrc {
 79         struct snd_dmaengine_dai_dma_data dma_params_rx;
 80         struct snd_dmaengine_dai_dma_data dma_params_tx;
 81         struct platform_device *pdev;
 82         struct regmap *regmap;
 83         unsigned long paddr;
 84         struct clk *mem_clk;
 85         struct clk *ipg_clk;
 86         struct clk *spba_clk;
 87         spinlock_t lock;      /* spin lock for resource protection */
 88 
 89         struct fsl_asrc_pair *pair[PAIR_CTX_NUM];
 90         unsigned int channel_avail;
 91 
 92         int asrc_rate;
 93         snd_pcm_format_t asrc_format;
 94         bool use_edma;
 95 
 96         struct dma_chan *(*get_dma_channel)(struct fsl_asrc_pair *pair, bool dir);
 97         int (*request_pair)(int channels, struct fsl_asrc_pair *pair);
 98         void (*release_pair)(struct fsl_asrc_pair *pair);
 99         int (*get_fifo_addr)(u8 dir, enum asrc_pair_index index);
100         size_t pair_priv_size;
101 
102         void *private;
103 };
104 
105 #define DRV_NAME "fsl-asrc-dai"
106 extern struct snd_soc_component_driver fsl_asrc_component;
107 
108 #endif /* _FSL_ASRC_COMMON_H */
109 

~ [ 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