sound/soc/fsl/fsl_micfil.c

Source file repositories/reference/linux-study-clean/sound/soc/fsl/fsl_micfil.c

File Facts

System
Linux kernel
Corpus path
sound/soc/fsl/fsl_micfil.c
Extension
.c
Size
50079 bytes
Lines
1750
Domain
Driver Families
Bucket
sound/soc
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct fsl_micfil {
	struct platform_device *pdev;
	struct regmap *regmap;
	const struct fsl_micfil_soc_data *soc;
	struct clk *busclk;
	struct clk *mclk;
	struct clk *pll8k_clk;
	struct clk *pll11k_clk;
	struct clk *clk_src[MICFIL_CLK_SRC_NUM];
	struct snd_dmaengine_dai_dma_data dma_params_rx;
	struct sdma_peripheral_config sdmacfg;
	struct snd_soc_card *card;
	struct snd_pcm_hw_constraint_list constraint_rates;
	unsigned int constraint_rates_list[MICFIL_NUM_RATES];
	unsigned int dataline;
	char name[32];
	int irq[MICFIL_IRQ_LINES];
	enum quality quality;
	int dc_remover;
	int dc_out_remover;
	int vad_init_mode;
	int vad_enabled;
	int vad_detected;
	struct fsl_micfil_verid verid;
	struct fsl_micfil_param param;
	bool mclk_flag;  /* mclk enable flag */
	bool dec_bypass;
};

struct fsl_micfil_soc_data {
	unsigned int fifos;
	unsigned int fifo_depth;
	unsigned int dataline;
	bool imx;
	bool use_edma;
	bool use_verid;
	bool volume_sx;
	u64  formats;
	int  fifo_offset;
	enum quality default_quality;
	/* stores const value in formula to calculate range */
	int rangeadj_const[3][2];
};

static struct fsl_micfil_soc_data fsl_micfil_imx8mm = {
	.imx = true,
	.fifos = 8,
	.fifo_depth = 8,
	.dataline =  0xf,
	.formats = SNDRV_PCM_FMTBIT_S16_LE,
	.volume_sx = true,
	.fifo_offset = 0,
	.default_quality = QUALITY_VLOW0,
};

static struct fsl_micfil_soc_data fsl_micfil_imx8mp = {
	.imx = true,
	.fifos = 8,
	.fifo_depth = 32,
	.dataline =  0xf,
	.formats = SNDRV_PCM_FMTBIT_S32_LE,
	.volume_sx = false,
	.fifo_offset = 0,
	.default_quality = QUALITY_MEDIUM,
	.rangeadj_const = {{27, 7}, {27, 7}, {26, 7}},
};

static struct fsl_micfil_soc_data fsl_micfil_imx93 = {
	.imx = true,
	.fifos = 8,
	.fifo_depth = 32,
	.dataline =  0xf,
	.formats = SNDRV_PCM_FMTBIT_S32_LE,
	.use_edma = true,
	.use_verid = true,
	.volume_sx = false,
	.fifo_offset = 0,
	.default_quality = QUALITY_MEDIUM,
	.rangeadj_const = {{30, 6}, {30, 6}, {29, 6}},
};

static struct fsl_micfil_soc_data fsl_micfil_imx943 = {
	.imx = true,
	.fifos = 8,
	.fifo_depth = 32,
	.dataline =  0xf,
	.formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_DSD_U32_LE,
	.use_edma = true,
	.use_verid = true,
	.volume_sx = false,

Annotation

Implementation Notes