sound/soc/codecs/es8311.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/es8311.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/es8311.c- Extension
.c- Size
- 28068 bytes
- Lines
- 985
- 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/array_size.hsound/pcm.hlinux/clk.hlinux/i2c.hlinux/module.hlinux/regmap.hsound/core.hsound/pcm_params.hsound/soc.hsound/tlv.hes8311.h
Detected Declarations
struct es8311_privstruct es8311_mclk_coefffunction es8311_cmp_adj_mclk_coefffunction es8311_get_mclk_coefffunction es8311_set_sysclk_constraintsfunction es8311_mutefunction es8311_startupfunction es8311_hw_paramsfunction es8311_set_sysclkfunction es8311_set_dai_fmtfunction es8311_set_bias_levelfunction es8311_resetfunction es8311_suspendfunction es8311_resumefunction es8311_component_probefunction es8311_i2c_probe
Annotated Snippet
struct es8311_priv {
struct regmap *regmap;
struct clk *mclk;
unsigned long mclk_freq;
bool provider;
unsigned int rates[ES8311_NUM_RATES];
struct snd_pcm_hw_constraint_list constraints;
};
static const DECLARE_TLV_DB_SCALE(es8311_adc_vol_tlv, -9550, 50, 0);
static const DECLARE_TLV_DB_SCALE(es8311_pga_gain_tlv, 0, 300, 0);
static const DECLARE_TLV_DB_SCALE(es8311_adc_scale_tlv, 0, 600, 0);
#define ES8311_DB_LRCK_STEPS \
"0.25db/4LRCK", \
"0.25db/8LRCK", \
"0.25db/16LRCK", \
"0.25db/32LRCK", \
"0.25db/64LRCK", \
"0.25db/128LRCK", \
"0.25db/256LRCK", \
"0.25db/512LRCK", \
"0.25db/1024LRCK", \
"0.25db/2048LRCK", \
"0.25db/4096LRCK", \
"0.25db/8192LRCK", \
"0.25db/16384LRCK", \
"0.25db/32768LRCK", \
"0.25db/65536LRCK",
static const char *const es8311_level_winsize_txt[] = {
"0.25db/2LRCK",
ES8311_DB_LRCK_STEPS
};
static SOC_ENUM_SINGLE_DECL(
es8311_alc_winsize, ES8311_ADC4,
ES8311_ADC4_ALC_WINSIZE_SHIFT, es8311_level_winsize_txt);
static const DECLARE_TLV_DB_RANGE(es8311_level_tlv,
0, 1, TLV_DB_SCALE_ITEM(-3010, 600, 0),
2, 3, TLV_DB_SCALE_ITEM(-2060, 250, 0),
4, 5, TLV_DB_SCALE_ITEM(-1610, 160, 0),
6, 7, TLV_DB_SCALE_ITEM(-1320, 120, 0),
8, 9, TLV_DB_SCALE_ITEM(-1100, 90, 0),
10, 11, TLV_DB_SCALE_ITEM(-930, 80, 0),
12, 15, TLV_DB_SCALE_ITEM(-780, 60, 0),
);
static const char *const es8311_ramprate_txt[] = {
"Disabled",
ES8311_DB_LRCK_STEPS
};
static SOC_ENUM_SINGLE_DECL(
es8311_adc_ramprate, ES8311_ADC1,
ES8311_ADC1_RAMPRATE_SHIFT, es8311_ramprate_txt);
static const char *const es8311_automute_winsize_txt[] = {
"2048 samples",
"4096 samples",
"6144 samples",
"8192 samples",
"10240 samples",
"12288 samples",
"14336 samples",
"16384 samples",
"18432 samples",
"20480 samples",
"22528 samples",
"24576 samples",
"26624 samples",
"28672 samples",
"30720 samples",
"32768 samples",
};
static SOC_ENUM_SINGLE_DECL(
es8311_automute_winsize, ES8311_ADC6,
ES8311_ADC6_AUTOMUTE_WS_SHIFT, es8311_automute_winsize_txt);
static const DECLARE_TLV_DB_RANGE(es8311_automute_ng_tlv,
0, 7, TLV_DB_SCALE_ITEM(-9600, 600, 0),
8, 15, TLV_DB_SCALE_ITEM(-5100, 300, 0),
);
static const DECLARE_TLV_DB_SCALE(es8311_automute_vol_tlv, -2800, 400, 0);
static const DECLARE_TLV_DB_SCALE(es8311_dac_vol_tlv, -9550, 50, 0);
static SOC_ENUM_SINGLE_DECL(
es8311_drc_winsize, ES8311_DAC4,
ES8311_DAC4_DRC_WINSIZE_SHIFT, es8311_level_winsize_txt);
static SOC_ENUM_SINGLE_DECL(
es8311_dac_ramprate, ES8311_DAC6,
ES8311_DAC6_RAMPRATE_SHIFT, es8311_ramprate_txt);
Annotation
- Immediate include surface: `linux/array_size.h`, `sound/pcm.h`, `linux/clk.h`, `linux/i2c.h`, `linux/module.h`, `linux/regmap.h`, `sound/core.h`, `sound/pcm_params.h`.
- Detected declarations: `struct es8311_priv`, `struct es8311_mclk_coeff`, `function es8311_cmp_adj_mclk_coeff`, `function es8311_get_mclk_coeff`, `function es8311_set_sysclk_constraints`, `function es8311_mute`, `function es8311_startup`, `function es8311_hw_params`, `function es8311_set_sysclk`, `function es8311_set_dai_fmt`.
- 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.