sound/soc/codecs/wm2200.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/wm2200.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/wm2200.c- Extension
.c- Size
- 82565 bytes
- Lines
- 2494
- 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.
- 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/delay.hlinux/pm.hlinux/firmware.hlinux/gcd.hlinux/gpio/consumer.hlinux/i2c.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/regulator/fixed.hlinux/slab.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/jack.hsound/initval.hsound/tlv.hsound/wm2200.hwm2200.hwm_adsp.h
Detected Declarations
struct wm2200_privstruct _fll_divfunction wm2200_volatile_registerfunction wm2200_readable_registerfunction wm2200_resetfunction wm2200_probefunction wm2200_set_fmtfunction wm2200_hw_paramsfunction wm2200_set_sysclkfunction fll_factorsfunction wm2200_set_fllfunction wm2200_dai_probefunction wm2200_irqfunction wm2200_i2c_probefunction wm2200_i2c_removefunction wm2200_runtime_suspendfunction wm2200_runtime_resume
Annotated Snippet
struct wm2200_priv {
struct wm_adsp dsp[2];
struct regmap *regmap;
struct device *dev;
struct snd_soc_component *component;
struct wm2200_pdata pdata;
struct regulator_bulk_data core_supplies[WM2200_NUM_CORE_SUPPLIES];
struct gpio_desc *ldo_ena;
struct gpio_desc *reset;
struct completion fll_lock;
int fll_fout;
int fll_fref;
int fll_src;
int rev;
int sysclk;
unsigned int symmetric_rates:1;
};
#define WM2200_DSP_RANGE_BASE (WM2200_MAX_REGISTER + 1)
#define WM2200_DSP_SPACING 12288
#define WM2200_DSP1_DM_BASE (WM2200_DSP_RANGE_BASE + (0 * WM2200_DSP_SPACING))
#define WM2200_DSP1_PM_BASE (WM2200_DSP_RANGE_BASE + (1 * WM2200_DSP_SPACING))
#define WM2200_DSP1_ZM_BASE (WM2200_DSP_RANGE_BASE + (2 * WM2200_DSP_SPACING))
#define WM2200_DSP2_DM_BASE (WM2200_DSP_RANGE_BASE + (3 * WM2200_DSP_SPACING))
#define WM2200_DSP2_PM_BASE (WM2200_DSP_RANGE_BASE + (4 * WM2200_DSP_SPACING))
#define WM2200_DSP2_ZM_BASE (WM2200_DSP_RANGE_BASE + (5 * WM2200_DSP_SPACING))
static const struct regmap_range_cfg wm2200_ranges[] = {
{ .name = "DSP1DM", .range_min = WM2200_DSP1_DM_BASE,
.range_max = WM2200_DSP1_DM_BASE + 12287,
.selector_reg = WM2200_DSP1_CONTROL_3,
.selector_mask = WM2200_DSP1_PAGE_BASE_DM_0_MASK,
.selector_shift = WM2200_DSP1_PAGE_BASE_DM_0_SHIFT,
.window_start = WM2200_DSP1_DM_0, .window_len = 2048, },
{ .name = "DSP1PM", .range_min = WM2200_DSP1_PM_BASE,
.range_max = WM2200_DSP1_PM_BASE + 12287,
.selector_reg = WM2200_DSP1_CONTROL_2,
.selector_mask = WM2200_DSP1_PAGE_BASE_PM_0_MASK,
.selector_shift = WM2200_DSP1_PAGE_BASE_PM_0_SHIFT,
.window_start = WM2200_DSP1_PM_0, .window_len = 768, },
{ .name = "DSP1ZM", .range_min = WM2200_DSP1_ZM_BASE,
.range_max = WM2200_DSP1_ZM_BASE + 2047,
.selector_reg = WM2200_DSP1_CONTROL_4,
.selector_mask = WM2200_DSP1_PAGE_BASE_ZM_0_MASK,
.selector_shift = WM2200_DSP1_PAGE_BASE_ZM_0_SHIFT,
.window_start = WM2200_DSP1_ZM_0, .window_len = 1024, },
{ .name = "DSP2DM", .range_min = WM2200_DSP2_DM_BASE,
.range_max = WM2200_DSP2_DM_BASE + 4095,
.selector_reg = WM2200_DSP2_CONTROL_3,
.selector_mask = WM2200_DSP2_PAGE_BASE_DM_0_MASK,
.selector_shift = WM2200_DSP2_PAGE_BASE_DM_0_SHIFT,
.window_start = WM2200_DSP2_DM_0, .window_len = 2048, },
{ .name = "DSP2PM", .range_min = WM2200_DSP2_PM_BASE,
.range_max = WM2200_DSP2_PM_BASE + 11287,
.selector_reg = WM2200_DSP2_CONTROL_2,
.selector_mask = WM2200_DSP2_PAGE_BASE_PM_0_MASK,
.selector_shift = WM2200_DSP2_PAGE_BASE_PM_0_SHIFT,
.window_start = WM2200_DSP2_PM_0, .window_len = 768, },
{ .name = "DSP2ZM", .range_min = WM2200_DSP2_ZM_BASE,
.range_max = WM2200_DSP2_ZM_BASE + 2047,
.selector_reg = WM2200_DSP2_CONTROL_4,
.selector_mask = WM2200_DSP2_PAGE_BASE_ZM_0_MASK,
.selector_shift = WM2200_DSP2_PAGE_BASE_ZM_0_SHIFT,
.window_start = WM2200_DSP2_ZM_0, .window_len = 1024, },
};
static const struct cs_dsp_region wm2200_dsp1_regions[] = {
{ .type = WMFW_ADSP1_PM, .base = WM2200_DSP1_PM_BASE },
{ .type = WMFW_ADSP1_DM, .base = WM2200_DSP1_DM_BASE },
{ .type = WMFW_ADSP1_ZM, .base = WM2200_DSP1_ZM_BASE },
};
static const struct cs_dsp_region wm2200_dsp2_regions[] = {
{ .type = WMFW_ADSP1_PM, .base = WM2200_DSP2_PM_BASE },
{ .type = WMFW_ADSP1_DM, .base = WM2200_DSP2_DM_BASE },
{ .type = WMFW_ADSP1_ZM, .base = WM2200_DSP2_ZM_BASE },
};
static const struct reg_default wm2200_reg_defaults[] = {
{ 0x000B, 0x0000 }, /* R11 - Tone Generator 1 */
{ 0x0102, 0x0000 }, /* R258 - Clocking 3 */
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/firmware.h`, `linux/gcd.h`, `linux/gpio/consumer.h`.
- Detected declarations: `struct wm2200_priv`, `struct _fll_div`, `function wm2200_volatile_register`, `function wm2200_readable_register`, `function wm2200_reset`, `function wm2200_probe`, `function wm2200_set_fmt`, `function wm2200_hw_params`, `function wm2200_set_sysclk`, `function fll_factors`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- 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.