sound/soc/codecs/wm8903.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/wm8903.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/wm8903.c- Extension
.c- Size
- 66640 bytes
- Lines
- 2226
- 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.
- 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
linux/module.hlinux/moduleparam.hlinux/init.hlinux/completion.hlinux/delay.hlinux/gpio/driver.hlinux/pm.hlinux/i2c.hlinux/regmap.hlinux/regulator/consumer.hlinux/slab.hlinux/irq.hlinux/mutex.hsound/core.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/tlv.hsound/soc.hsound/initval.hsound/wm8903.htrace/events/asoc.hwm8903.h
Detected Declarations
struct wm8903_privfunction wm8903_readable_registerfunction wm8903_volatile_registerfunction wm8903_cp_eventfunction wm8903_dcs_eventfunction wm8903_seq_notifierfunction wm8903_class_w_putfunction wm8903_set_deemphfunction wm8903_get_deemphfunction wm8903_put_deemphfunction wm8903_set_bias_levelfunction wm8903_set_dai_sysclkfunction wm8903_set_dai_fmtfunction wm8903_mutefunction wm8903_hw_paramsfunction snd_soc_jack_add_gpiosfunction wm8903_irqfunction wm8903_resumefunction wm8903_gpio_requestfunction wm8903_gpio_direction_infunction wm8903_gpio_getfunction wm8903_gpio_direction_outfunction wm8903_gpio_setfunction wm8903_init_gpiofunction wm8903_free_gpiofunction wm8903_init_gpiofunction wm8903_set_pdata_irq_triggerfunction wm8903_set_pdata_from_offunction wm8903_i2c_probefunction wm8903_i2c_removeexport wm8903_mic_detect
Annotated Snippet
struct wm8903_priv {
struct wm8903_platform_data *pdata;
struct device *dev;
struct regmap *regmap;
struct regulator_bulk_data supplies[WM8903_NUM_SUPPLIES];
int sysclk;
int irq;
struct mutex lock;
int fs;
int deemph;
int dcs_pending;
int dcs_cache[4];
/* Reference count */
int class_w_users;
struct snd_soc_jack *mic_jack;
int mic_det;
int mic_short;
int mic_last_report;
int mic_delay;
#ifdef CONFIG_GPIOLIB
struct gpio_chip gpio_chip;
#endif
};
static bool wm8903_readable_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case WM8903_SW_RESET_AND_ID:
case WM8903_REVISION_NUMBER:
case WM8903_BIAS_CONTROL_0:
case WM8903_VMID_CONTROL_0:
case WM8903_MIC_BIAS_CONTROL_0:
case WM8903_ANALOGUE_DAC_0:
case WM8903_ANALOGUE_ADC_0:
case WM8903_POWER_MANAGEMENT_0:
case WM8903_POWER_MANAGEMENT_1:
case WM8903_POWER_MANAGEMENT_2:
case WM8903_POWER_MANAGEMENT_3:
case WM8903_POWER_MANAGEMENT_4:
case WM8903_POWER_MANAGEMENT_5:
case WM8903_POWER_MANAGEMENT_6:
case WM8903_CLOCK_RATES_0:
case WM8903_CLOCK_RATES_1:
case WM8903_CLOCK_RATES_2:
case WM8903_AUDIO_INTERFACE_0:
case WM8903_AUDIO_INTERFACE_1:
case WM8903_AUDIO_INTERFACE_2:
case WM8903_AUDIO_INTERFACE_3:
case WM8903_DAC_DIGITAL_VOLUME_LEFT:
case WM8903_DAC_DIGITAL_VOLUME_RIGHT:
case WM8903_DAC_DIGITAL_0:
case WM8903_DAC_DIGITAL_1:
case WM8903_ADC_DIGITAL_VOLUME_LEFT:
case WM8903_ADC_DIGITAL_VOLUME_RIGHT:
case WM8903_ADC_DIGITAL_0:
case WM8903_DIGITAL_MICROPHONE_0:
case WM8903_DRC_0:
case WM8903_DRC_1:
case WM8903_DRC_2:
case WM8903_DRC_3:
case WM8903_ANALOGUE_LEFT_INPUT_0:
case WM8903_ANALOGUE_RIGHT_INPUT_0:
case WM8903_ANALOGUE_LEFT_INPUT_1:
case WM8903_ANALOGUE_RIGHT_INPUT_1:
case WM8903_ANALOGUE_LEFT_MIX_0:
case WM8903_ANALOGUE_RIGHT_MIX_0:
case WM8903_ANALOGUE_SPK_MIX_LEFT_0:
case WM8903_ANALOGUE_SPK_MIX_LEFT_1:
case WM8903_ANALOGUE_SPK_MIX_RIGHT_0:
case WM8903_ANALOGUE_SPK_MIX_RIGHT_1:
case WM8903_ANALOGUE_OUT1_LEFT:
case WM8903_ANALOGUE_OUT1_RIGHT:
case WM8903_ANALOGUE_OUT2_LEFT:
case WM8903_ANALOGUE_OUT2_RIGHT:
case WM8903_ANALOGUE_OUT3_LEFT:
case WM8903_ANALOGUE_OUT3_RIGHT:
case WM8903_ANALOGUE_SPK_OUTPUT_CONTROL_0:
case WM8903_DC_SERVO_0:
case WM8903_DC_SERVO_2:
case WM8903_DC_SERVO_READBACK_1:
case WM8903_DC_SERVO_READBACK_2:
case WM8903_DC_SERVO_READBACK_3:
case WM8903_DC_SERVO_READBACK_4:
case WM8903_ANALOGUE_HP_0:
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/completion.h`, `linux/delay.h`, `linux/gpio/driver.h`, `linux/pm.h`, `linux/i2c.h`.
- Detected declarations: `struct wm8903_priv`, `function wm8903_readable_register`, `function wm8903_volatile_register`, `function wm8903_cp_event`, `function wm8903_dcs_event`, `function wm8903_seq_notifier`, `function wm8903_class_w_put`, `function wm8903_set_deemph`, `function wm8903_get_deemph`, `function wm8903_put_deemph`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration 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.