sound/soc/codecs/ak4619.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/ak4619.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/ak4619.c- Extension
.c- Size
- 23862 bytes
- Lines
- 909
- 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/clk.hlinux/gpio/consumer.hlinux/i2c.hlinux/slab.hlinux/of_device.hlinux/module.hlinux/regmap.hsound/soc.hsound/pcm.hsound/pcm_params.hsound/tlv.h
Detected Declarations
struct ak4619_privfunction ak4619_set_deemphfunction ak4619_put_deemphfunction ak4619_get_deemphfunction ak4619_set_bias_levelfunction ak4619_dai_hw_paramsfunction ak4619_dai_set_fmtfunction ak4619_dai_set_sysclkfunction ak4619_dai_mutefunction ak4619_hw_constraintsfunction ak4619_dai_startupfunction ak4619_i2c_probe
Annotated Snippet
struct ak4619_priv {
struct regmap *regmap;
struct snd_pcm_hw_constraint_list constraint;
int deemph_en;
unsigned int playback_rate;
unsigned int sysclk;
};
/*
* DAC Volume
*
* max : 0x00 : +12.0 dB
* ( 0.5 dB step )
* min : 0xFE : -115.0 dB
* mute: 0xFF
*/
static const DECLARE_TLV_DB_SCALE(dac_tlv, -11550, 50, 1);
/*
* MIC Volume
*
* max : 0x0B : +27.0 dB
* ( 3 dB step )
* min: 0x00 : -6.0 dB
*/
static const DECLARE_TLV_DB_SCALE(mic_tlv, -600, 300, 0);
/*
* ADC Volume
*
* max : 0x00 : +24.0 dB
* ( 0.5 dB step )
* min : 0xFE : -103.0 dB
* mute: 0xFF
*/
static const DECLARE_TLV_DB_SCALE(adc_tlv, -10350, 50, 1);
/* ADC & DAC Volume Level Transition Time select */
static const char * const ak4619_vol_trans_txt[] = {
"4/fs", "16/fs"
};
static SOC_ENUM_SINGLE_DECL(ak4619_adc_vol_trans, ADC_MHPF, ATSPAD_SHIFT, ak4619_vol_trans_txt);
static SOC_ENUM_SINGLE_DECL(ak4619_dac_vol_trans, DAC_MF, ATSPDA_SHIFT, ak4619_vol_trans_txt);
/* ADC Digital Filter select */
static const char * const ak4619_adc_digi_fil_txt[] = {
"Sharp Roll-Off Filter",
"Slow Roll-Off Filter",
"Short Delay Sharp Roll-Off Filter",
"Short Delay Slow Roll-Off Filter",
"Voice Filter"
};
static SOC_ENUM_SINGLE_DECL(ak4619_adc_1_digi_fil, ADC_DF, AD1SL_SHIFT, ak4619_adc_digi_fil_txt);
static SOC_ENUM_SINGLE_DECL(ak4619_adc_2_digi_fil, ADC_DF, AD2SL_SHIFT, ak4619_adc_digi_fil_txt);
/* DAC De-Emphasis Filter select */
static const char * const ak4619_dac_de_emp_txt[] = {
"44.1kHz", "OFF", "48kHz", "32kHz"
};
static SOC_ENUM_SINGLE_DECL(ak4619_dac_1_de_emp, DAC_DEMP, DEM1_SHIFT, ak4619_dac_de_emp_txt);
static SOC_ENUM_SINGLE_DECL(ak4619_dac_2_de_emp, DAC_DEMP, DEM2_SHIFT, ak4619_dac_de_emp_txt);
/* DAC Digital Filter select */
static const char * const ak4619_dac_digi_fil_txt[] = {
"Sharp Roll-Off Filter",
"Slow Roll-Off Filter",
"Short Delay Sharp Roll-Off Filter",
"Short Delay Slow Roll-Off Filter"
};
static SOC_ENUM_SINGLE_DECL(ak4619_dac_1_digi_fil, DAC_MF, DA1SL_SHIFT, ak4619_dac_digi_fil_txt);
static SOC_ENUM_SINGLE_DECL(ak4619_dac_2_digi_fil, DAC_MF, DA2SL_SHIFT, ak4619_dac_digi_fil_txt);
/*
* Control functions
*/
static void ak4619_set_deemph(struct snd_soc_component *component)
{
struct ak4619_priv *ak4619 = snd_soc_component_get_drvdata(component);
u8 dem = 0;
if (!ak4619->deemph_en)
return;
switch (ak4619->playback_rate) {
case 32000:
Annotation
- Immediate include surface: `linux/clk.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/slab.h`, `linux/of_device.h`, `linux/module.h`, `linux/regmap.h`, `sound/soc.h`.
- Detected declarations: `struct ak4619_priv`, `function ak4619_set_deemph`, `function ak4619_put_deemph`, `function ak4619_get_deemph`, `function ak4619_set_bias_level`, `function ak4619_dai_hw_params`, `function ak4619_dai_set_fmt`, `function ak4619_dai_set_sysclk`, `function ak4619_dai_mute`, `function ak4619_hw_constraints`.
- 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.