sound/soc/codecs/ml26124.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/ml26124.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/ml26124.c- Extension
.c- Size
- 17972 bytes
- Lines
- 594
- 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/delay.hlinux/pm.hlinux/i2c.hlinux/slab.hlinux/platform_device.hlinux/regmap.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/tlv.hml26124.h
Detected Declarations
struct ml26124_privstruct clk_coefffunction get_sratefunction get_coefffunction ml26124_hw_paramsfunction ml26124_mutefunction ml26124_set_dai_fmtfunction ml26124_set_dai_sysclkfunction ml26124_set_bias_levelfunction ml26124_probefunction ml26124_i2c_probe
Annotated Snippet
struct ml26124_priv {
u32 mclk;
u32 rate;
struct regmap *regmap;
int clk_in;
struct snd_pcm_substream *substream;
};
struct clk_coeff {
u32 mclk;
u32 rate;
u8 pllnl;
u8 pllnh;
u8 pllml;
u8 pllmh;
u8 plldiv;
};
/* ML26124 configuration */
static const DECLARE_TLV_DB_SCALE(digital_tlv, -7150, 50, 0);
static const DECLARE_TLV_DB_SCALE(alclvl, -2250, 150, 0);
static const DECLARE_TLV_DB_SCALE(mingain, -1200, 600, 0);
static const DECLARE_TLV_DB_SCALE(maxgain, -675, 600, 0);
static const DECLARE_TLV_DB_SCALE(boost_vol, -1200, 75, 0);
static const char * const ml26124_companding[] = {"16bit PCM", "u-law",
"A-law"};
static SOC_ENUM_SINGLE_DECL(ml26124_adc_companding_enum,
ML26124_SAI_TRANS_CTL, 6, ml26124_companding);
static SOC_ENUM_SINGLE_DECL(ml26124_dac_companding_enum,
ML26124_SAI_RCV_CTL, 6, ml26124_companding);
static const struct snd_kcontrol_new ml26124_snd_controls[] = {
SOC_SINGLE_TLV("Capture Digital Volume", ML26124_RECORD_DIG_VOL, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("Playback Digital Volume", ML26124_PLBAK_DIG_VOL, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("Digital Boost Volume", ML26124_DIGI_BOOST_VOL, 0,
0x3f, 0, boost_vol),
SOC_SINGLE_TLV("EQ Band0 Volume", ML26124_EQ_GAIN_BRAND0, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("EQ Band1 Volume", ML26124_EQ_GAIN_BRAND1, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("EQ Band2 Volume", ML26124_EQ_GAIN_BRAND2, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("EQ Band3 Volume", ML26124_EQ_GAIN_BRAND3, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("EQ Band4 Volume", ML26124_EQ_GAIN_BRAND4, 0,
0xff, 1, digital_tlv),
SOC_SINGLE_TLV("ALC Target Level", ML26124_ALC_TARGET_LEV, 0,
0xf, 1, alclvl),
SOC_SINGLE_TLV("ALC Min Input Volume", ML26124_ALC_MAXMIN_GAIN, 0,
7, 0, mingain),
SOC_SINGLE_TLV("ALC Max Input Volume", ML26124_ALC_MAXMIN_GAIN, 4,
7, 1, maxgain),
SOC_SINGLE_TLV("Playback Limiter Min Input Volume",
ML26124_PL_MAXMIN_GAIN, 0, 7, 0, mingain),
SOC_SINGLE_TLV("Playback Limiter Max Input Volume",
ML26124_PL_MAXMIN_GAIN, 4, 7, 1, maxgain),
SOC_SINGLE_TLV("Playback Boost Volume", ML26124_PLYBAK_BOST_VOL, 0,
0x3f, 0, boost_vol),
SOC_SINGLE("DC High Pass Filter Switch", ML26124_FILTER_EN, 0, 1, 0),
SOC_SINGLE("Noise High Pass Filter Switch", ML26124_FILTER_EN, 1, 1, 0),
SOC_SINGLE("ZC Switch", ML26124_PW_ZCCMP_PW_MNG, 1,
1, 0),
SOC_SINGLE("EQ Band0 Switch", ML26124_FILTER_EN, 2, 1, 0),
SOC_SINGLE("EQ Band1 Switch", ML26124_FILTER_EN, 3, 1, 0),
SOC_SINGLE("EQ Band2 Switch", ML26124_FILTER_EN, 4, 1, 0),
SOC_SINGLE("EQ Band3 Switch", ML26124_FILTER_EN, 5, 1, 0),
SOC_SINGLE("EQ Band4 Switch", ML26124_FILTER_EN, 6, 1, 0),
SOC_SINGLE("Play Limiter", ML26124_DVOL_CTL, 0, 1, 0),
SOC_SINGLE("Capture Limiter", ML26124_DVOL_CTL, 1, 1, 0),
SOC_SINGLE("Digital Volume Fade Switch", ML26124_DVOL_CTL, 3, 1, 0),
SOC_SINGLE("Digital Switch", ML26124_DVOL_CTL, 4, 1, 0),
SOC_ENUM("DAC Companding", ml26124_dac_companding_enum),
SOC_ENUM("ADC Companding", ml26124_adc_companding_enum),
};
static const struct snd_kcontrol_new ml26124_output_mixer_controls[] = {
SOC_DAPM_SINGLE("DAC Switch", ML26124_SPK_AMP_OUT, 1, 1, 0),
SOC_DAPM_SINGLE("Line in loopback Switch", ML26124_SPK_AMP_OUT, 3, 1,
0),
SOC_DAPM_SINGLE("PGA Switch", ML26124_SPK_AMP_OUT, 5, 1, 0),
};
/* Input mux */
static const char * const ml26124_input_select[] = {"Analog MIC SingleEnded in",
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/i2c.h`, `linux/slab.h`, `linux/platform_device.h`.
- Detected declarations: `struct ml26124_priv`, `struct clk_coeff`, `function get_srate`, `function get_coeff`, `function ml26124_hw_params`, `function ml26124_mute`, `function ml26124_set_dai_fmt`, `function ml26124_set_dai_sysclk`, `function ml26124_set_bias_level`, `function ml26124_probe`.
- 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.