sound/soc/codecs/wm9090.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/wm9090.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/wm9090.c- Extension
.c- Size
- 20089 bytes
- Lines
- 629
- 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/errno.hlinux/device.hlinux/i2c.hlinux/delay.hlinux/regmap.hlinux/slab.hsound/initval.hsound/soc.hsound/tlv.hsound/wm9090.hwm9090.h
Detected Declarations
struct wm9090_privfunction wm9090_volatilefunction wm9090_readablefunction wait_for_dc_servofunction hp_evfunction wm9090_add_controlsfunction wm9090_set_bias_levelfunction wm9090_probefunction wm9090_i2c_probe
Annotated Snippet
struct wm9090_priv {
struct wm9090_platform_data pdata;
struct regmap *regmap;
};
static bool wm9090_volatile(struct device *dev, unsigned int reg)
{
switch (reg) {
case WM9090_SOFTWARE_RESET:
case WM9090_DC_SERVO_0:
case WM9090_DC_SERVO_READBACK_0:
case WM9090_DC_SERVO_READBACK_1:
case WM9090_DC_SERVO_READBACK_2:
return true;
default:
return false;
}
}
static bool wm9090_readable(struct device *dev, unsigned int reg)
{
switch (reg) {
case WM9090_SOFTWARE_RESET:
case WM9090_POWER_MANAGEMENT_1:
case WM9090_POWER_MANAGEMENT_2:
case WM9090_POWER_MANAGEMENT_3:
case WM9090_CLOCKING_1:
case WM9090_IN1_LINE_CONTROL:
case WM9090_IN2_LINE_CONTROL:
case WM9090_IN1_LINE_INPUT_A_VOLUME:
case WM9090_IN1_LINE_INPUT_B_VOLUME:
case WM9090_IN2_LINE_INPUT_A_VOLUME:
case WM9090_IN2_LINE_INPUT_B_VOLUME:
case WM9090_LEFT_OUTPUT_VOLUME:
case WM9090_RIGHT_OUTPUT_VOLUME:
case WM9090_SPKMIXL_ATTENUATION:
case WM9090_SPKOUT_MIXERS:
case WM9090_CLASSD3:
case WM9090_SPEAKER_VOLUME_LEFT:
case WM9090_OUTPUT_MIXER1:
case WM9090_OUTPUT_MIXER2:
case WM9090_OUTPUT_MIXER3:
case WM9090_OUTPUT_MIXER4:
case WM9090_SPEAKER_MIXER:
case WM9090_ANTIPOP2:
case WM9090_WRITE_SEQUENCER_0:
case WM9090_WRITE_SEQUENCER_1:
case WM9090_WRITE_SEQUENCER_2:
case WM9090_WRITE_SEQUENCER_3:
case WM9090_WRITE_SEQUENCER_4:
case WM9090_WRITE_SEQUENCER_5:
case WM9090_CHARGE_PUMP_1:
case WM9090_DC_SERVO_0:
case WM9090_DC_SERVO_1:
case WM9090_DC_SERVO_3:
case WM9090_DC_SERVO_READBACK_0:
case WM9090_DC_SERVO_READBACK_1:
case WM9090_DC_SERVO_READBACK_2:
case WM9090_ANALOGUE_HP_0:
case WM9090_AGC_CONTROL_0:
case WM9090_AGC_CONTROL_1:
case WM9090_AGC_CONTROL_2:
return true;
default:
return false;
}
}
static void wait_for_dc_servo(struct snd_soc_component *component)
{
unsigned int reg;
int count = 0;
dev_dbg(component->dev, "Waiting for DC servo...\n");
do {
count++;
msleep(1);
reg = snd_soc_component_read(component, WM9090_DC_SERVO_READBACK_0);
dev_dbg(component->dev, "DC servo status: %x\n", reg);
} while ((reg & WM9090_DCS_CAL_COMPLETE_MASK)
!= WM9090_DCS_CAL_COMPLETE_MASK && count < 1000);
if ((reg & WM9090_DCS_CAL_COMPLETE_MASK)
!= WM9090_DCS_CAL_COMPLETE_MASK)
dev_err(component->dev, "Timed out waiting for DC Servo\n");
}
static const DECLARE_TLV_DB_RANGE(in_tlv,
Annotation
- Immediate include surface: `linux/module.h`, `linux/errno.h`, `linux/device.h`, `linux/i2c.h`, `linux/delay.h`, `linux/regmap.h`, `linux/slab.h`, `sound/initval.h`.
- Detected declarations: `struct wm9090_priv`, `function wm9090_volatile`, `function wm9090_readable`, `function wait_for_dc_servo`, `function hp_ev`, `function wm9090_add_controls`, `function wm9090_set_bias_level`, `function wm9090_probe`, `function wm9090_i2c_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.