sound/soc/codecs/tlv320aic32x4.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/tlv320aic32x4.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/tlv320aic32x4.c- Extension
.c- Size
- 44919 bytes
- Lines
- 1440
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/cdev.hlinux/clk.hlinux/delay.hlinux/gpio/consumer.hlinux/init.hlinux/module.hlinux/moduleparam.hlinux/of_clk.hlinux/pm.hlinux/regulator/consumer.hlinux/slab.hsound/core.hsound/initval.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dapm.hsound/tlv.hsound/tlv320aic32x4.htlv320aic32x4.h
Detected Declarations
struct aic32x4_privfunction aic32x4_reset_adcfunction mic_bias_eventfunction aic32x4_get_mfp1_gpiofunction aic32x4_set_mfp2_gpiofunction aic32x4_get_mfp3_gpiofunction aic32x4_set_mfp4_gpiofunction aic32x4_get_mfp5_gpiofunction aic32x4_set_mfp5_gpiofunction aic32x4_set_dai_sysclkfunction aic32x4_set_dai_fmtfunction aic32x4_set_aosrfunction aic32x4_set_dosrfunction aic32x4_set_processing_blocksfunction aic32x4_setup_clocksfunction aic32x4_hw_paramsfunction aic32x4_mutefunction aic32x4_set_bias_levelfunction aic32x4_setup_gpiosfunction aic32x4_component_probefunction aic32x4_of_xlate_dai_idfunction aic32x4_tas2505_component_probefunction aic32x4_parse_dtfunction aic32x4_disable_regulatorsfunction aic32x4_setup_regulatorsfunction aic32x4_probefunction aic32x4_removeexport aic32x4_regmap_configexport aic32x4_probeexport aic32x4_remove
Annotated Snippet
struct aic32x4_priv {
struct regmap *regmap;
u32 power_cfg;
u32 micpga_routing;
bool swapdacs;
struct gpio_desc *rstn_gpio;
const char *mclk_name;
struct regulator *supply_ldo;
struct regulator *supply_iov;
struct regulator *supply_dv;
struct regulator *supply_av;
struct aic32x4_setup_data *setup;
struct device *dev;
enum aic32x4_type type;
unsigned int fmt;
};
static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
u32 adc_reg;
/*
* Workaround: the datasheet does not mention a required programming
* sequence but experiments show the ADC needs to be reset after each
* capture to avoid audible artifacts.
*/
switch (event) {
case SND_SOC_DAPM_POST_PMD:
adc_reg = snd_soc_component_read(component, AIC32X4_ADCSETUP);
snd_soc_component_write(component, AIC32X4_ADCSETUP, adc_reg |
AIC32X4_LADC_EN | AIC32X4_RADC_EN);
snd_soc_component_write(component, AIC32X4_ADCSETUP, adc_reg);
break;
}
return 0;
};
static int mic_bias_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
switch (event) {
case SND_SOC_DAPM_POST_PMU:
/* Change Mic Bias Registor */
snd_soc_component_update_bits(component, AIC32X4_MICBIAS,
AIC32x4_MICBIAS_MASK,
AIC32X4_MICBIAS_LDOIN |
AIC32X4_MICBIAS_2075V);
printk(KERN_DEBUG "%s: Mic Bias will be turned ON\n", __func__);
break;
case SND_SOC_DAPM_PRE_PMD:
snd_soc_component_update_bits(component, AIC32X4_MICBIAS,
AIC32x4_MICBIAS_MASK, 0);
printk(KERN_DEBUG "%s: Mic Bias will be turned OFF\n",
__func__);
break;
}
return 0;
}
static int aic32x4_get_mfp1_gpio(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
u8 val;
val = snd_soc_component_read(component, AIC32X4_DINCTL);
ucontrol->value.integer.value[0] = (val & 0x01);
return 0;
};
static int aic32x4_set_mfp2_gpio(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
u8 val;
u8 gpio_check;
val = snd_soc_component_read(component, AIC32X4_DOUTCTL);
gpio_check = (val & AIC32X4_MFP_GPIO_ENABLED);
Annotation
- Immediate include surface: `linux/cdev.h`, `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/init.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/of_clk.h`.
- Detected declarations: `struct aic32x4_priv`, `function aic32x4_reset_adc`, `function mic_bias_event`, `function aic32x4_get_mfp1_gpio`, `function aic32x4_set_mfp2_gpio`, `function aic32x4_get_mfp3_gpio`, `function aic32x4_set_mfp4_gpio`, `function aic32x4_get_mfp5_gpio`, `function aic32x4_set_mfp5_gpio`, `function aic32x4_set_dai_sysclk`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration 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.