sound/soc/codecs/es8323.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/es8323.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/es8323.c- Extension
.c- Size
- 25956 bytes
- Lines
- 822
- 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/module.hlinux/acpi.hlinux/clk.hlinux/delay.hlinux/i2c.hlinux/mod_devicetable.hlinux/regmap.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dapm.hsound/tlv.hes8323.h
Detected Declarations
struct es8323_privstruct coeff_divfunction get_coefffunction es8323_set_dai_sysclkfunction es8323_set_dai_fmtfunction es8323_pcm_startupfunction es8323_pcm_hw_paramsfunction es8323_mute_streamfunction es8323_probefunction es8323_set_bias_levelfunction es8323_removefunction es8323_suspendfunction es8323_resumefunction es8323_i2c_probe
Annotated Snippet
struct es8323_priv {
unsigned int sysclk;
struct clk *mclk;
struct regmap *regmap;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
};
/* es8323 register cache */
static const struct reg_default es8323_reg_defaults[] = {
{ ES8323_CONTROL1, 0x06 },
{ ES8323_CONTROL2, 0x1c },
{ ES8323_CHIPPOWER, 0xc3 },
{ ES8323_ADCPOWER, 0xfc },
{ ES8323_DACPOWER, 0xc0 },
{ ES8323_CHIPLOPOW1, 0x00 },
{ ES8323_CHIPLOPOW2, 0x00 },
{ ES8323_ANAVOLMANAG, 0x7c },
{ ES8323_MASTERMODE, 0x80 },
{ ES8323_ADCCONTROL1, 0x00 },
{ ES8323_ADCCONTROL2, 0x00 },
{ ES8323_ADCCONTROL3, 0x06 },
{ ES8323_ADCCONTROL4, 0x00 },
{ ES8323_ADCCONTROL5, 0x06 },
{ ES8323_ADCCONTROL6, 0x30 },
{ ES8323_ADCCONTROL7, 0x30 },
{ ES8323_LADC_VOL, 0xc0 },
{ ES8323_RADC_VOL, 0xc0 },
{ ES8323_ADCCONTROL10, 0x38 },
{ ES8323_ADCCONTROL11, 0xb0 },
{ ES8323_ADCCONTROL12, 0x32 },
{ ES8323_ADCCONTROL13, 0x06 },
{ ES8323_ADCCONTROL14, 0x00 },
{ ES8323_DACCONTROL1, 0x00 },
{ ES8323_DACCONTROL2, 0x06 },
{ ES8323_DACCONTROL3, 0x30 },
{ ES8323_LDAC_VOL, 0xc0 },
{ ES8323_RDAC_VOL, 0xc0 },
{ ES8323_DACCONTROL6, 0x08 },
{ ES8323_DACCONTROL7, 0x06 },
{ ES8323_DACCONTROL8, 0x1f },
{ ES8323_DACCONTROL9, 0xf7 },
{ ES8323_DACCONTROL10, 0xfd },
{ ES8323_DACCONTROL11, 0xff },
{ ES8323_DACCONTROL12, 0x1f },
{ ES8323_DACCONTROL13, 0xf7 },
{ ES8323_DACCONTROL14, 0xfd },
{ ES8323_DACCONTROL15, 0xff },
{ ES8323_DACCONTROL16, 0x00 },
{ ES8323_DACCONTROL17, 0x38 },
{ ES8323_DACCONTROL18, 0x38 },
{ ES8323_DACCONTROL19, 0x38 },
{ ES8323_DACCONTROL20, 0x38 },
{ ES8323_DACCONTROL21, 0x38 },
{ ES8323_DACCONTROL22, 0x38 },
{ ES8323_DACCONTROL23, 0x00 },
{ ES8323_LOUT1_VOL, 0x00 },
{ ES8323_ROUT1_VOL, 0x00 },
};
static const char *const es8323_stereo_3d_texts[] = { "No 3D ", "Level 1", "Level 2", "Level 3",
"Level 4", "Level 5", "Level 6", "Level 7" };
static SOC_ENUM_SINGLE_DECL(es8323_stereo_3d_enum, ES8323_DACCONTROL7, 2, es8323_stereo_3d_texts);
static const char *const es8323_alc_func_texts[] = { "Off", "Right", "Left", "Stereo" };
static SOC_ENUM_SINGLE_DECL(es8323_alc_function_enum,
ES8323_ADCCONTROL10, 6, es8323_alc_func_texts);
static const char *const es8323_ng_type_texts[] = { "Constant PGA Gain", "Mute ADC Output" };
static SOC_ENUM_SINGLE_DECL(es8323_alc_ng_type_enum, ES8323_ADCCONTROL14, 1, es8323_ng_type_texts);
static const char *const es8323_deemph_texts[] = { "None", "32Khz", "44.1Khz", "48Khz" };
static SOC_ENUM_SINGLE_DECL(es8323_playback_deemphasis_enum,
ES8323_DACCONTROL6, 6, es8323_deemph_texts);
static const char *const es8323_adcpol_texts[] = { "Normal", "L Invert",
"R Invert", "L + R Invert" };
static SOC_ENUM_SINGLE_DECL(es8323_capture_polarity_enum,
ES8323_ADCCONTROL6, 6, es8323_adcpol_texts);
static const DECLARE_TLV_DB_SCALE(es8323_adc_tlv, -9600, 50, 1);
static const DECLARE_TLV_DB_SCALE(es8323_dac_tlv, -9600, 50, 1);
static const DECLARE_TLV_DB_SCALE(es8323_out_tlv, -4500, 150, 0);
static const DECLARE_TLV_DB_SCALE(es8323_bypass_tlv, 0, 300, 0);
static const DECLARE_TLV_DB_SCALE(es8323_bypass_tlv2, -15, 300, 0);
static const struct snd_kcontrol_new es8323_snd_controls[] = {
SOC_ENUM("3D Mode", es8323_stereo_3d_enum),
SOC_ENUM("ALC Capture Function", es8323_alc_function_enum),
SOC_ENUM("ALC Capture NG Type", es8323_alc_ng_type_enum),
SOC_ENUM("Playback De-emphasis", es8323_playback_deemphasis_enum),
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/module.h`, `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`, `linux/i2c.h`, `linux/mod_devicetable.h`, `linux/regmap.h`.
- Detected declarations: `struct es8323_priv`, `struct coeff_div`, `function get_coeff`, `function es8323_set_dai_sysclk`, `function es8323_set_dai_fmt`, `function es8323_pcm_startup`, `function es8323_pcm_hw_params`, `function es8323_mute_stream`, `function es8323_probe`, `function es8323_set_bias_level`.
- 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.