drivers/clk/imx/clk-imx8mp-audiomix.c
Source file repositories/reference/linux-study-clean/drivers/clk/imx/clk-imx8mp-audiomix.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/imx/clk-imx8mp-audiomix.c- Extension
.c- Size
- 11885 bytes
- Lines
- 440
- Domain
- Driver Families
- Bucket
- drivers/clk
- 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/auxiliary_bus.hlinux/clk-provider.hlinux/device.hlinux/io.hlinux/mod_devicetable.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/slab.hdt-bindings/clock/imx8mp-clock.hclk.h
Detected Declarations
struct clk_imx8mp_audiomix_selstruct clk_imx8mp_audiomix_privfunction clk_imx8mp_audiomix_reset_controller_registerfunction clk_imx8mp_audiomix_reset_controller_registerfunction clk_imx8mp_audiomix_save_restorefunction clk_imx8mp_audiomix_probefunction clk_imx8mp_audiomix_removefunction clk_imx8mp_audiomix_runtime_suspendfunction clk_imx8mp_audiomix_runtime_resume
Annotated Snippet
struct clk_imx8mp_audiomix_sel {
const char *name;
int clkid;
const struct clk_parent_data parent; /* For gate */
const struct clk_parent_data *parents; /* For mux */
int num_parents;
u16 reg;
u8 width;
u8 shift;
};
static struct clk_imx8mp_audiomix_sel sels[] = {
CLK_GATE("asrc", ASRC_IPG),
CLK_GATE("pdm", PDM_IPG),
CLK_GATE("earc", EARC_IPG),
CLK_GATE_PARENT("ocrama", OCRAMA_IPG, "axi"),
CLK_GATE("aud2htx", AUD2HTX_IPG),
CLK_GATE_PARENT("earc_phy", EARC_PHY, "sai_pll_out_div2"),
CLK_GATE("sdma2", SDMA2_ROOT),
CLK_GATE("sdma3", SDMA3_ROOT),
CLK_GATE("spba2", SPBA2_ROOT),
CLK_GATE_PARENT("dsp", DSP_ROOT, "axi"),
CLK_GATE_PARENT("dspdbg", DSPDBG_ROOT, "axi"),
CLK_GATE("edma", EDMA_ROOT),
CLK_GATE_PARENT("audpll", AUDPLL_ROOT, "osc_24m"),
CLK_GATE("mu2", MU2_ROOT),
CLK_GATE("mu3", MU3_ROOT),
CLK_PDM,
CLK_SAIn(1),
CLK_SAIn(2),
CLK_SAIn(3),
CLK_SAIn(5),
CLK_SAIn(6),
CLK_SAIn(7)
};
static const u16 audiomix_regs[] = {
CLKEN0,
CLKEN1,
EARC,
SAI1_MCLK_SEL,
SAI2_MCLK_SEL,
SAI3_MCLK_SEL,
SAI5_MCLK_SEL,
SAI6_MCLK_SEL,
SAI7_MCLK_SEL,
PDM_SEL,
SAI_PLL_GNRL_CTL,
SAI_PLL_FDIVL_CTL0,
SAI_PLL_FDIVL_CTL1,
SAI_PLL_SSCG_CTL,
SAI_PLL_MNIT_CTL,
IPG_LP_CTRL,
};
struct clk_imx8mp_audiomix_priv {
void __iomem *base;
u32 regs_save[ARRAY_SIZE(audiomix_regs)];
/* Must be last */
struct clk_hw_onecell_data clk_data;
};
#if IS_ENABLED(CONFIG_RESET_CONTROLLER)
static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
struct clk_imx8mp_audiomix_priv *priv)
{
struct auxiliary_device *adev;
if (!of_property_present(dev->of_node, "#reset-cells"))
return 0;
adev = devm_auxiliary_device_create(dev, "reset", NULL);
if (!adev)
return -ENODEV;
return 0;
}
#else /* !CONFIG_RESET_CONTROLLER */
static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
struct clk_imx8mp_audiomix_priv *priv)
{
return 0;
}
#endif /* !CONFIG_RESET_CONTROLLER */
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/clk-provider.h`, `linux/device.h`, `linux/io.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `struct clk_imx8mp_audiomix_sel`, `struct clk_imx8mp_audiomix_priv`, `function clk_imx8mp_audiomix_reset_controller_register`, `function clk_imx8mp_audiomix_reset_controller_register`, `function clk_imx8mp_audiomix_save_restore`, `function clk_imx8mp_audiomix_probe`, `function clk_imx8mp_audiomix_remove`, `function clk_imx8mp_audiomix_runtime_suspend`, `function clk_imx8mp_audiomix_runtime_resume`.
- Atlas domain: Driver Families / drivers/clk.
- 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.