sound/soc/codecs/rt5616.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt5616.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt5616.c- Extension
.c- Size
- 41599 bytes
- Lines
- 1411
- 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/module.hlinux/moduleparam.hlinux/init.hlinux/clk.hlinux/delay.hlinux/pm.hlinux/i2c.hlinux/platform_device.hlinux/spi/spi.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hrl6231.hrt5616.h
Detected Declarations
struct rt5616_privfunction rt5616_volatile_registerfunction rt5616_readable_registerfunction is_sys_clk_from_pllfunction rt5616_adc_eventfunction rt5616_charge_pump_eventfunction rt5616_hp_eventfunction rt5616_lout_eventfunction rt5616_bst1_eventfunction rt5616_bst2_eventfunction rt5616_hw_paramsfunction rt5616_set_dai_fmtfunction rt5616_set_dai_sysclkfunction rt5616_set_dai_pllfunction rt5616_set_bias_levelfunction rt5616_probefunction rt5616_suspendfunction rt5616_resumefunction rt5616_i2c_probefunction rt5616_i2c_shutdown
Annotated Snippet
struct rt5616_priv {
struct snd_soc_component *component;
struct delayed_work patch_work;
struct regmap *regmap;
struct clk *mclk;
int sysclk;
int sysclk_src;
int lrck[RT5616_AIFS];
int bclk[RT5616_AIFS];
int master[RT5616_AIFS];
int pll_src;
int pll_in;
int pll_out;
};
static bool rt5616_volatile_register(struct device *dev, unsigned int reg)
{
int i;
for (i = 0; i < ARRAY_SIZE(rt5616_ranges); i++) {
if (reg >= rt5616_ranges[i].range_min &&
reg <= rt5616_ranges[i].range_max)
return true;
}
switch (reg) {
case RT5616_RESET:
case RT5616_PRIV_DATA:
case RT5616_EQ_CTRL1:
case RT5616_DRC_AGC_1:
case RT5616_IRQ_CTRL2:
case RT5616_INT_IRQ_ST:
case RT5616_PGM_REG_ARR1:
case RT5616_PGM_REG_ARR3:
case RT5616_VENDOR_ID:
case RT5616_DEVICE_ID:
return true;
default:
return false;
}
}
static bool rt5616_readable_register(struct device *dev, unsigned int reg)
{
int i;
for (i = 0; i < ARRAY_SIZE(rt5616_ranges); i++) {
if (reg >= rt5616_ranges[i].range_min &&
reg <= rt5616_ranges[i].range_max)
return true;
}
switch (reg) {
case RT5616_RESET:
case RT5616_VERSION_ID:
case RT5616_VENDOR_ID:
case RT5616_DEVICE_ID:
case RT5616_HP_VOL:
case RT5616_LOUT_CTRL1:
case RT5616_LOUT_CTRL2:
case RT5616_IN1_IN2:
case RT5616_INL1_INR1_VOL:
case RT5616_DAC1_DIG_VOL:
case RT5616_ADC_DIG_VOL:
case RT5616_ADC_BST_VOL:
case RT5616_STO1_ADC_MIXER:
case RT5616_AD_DA_MIXER:
case RT5616_STO_DAC_MIXER:
case RT5616_REC_L1_MIXER:
case RT5616_REC_L2_MIXER:
case RT5616_REC_R1_MIXER:
case RT5616_REC_R2_MIXER:
case RT5616_HPO_MIXER:
case RT5616_OUT_L1_MIXER:
case RT5616_OUT_L2_MIXER:
case RT5616_OUT_L3_MIXER:
case RT5616_OUT_R1_MIXER:
case RT5616_OUT_R2_MIXER:
case RT5616_OUT_R3_MIXER:
case RT5616_LOUT_MIXER:
case RT5616_PWR_DIG1:
case RT5616_PWR_DIG2:
case RT5616_PWR_ANLG1:
case RT5616_PWR_ANLG2:
case RT5616_PWR_MIXER:
case RT5616_PWR_VOL:
case RT5616_PRIV_INDEX:
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/clk.h`, `linux/delay.h`, `linux/pm.h`, `linux/i2c.h`, `linux/platform_device.h`.
- Detected declarations: `struct rt5616_priv`, `function rt5616_volatile_register`, `function rt5616_readable_register`, `function is_sys_clk_from_pll`, `function rt5616_adc_event`, `function rt5616_charge_pump_event`, `function rt5616_hp_event`, `function rt5616_lout_event`, `function rt5616_bst1_event`, `function rt5616_bst2_event`.
- 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.