sound/soc/codecs/lpass-va-macro.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/lpass-va-macro.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/lpass-va-macro.c- Extension
.c- Size
- 53105 bytes
- Lines
- 1782
- 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.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/clk.hlinux/clk-provider.hlinux/init.hlinux/io.hlinux/module.hlinux/of_clk.hlinux/of_platform.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hsound/soc.hsound/soc-dapm.hsound/tlv.hlpass-macro-common.h
Detected Declarations
struct va_macrostruct va_macro_datafunction va_is_volatile_registerfunction va_is_rw_registerfunction va_is_readable_registerfunction va_clk_rsc_fs_gen_requestfunction va_macro_mclk_enablefunction va_macro_mclk_eventfunction va_macro_put_dec_enumfunction va_macro_tx_mixer_getfunction va_macro_tx_mixer_putfunction va_dmic_clk_enablefunction va_macro_enable_dmicfunction va_macro_enable_decfunction va_macro_dec_mode_getfunction va_macro_dec_mode_putfunction va_macro_hw_paramsfunction for_each_set_bitfunction va_macro_get_channel_mapfunction va_macro_digital_mutefunction for_each_set_bitfunction va_macro_component_probefunction fsgen_gate_enablefunction fsgen_gate_disablefunction fsgen_gate_is_enabledfunction va_macro_register_fsgen_outputfunction va_macro_validate_dmic_sample_ratefunction va_macro_set_lpass_codec_versionfunction va_macro_probefunction va_macro_removefunction va_macro_runtime_suspendfunction va_macro_runtime_resume
Annotated Snippet
struct va_macro {
struct device *dev;
unsigned long active_ch_mask[VA_MACRO_MAX_DAIS];
unsigned long active_ch_cnt[VA_MACRO_MAX_DAIS];
u16 dmic_clk_div;
bool has_swr_master;
bool has_npl_clk;
int dec_mode[VA_MACRO_NUM_DECIMATORS];
struct regmap *regmap;
struct clk *mclk;
struct clk *npl;
struct clk *macro;
struct clk *dcodec;
struct clk *fsgen;
struct clk_hw hw;
struct lpass_macro *pds;
s32 dmic_0_1_clk_cnt;
s32 dmic_2_3_clk_cnt;
s32 dmic_4_5_clk_cnt;
s32 dmic_6_7_clk_cnt;
u8 dmic_0_1_clk_div;
u8 dmic_2_3_clk_div;
u8 dmic_4_5_clk_div;
u8 dmic_6_7_clk_div;
};
#define to_va_macro(_hw) container_of(_hw, struct va_macro, hw)
struct va_macro_data {
bool has_swr_master;
bool has_npl_clk;
int version;
};
static const struct va_macro_data sm8250_va_data = {
.has_swr_master = false,
.has_npl_clk = false,
.version = LPASS_CODEC_VERSION_1_0,
};
static const struct va_macro_data sm8450_va_data = {
.has_swr_master = true,
.has_npl_clk = true,
};
static const struct va_macro_data sm8550_va_data = {
.has_swr_master = true,
.has_npl_clk = false,
};
static bool va_is_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case CDC_VA_TOP_CSR_CORE_ID_0:
case CDC_VA_TOP_CSR_CORE_ID_1:
case CDC_VA_TOP_CSR_CORE_ID_2:
case CDC_VA_TOP_CSR_CORE_ID_3:
case CDC_VA_TOP_CSR_DMIC0_CTL:
case CDC_VA_TOP_CSR_DMIC1_CTL:
case CDC_VA_TOP_CSR_DMIC2_CTL:
case CDC_VA_TOP_CSR_DMIC3_CTL:
return true;
}
return false;
}
static const struct reg_default va_defaults[] = {
/* VA macro */
{ CDC_VA_CLK_RST_CTRL_MCLK_CONTROL, 0x00},
{ CDC_VA_CLK_RST_CTRL_FS_CNT_CONTROL, 0x00},
{ CDC_VA_CLK_RST_CTRL_SWR_CONTROL, 0x00},
{ CDC_VA_TOP_CSR_TOP_CFG0, 0x00},
{ CDC_VA_TOP_CSR_DMIC0_CTL, 0x00},
{ CDC_VA_TOP_CSR_DMIC1_CTL, 0x00},
{ CDC_VA_TOP_CSR_DMIC2_CTL, 0x00},
{ CDC_VA_TOP_CSR_DMIC3_CTL, 0x00},
{ CDC_VA_TOP_CSR_DMIC_CFG, 0x80},
{ CDC_VA_TOP_CSR_DEBUG_BUS, 0x00},
{ CDC_VA_TOP_CSR_DEBUG_EN, 0x00},
{ CDC_VA_TOP_CSR_TX_I2S_CTL, 0x0C},
{ CDC_VA_TOP_CSR_I2S_CLK, 0x00},
{ CDC_VA_TOP_CSR_I2S_RESET, 0x00},
{ CDC_VA_TOP_CSR_CORE_ID_0, 0x00},
{ CDC_VA_TOP_CSR_CORE_ID_1, 0x00},
{ CDC_VA_TOP_CSR_CORE_ID_2, 0x00},
{ CDC_VA_TOP_CSR_CORE_ID_3, 0x00},
{ CDC_VA_TOP_CSR_SWR_MIC_CTL0, 0xEE},
{ CDC_VA_TOP_CSR_SWR_MIC_CTL1, 0xEE},
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/init.h`, `linux/io.h`, `linux/module.h`, `linux/of_clk.h`, `linux/of_platform.h`.
- Detected declarations: `struct va_macro`, `struct va_macro_data`, `function va_is_volatile_register`, `function va_is_rw_register`, `function va_is_readable_register`, `function va_clk_rsc_fs_gen_request`, `function va_macro_mclk_enable`, `function va_macro_mclk_event`, `function va_macro_put_dec_enum`, `function va_macro_tx_mixer_get`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.