sound/soc/fsl/fsl_asrc.h

Source file repositories/reference/linux-study-clean/sound/soc/fsl/fsl_asrc.h

File Facts

System
Linux kernel
Corpus path
sound/soc/fsl/fsl_asrc.h
Extension
.h
Size
16670 bytes
Lines
485
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 asrc_config {
	enum asrc_pair_index pair;
	unsigned int channel_num;
	unsigned int buffer_num;
	unsigned int dma_buffer_size;
	unsigned int input_sample_rate;
	unsigned int output_sample_rate;
	snd_pcm_format_t input_format;
	snd_pcm_format_t output_format;
	enum asrc_inclk inclk;
	enum asrc_outclk outclk;
};

struct asrc_req {
	unsigned int chn_num;
	enum asrc_pair_index index;
};

struct asrc_querybuf {
	unsigned int buffer_index;
	unsigned int input_length;
	unsigned int output_length;
	unsigned long input_offset;
	unsigned long output_offset;
};

struct asrc_convert_buffer {
	void *input_buffer_vaddr;
	void *output_buffer_vaddr;
	unsigned int input_buffer_length;
	unsigned int output_buffer_length;
};

struct asrc_status_flags {
	enum asrc_pair_index index;
	unsigned int overload_error;
};

enum asrc_error_status {
	ASRC_TASK_Q_OVERLOAD		= 0x01,
	ASRC_OUTPUT_TASK_OVERLOAD	= 0x02,
	ASRC_INPUT_TASK_OVERLOAD	= 0x04,
	ASRC_OUTPUT_BUFFER_OVERFLOW	= 0x08,
	ASRC_INPUT_BUFFER_UNDERRUN	= 0x10,
};

struct dma_block {
	dma_addr_t dma_paddr;
	void *dma_vaddr;
	unsigned int length;
};

/**
 * fsl_asrc_soc_data: soc specific data
 *
 * @use_edma: using edma as dma device or not
 * @channel_bits: width of ASRCNCR register for each pair
 * @start_before_dma: start asrc before dma
 */
struct fsl_asrc_soc_data {
	bool use_edma;
	unsigned int channel_bits;
	bool start_before_dma;
};

/**
 * fsl_asrc_pair_priv: ASRC Pair private data
 *
 * @config: configuration profile
 */
struct fsl_asrc_pair_priv {
	struct asrc_config *config;
};

/**
 * fsl_asrc_priv: ASRC private data
 *
 * @asrck_clk: clock sources to driver ASRC internal logic
 * @soc: soc specific data
 * @clk_map: clock map for input/output clock
 * @regcache_cfg: store register value of REG_ASRCFG
 */
struct fsl_asrc_priv {
	struct clk *asrck_clk[ASRC_CLK_MAX_NUM];
	const struct fsl_asrc_soc_data *soc;
	unsigned char *clk_map[2];

	u32 regcache_cfg;
};

Annotation

Implementation Notes