sound/soc/codecs/max9860.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/max9860.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/max9860.c- Extension
.c- Size
- 19062 bytes
- Lines
- 739
- 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/init.hlinux/module.hlinux/clk.hlinux/kernel.hlinux/pm_runtime.hlinux/regmap.hlinux/i2c.hlinux/regulator/consumer.hsound/soc.hsound/soc-dapm.hsound/pcm_params.hsound/tlv.hmax9860.h
Detected Declarations
struct max9860_privfunction max9860_dvddio_eventfunction max9860_readablefunction max9860_writeablefunction max9860_volatilefunction max9860_preciousfunction max9860_hw_paramsfunction max9860_set_fmtfunction max9860_set_bias_levelfunction max9860_suspendfunction max9860_resumefunction max9860_probefunction max9860_remove
Annotated Snippet
struct max9860_priv {
struct regmap *regmap;
struct regulator *dvddio;
struct notifier_block dvddio_nb;
u8 psclk;
unsigned long pclk_rate;
int fmt;
};
static int max9860_dvddio_event(struct notifier_block *nb,
unsigned long event, void *data)
{
struct max9860_priv *max9860 = container_of(nb, struct max9860_priv,
dvddio_nb);
if (event & REGULATOR_EVENT_DISABLE) {
regcache_mark_dirty(max9860->regmap);
regcache_cache_only(max9860->regmap, true);
}
return 0;
}
static const struct reg_default max9860_reg_defaults[] = {
{ MAX9860_PWRMAN, 0x00 },
{ MAX9860_INTEN, 0x00 },
{ MAX9860_SYSCLK, 0x00 },
{ MAX9860_AUDIOCLKHIGH, 0x00 },
{ MAX9860_AUDIOCLKLOW, 0x00 },
{ MAX9860_IFC1A, 0x00 },
{ MAX9860_IFC1B, 0x00 },
{ MAX9860_VOICEFLTR, 0x00 },
{ MAX9860_DACATTN, 0x00 },
{ MAX9860_ADCLEVEL, 0x00 },
{ MAX9860_DACGAIN, 0x00 },
{ MAX9860_MICGAIN, 0x00 },
{ MAX9860_MICADC, 0x00 },
{ MAX9860_NOISEGATE, 0x00 },
};
static bool max9860_readable(struct device *dev, unsigned int reg)
{
switch (reg) {
case MAX9860_INTRSTATUS ... MAX9860_MICGAIN:
case MAX9860_MICADC ... MAX9860_PWRMAN:
case MAX9860_REVISION:
return true;
}
return false;
}
static bool max9860_writeable(struct device *dev, unsigned int reg)
{
switch (reg) {
case MAX9860_INTEN ... MAX9860_MICGAIN:
case MAX9860_MICADC ... MAX9860_PWRMAN:
return true;
}
return false;
}
static bool max9860_volatile(struct device *dev, unsigned int reg)
{
switch (reg) {
case MAX9860_INTRSTATUS:
case MAX9860_MICREADBACK:
return true;
}
return false;
}
static bool max9860_precious(struct device *dev, unsigned int reg)
{
switch (reg) {
case MAX9860_INTRSTATUS:
return true;
}
return false;
}
static const struct regmap_config max9860_regmap = {
.reg_bits = 8,
.val_bits = 8,
.readable_reg = max9860_readable,
.writeable_reg = max9860_writeable,
.volatile_reg = max9860_volatile,
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `linux/clk.h`, `linux/kernel.h`, `linux/pm_runtime.h`, `linux/regmap.h`, `linux/i2c.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct max9860_priv`, `function max9860_dvddio_event`, `function max9860_readable`, `function max9860_writeable`, `function max9860_volatile`, `function max9860_precious`, `function max9860_hw_params`, `function max9860_set_fmt`, `function max9860_set_bias_level`, `function max9860_suspend`.
- 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.