sound/soc/codecs/nau8810.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/nau8810.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/nau8810.c- Extension
.c- Size
- 28603 bytes
- Lines
- 930
- 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/kernel.hlinux/init.hlinux/delay.hlinux/pm.hlinux/i2c.hlinux/regmap.hlinux/slab.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/initval.hsound/tlv.hnau8810.h
Detected Declarations
function nau8810_readable_regfunction nau8810_writeable_regfunction nau8810_volatile_regfunction nau8810_eq_getfunction nau8810_eq_putfunction check_mclk_select_pllfunction check_mic_enabledfunction nau8810_set_sysclkfunction nau8810_calc_pllfunction nau8810_set_pllfunction nau8810_set_dai_fmtfunction nau8810_mclk_clkdivfunction nau8810_pcm_hw_paramsfunction nau8810_set_bias_levelfunction nau8810_i2c_probe
Annotated Snippet
if (ret) {
dev_err(component->dev, "EQ configuration fail, register: %x ret: %d\n",
reg + i, ret);
kfree(data);
return ret;
}
}
kfree(data);
return 0;
}
static const char * const nau8810_companding[] = {
"Off", "NC", "u-law", "A-law" };
static const struct soc_enum nau8810_companding_adc_enum =
SOC_ENUM_SINGLE(NAU8810_REG_COMP, NAU8810_ADCCM_SFT,
ARRAY_SIZE(nau8810_companding), nau8810_companding);
static const struct soc_enum nau8810_companding_dac_enum =
SOC_ENUM_SINGLE(NAU8810_REG_COMP, NAU8810_DACCM_SFT,
ARRAY_SIZE(nau8810_companding), nau8810_companding);
static const char * const nau8810_deemp[] = {
"None", "32kHz", "44.1kHz", "48kHz" };
static const struct soc_enum nau8810_deemp_enum =
SOC_ENUM_SINGLE(NAU8810_REG_DAC, NAU8810_DEEMP_SFT,
ARRAY_SIZE(nau8810_deemp), nau8810_deemp);
static const char * const nau8810_eqmode[] = {"Capture", "Playback" };
static const struct soc_enum nau8810_eqmode_enum =
SOC_ENUM_SINGLE(NAU8810_REG_EQ1, NAU8810_EQM_SFT,
ARRAY_SIZE(nau8810_eqmode), nau8810_eqmode);
static const char * const nau8810_alc[] = {"Normal", "Limiter" };
static const struct soc_enum nau8810_alc_enum =
SOC_ENUM_SINGLE(NAU8810_REG_ALC3, NAU8810_ALCM_SFT,
ARRAY_SIZE(nau8810_alc), nau8810_alc);
static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1200, 75, 0);
static const DECLARE_TLV_DB_SCALE(spk_tlv, -5700, 100, 0);
static const struct snd_kcontrol_new nau8810_snd_controls[] = {
SOC_ENUM("ADC Companding", nau8810_companding_adc_enum),
SOC_ENUM("DAC Companding", nau8810_companding_dac_enum),
SOC_ENUM("DAC De-emphasis", nau8810_deemp_enum),
SOC_ENUM("EQ Function", nau8810_eqmode_enum),
SND_SOC_BYTES_EXT("EQ Parameters", 10,
nau8810_eq_get, nau8810_eq_put),
SOC_SINGLE("DAC Inversion Switch", NAU8810_REG_DAC,
NAU8810_DACPL_SFT, 1, 0),
SOC_SINGLE_TLV("Playback Volume", NAU8810_REG_DACGAIN,
NAU8810_DACGAIN_SFT, 0xff, 0, digital_tlv),
SOC_SINGLE("High Pass Filter Switch", NAU8810_REG_ADC,
NAU8810_HPFEN_SFT, 1, 0),
SOC_SINGLE("High Pass Cut Off", NAU8810_REG_ADC,
NAU8810_HPF_SFT, 0x7, 0),
SOC_SINGLE("ADC Inversion Switch", NAU8810_REG_ADC,
NAU8810_ADCPL_SFT, 1, 0),
SOC_SINGLE_TLV("Capture Volume", NAU8810_REG_ADCGAIN,
NAU8810_ADCGAIN_SFT, 0xff, 0, digital_tlv),
SOC_SINGLE_TLV("EQ1 Volume", NAU8810_REG_EQ1,
NAU8810_EQ1GC_SFT, 0x18, 1, eq_tlv),
SOC_SINGLE_TLV("EQ2 Volume", NAU8810_REG_EQ2,
NAU8810_EQ2GC_SFT, 0x18, 1, eq_tlv),
SOC_SINGLE_TLV("EQ3 Volume", NAU8810_REG_EQ3,
NAU8810_EQ3GC_SFT, 0x18, 1, eq_tlv),
SOC_SINGLE_TLV("EQ4 Volume", NAU8810_REG_EQ4,
NAU8810_EQ4GC_SFT, 0x18, 1, eq_tlv),
SOC_SINGLE_TLV("EQ5 Volume", NAU8810_REG_EQ5,
NAU8810_EQ5GC_SFT, 0x18, 1, eq_tlv),
SOC_SINGLE("DAC Limiter Switch", NAU8810_REG_DACLIM1,
NAU8810_DACLIMEN_SFT, 1, 0),
SOC_SINGLE("DAC Limiter Decay", NAU8810_REG_DACLIM1,
NAU8810_DACLIMDCY_SFT, 0xf, 0),
SOC_SINGLE("DAC Limiter Attack", NAU8810_REG_DACLIM1,
NAU8810_DACLIMATK_SFT, 0xf, 0),
SOC_SINGLE("DAC Limiter Threshold", NAU8810_REG_DACLIM2,
NAU8810_DACLIMTHL_SFT, 0x7, 0),
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/i2c.h`, `linux/regmap.h`.
- Detected declarations: `function nau8810_readable_reg`, `function nau8810_writeable_reg`, `function nau8810_volatile_reg`, `function nau8810_eq_get`, `function nau8810_eq_put`, `function check_mclk_select_pll`, `function check_mic_enabled`, `function nau8810_set_sysclk`, `function nau8810_calc_pll`, `function nau8810_set_pll`.
- 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.