sound/soc/codecs/cs48l32.h

Source file repositories/reference/linux-study-clean/sound/soc/codecs/cs48l32.h

File Facts

System
Linux kernel
Corpus path
sound/soc/codecs/cs48l32.h
Extension
.h
Size
13650 bytes
Lines
404
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 cs48l32_enum {
	struct soc_enum mixer_enum;
	int val;
};

struct cs48l32_eq_control {
	unsigned int reg;
	unsigned int shift;
	unsigned int block_base;
	unsigned int max;
};

struct cs48l32_dai_priv {
	int clk;
	struct snd_pcm_hw_constraint_list constraint;
};

struct cs48l32_dsp_power_reg_block {
	unsigned int start;
	unsigned int end;
};

struct cs48l32_dsp_power_regs {
	const unsigned int *pwd;
	unsigned int n_pwd;
	const struct cs48l32_dsp_power_reg_block *ext;
	unsigned int n_ext;
};

struct cs48l32;
struct cs48l32_codec;
struct spi_device;

struct cs48l32_fll_cfg {
	int n;
	unsigned int theta;
	unsigned int lambda;
	int refdiv;
	int fratio;
	int gain;
	int alt_gain;
};

struct cs48l32_fll {
	struct cs48l32_codec *codec;
	int id;
	unsigned int base;

	unsigned int sts_addr;
	unsigned int sts_mask;
	unsigned int fout;
	int ref_src;
	unsigned int ref_freq;

	struct cs48l32_fll_cfg ref_cfg;
};

struct cs48l32_codec {
	struct wm_adsp dsp;	/* must be first */
	struct cs48l32 core;
	int sysclk;
	int dspclk;
	struct cs48l32_dai_priv dai[CS48L32_MAX_DAI];
	struct cs48l32_fll fll;

	unsigned int in_up_pending;
	unsigned int in_vu_reg;

	struct mutex rate_lock;

	u8 dsp_dma_rates[CS48L32_DSP_N_RX_CHANNELS + CS48L32_DSP_N_TX_CHANNELS];

	u8 in_type[CS48L32_MAX_ANALOG_INPUT][CS48L32_MAX_IN_MUX_WAYS];
	u8 pdm_sup[CS48L32_MAX_ANALOG_INPUT];
	u8 tdm_width[CS48L32_MAX_ASP];
	u8 tdm_slots[CS48L32_MAX_ASP];

	unsigned int eq_mode[CS48L32_N_EQ_BLOCKS];
	__be16 eq_coefficients[CS48L32_N_EQ_BLOCKS][CS48L32_EQ_BLOCK_SZ / 2];

	const struct cs48l32_dsp_power_regs *dsp_power_regs;
};

#define cs48l32_fll_err(_fll, fmt, ...) \
	dev_err(_fll->codec->core.dev, "FLL%d: " fmt, _fll->id, ##__VA_ARGS__)
#define cs48l32_fll_warn(_fll, fmt, ...) \
	dev_warn(_fll->codec->core.dev, "FLL%d: " fmt, _fll->id, ##__VA_ARGS__)
#define cs48l32_fll_dbg(_fll, fmt, ...) \
	dev_dbg(_fll->codec->core.dev, "FLL%d: " fmt, _fll->id, ##__VA_ARGS__)

Annotation

Implementation Notes