sound/soc/codecs/cs48l32.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/cs48l32.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/cs48l32.c- Extension
.c- Size
- 123883 bytes
- Lines
- 4077
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
dt-bindings/sound/cs48l32.hlinux/array_size.hlinux/build_bug.hlinux/clk.hlinux/container_of.hlinux/delay.hlinux/err.hlinux/gcd.hlinux/gpio/consumer.hlinux/minmax.hlinux/module.hlinux/of.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hlinux/regulator/consumer.hlinux/slab.hlinux/spi/spi.hlinux/string_choices.hsound/cs48l32.hsound/cs48l32_registers.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-component.hsound/soc-dai.hsound/soc-dapm.hsound/tlv.hcs48l32.h
Detected Declarations
function cs48l32_spin_sysclkfunction cs48l32_rate_putfunction cs48l32_inmux_putfunction cs48l32_dmode_putfunction cs48l32_is_input_enabledfunction cs48l32_in_rate_putfunction cs48l32_low_power_mode_putfunction cs48l32_lhpf_coeff_putfunction cs48l32_eq_mode_getfunction cs48l32_eq_mode_putfunction cs48l32_eq_coeff_infofunction cs48l32_eq_coeff_getfunction cs48l32_eq_coeff_putfunction cs48l32_dsp_rate_getfunction cs48l32_dsp_rate_putfunction cs48l32_dsp_pre_runfunction cs48l32_dsp_memory_disablefunction cs48l32_dsp_memory_enablefunction cs48l32_dsp_freq_updatefunction cs48l32_dsp_freq_evfunction cs48l32_irqfunction cs48l32_get_dspclk_settingfunction cs48l32_get_sysclk_settingfunction cs48l32_set_pdm_fllclkfunction cs48l32_set_sysclkfunction cs48l32_is_enabled_fllfunction cs48l32_wait_for_fllfunction cs48l32_fllhj_disablefunction cs48l32_fllhj_applyfunction cs48l32_fllhj_enablefunction cs48l32_fllhj_validatefunction cs48l32_fllhj_set_refclkfunction cs48l32_init_fllfunction cs48l32_set_fllfunction cs48l32_asp_dai_probefunction cs48l32_set_fmtfunction cs48l32_startupfunction cs48l32_hw_params_ratefunction cs48l32_asp_cfg_changedfunction cs48l32_hw_paramsfunction cs48l32_dai_set_sysclkfunction cs48l32_set_channels_to_maskfunction cs48l32_set_tdm_slotfunction cs48l32_sysclk_evfunction cs48l32_in_evfunction cs48l32_in_put_volswfunction cs48l32_eq_filter_unstablefunction cs48l32_eq_ev
Annotated Snippet
if (ret < 0) {
dev_err(component->dev,
"Failed to set ADC1L_INT_ENA_FRC: %d\n", ret);
return ret;
}
ret = snd_soc_component_update_bits(component,
CS48L32_ADC1R_ANA_CONTROL1,
CS48L32_ADC1x_INT_ENA_FRC_MASK,
CS48L32_ADC1x_INT_ENA_FRC_MASK);
if (ret < 0) {
dev_err(component->dev,
"Failed to set ADC1R_INT_ENA_FRC: %d\n", ret);
return ret;
}
result = snd_soc_component_update_bits(component,
e->reg,
BIT(CS48L32_IN1_MODE_SHIFT),
0);
if (result < 0) {
dev_err(component->dev, "Failed to set input mode: %d\n", result);
return result;
}
usleep_range(200, 300);
ret = snd_soc_component_update_bits(component,
CS48L32_ADC1L_ANA_CONTROL1,
CS48L32_ADC1x_INT_ENA_FRC_MASK,
0);
if (ret < 0) {
dev_err(component->dev,
"Failed to clear ADC1L_INT_ENA_FRC: %d\n", ret);
return ret;
}
ret = snd_soc_component_update_bits(component,
CS48L32_ADC1R_ANA_CONTROL1,
CS48L32_ADC1x_INT_ENA_FRC_MASK,
0);
if (ret < 0) {
dev_err(component->dev,
"Failed to clear ADC1R_INT_ENA_FRC: %d\n", ret);
return ret;
}
if (result > 0)
snd_soc_dapm_mux_update_power(dapm, kcontrol, mode, e, NULL);
return result;
case 1:
return snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
default:
return -EINVAL;
}
}
static SOC_ENUM_SINGLE_DECL(cs48l32_in1dmode_enum,
CS48L32_INPUT1_CONTROL1,
CS48L32_IN1_MODE_SHIFT,
cs48l32_dmode_texts);
static const struct snd_kcontrol_new cs48l32_dmode_mux[] = {
SOC_DAPM_ENUM_EXT("IN1 Mode", cs48l32_in1dmode_enum,
snd_soc_dapm_get_enum_double, cs48l32_dmode_put),
};
static const char * const cs48l32_in_texts[] = {
"IN1L", "IN1R", "IN2L", "IN2R",
};
static_assert(ARRAY_SIZE(cs48l32_in_texts) == CS48L32_MAX_INPUT);
static const char * const cs48l32_us_freq_texts[] = {
"16-24kHz", "20-28kHz",
};
static const unsigned int cs48l32_us_freq_val[] = {
0x2, 0x3,
};
static const struct soc_enum cs48l32_us_freq[] = {
SOC_VALUE_ENUM_SINGLE(CS48L32_US1_CONTROL,
CS48L32_US1_FREQ_SHIFT,
CS48L32_US1_FREQ_MASK >> CS48L32_US1_FREQ_SHIFT,
ARRAY_SIZE(cs48l32_us_freq_val),
cs48l32_us_freq_texts,
cs48l32_us_freq_val),
SOC_VALUE_ENUM_SINGLE(CS48L32_US2_CONTROL,
CS48L32_US1_FREQ_SHIFT,
Annotation
- Immediate include surface: `dt-bindings/sound/cs48l32.h`, `linux/array_size.h`, `linux/build_bug.h`, `linux/clk.h`, `linux/container_of.h`, `linux/delay.h`, `linux/err.h`, `linux/gcd.h`.
- Detected declarations: `function cs48l32_spin_sysclk`, `function cs48l32_rate_put`, `function cs48l32_inmux_put`, `function cs48l32_dmode_put`, `function cs48l32_is_input_enabled`, `function cs48l32_in_rate_put`, `function cs48l32_low_power_mode_put`, `function cs48l32_lhpf_coeff_put`, `function cs48l32_eq_mode_get`, `function cs48l32_eq_mode_put`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.