drivers/clk/imx/clk-imx95-blk-ctl.c
Source file repositories/reference/linux-study-clean/drivers/clk/imx/clk-imx95-blk-ctl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/imx/clk-imx95-blk-ctl.c- Extension
.c- Size
- 13877 bytes
- Lines
- 541
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
dt-bindings/clock/nxp,imx94-clock.hdt-bindings/clock/nxp,imx95-clock.hlinux/clk.hlinux/clk-provider.hlinux/pm_runtime.hlinux/debugfs.hlinux/device.hlinux/err.hlinux/io.hlinux/module.hlinux/of_address.hlinux/of_device.hlinux/of_platform.hlinux/platform_device.hlinux/regmap.hlinux/slab.hlinux/spinlock.hlinux/types.h
Detected Declarations
struct imx95_blk_ctlstruct imx95_blk_ctl_clk_dev_datastruct imx95_blk_ctl_dev_datafunction imx95_bc_probefunction imx95_bc_runtime_suspendfunction imx95_bc_runtime_resumefunction imx95_bc_suspendfunction imx95_bc_resume
Annotated Snippet
struct imx95_blk_ctl {
struct device *dev;
spinlock_t lock;
struct clk *clk_apb;
void __iomem *base;
/* clock gate register */
u32 clk_reg_restore;
const struct imx95_blk_ctl_dev_data *pdata;
};
struct imx95_blk_ctl_clk_dev_data {
const char *name;
const char * const *parent_names;
u32 num_parents;
u32 reg;
u32 bit_idx;
u32 bit_width;
u32 clk_type;
u32 flags;
u32 flags2;
u32 type;
};
struct imx95_blk_ctl_dev_data {
const struct imx95_blk_ctl_clk_dev_data *clk_dev_data;
u32 num_clks;
bool rpm_enabled;
u32 clk_reg_offset;
};
static const struct imx95_blk_ctl_clk_dev_data vpublk_clk_dev_data[] = {
[IMX95_CLK_VPUBLK_WAVE] = {
.name = "vpublk_wave_vpu",
.parent_names = (const char *[]){ "vpu", },
.num_parents = 1,
.reg = 8,
.bit_idx = 0,
.type = CLK_GATE,
.flags = CLK_SET_RATE_PARENT,
.flags2 = CLK_GATE_SET_TO_DISABLE,
},
[IMX95_CLK_VPUBLK_JPEG_ENC] = {
.name = "vpublk_jpeg_enc",
.parent_names = (const char *[]){ "vpujpeg", },
.num_parents = 1,
.reg = 8,
.bit_idx = 1,
.type = CLK_GATE,
.flags = CLK_SET_RATE_PARENT,
.flags2 = CLK_GATE_SET_TO_DISABLE,
},
[IMX95_CLK_VPUBLK_JPEG_DEC] = {
.name = "vpublk_jpeg_dec",
.parent_names = (const char *[]){ "vpujpeg", },
.num_parents = 1,
.reg = 8,
.bit_idx = 2,
.type = CLK_GATE,
.flags = CLK_SET_RATE_PARENT,
.flags2 = CLK_GATE_SET_TO_DISABLE,
}
};
static const struct imx95_blk_ctl_dev_data vpublk_dev_data = {
.num_clks = ARRAY_SIZE(vpublk_clk_dev_data),
.clk_dev_data = vpublk_clk_dev_data,
.rpm_enabled = true,
.clk_reg_offset = 8,
};
static const struct imx95_blk_ctl_clk_dev_data camblk_clk_dev_data[] = {
[IMX95_CLK_CAMBLK_CSI2_FOR0] = {
.name = "camblk_csi2_for0",
.parent_names = (const char *[]){ "camisi", },
.num_parents = 1,
.reg = 0,
.bit_idx = 0,
.type = CLK_GATE,
.flags = CLK_SET_RATE_PARENT,
.flags2 = CLK_GATE_SET_TO_DISABLE,
},
[IMX95_CLK_CAMBLK_CSI2_FOR1] = {
.name = "camblk_csi2_for1",
.parent_names = (const char *[]){ "camisi", },
.num_parents = 1,
.reg = 0,
.bit_idx = 1,
.type = CLK_GATE,
.flags = CLK_SET_RATE_PARENT,
Annotation
- Immediate include surface: `dt-bindings/clock/nxp,imx94-clock.h`, `dt-bindings/clock/nxp,imx95-clock.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/pm_runtime.h`, `linux/debugfs.h`, `linux/device.h`, `linux/err.h`.
- Detected declarations: `struct imx95_blk_ctl`, `struct imx95_blk_ctl_clk_dev_data`, `struct imx95_blk_ctl_dev_data`, `function imx95_bc_probe`, `function imx95_bc_runtime_suspend`, `function imx95_bc_runtime_resume`, `function imx95_bc_suspend`, `function imx95_bc_resume`.
- Atlas domain: Driver Families / drivers/clk.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.