drivers/clk/nxp/clk-lpc18xx-cgu.c
Source file repositories/reference/linux-study-clean/drivers/clk/nxp/clk-lpc18xx-cgu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/nxp/clk-lpc18xx-cgu.c- Extension
.c- Size
- 18918 bytes
- Lines
- 669
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk-provider.hlinux/delay.hlinux/io.hlinux/kernel.hlinux/of.hlinux/of_address.hdt-bindings/clock/lpc18xx-cgu.h
Detected Declarations
struct lpc18xx_cgu_src_clk_divstruct lpc18xx_cgu_base_clkstruct lpc18xx_pllstruct lpc18xx_cgu_pll_clkfunction manualfunction lpc18xx_pll0_msel2mdecfunction lpc18xx_pll0_msel2selifunction lpc18xx_pll0_msel2selpfunction lpc18xx_pll0_recalc_ratefunction lpc18xx_pll0_determine_ratefunction lpc18xx_pll0_set_ratefunction lpc18xx_pll1_recalc_ratefunction lpc18xx_cgu_gate_enablefunction lpc18xx_cgu_gate_disablefunction lpc18xx_cgu_gate_is_enabledfunction lpc18xx_fill_parent_namesfunction lpc18xx_cgu_register_source_clksfunction lpc18xx_cgu_register_base_clksfunction lpc18xx_cgu_init
Annotated Snippet
struct lpc18xx_cgu_src_clk_div {
u8 clk_id;
u8 n_parents;
struct clk_divider div;
struct clk_mux mux;
struct clk_gate gate;
};
#define LPC1XX_CGU_SRC_CLK_DIV(_id, _width, _table) \
{ \
.clk_id = CLK_SRC_ ##_id, \
.n_parents = ARRAY_SIZE(lpc18xx_cgu_ ##_table), \
.div = { \
.shift = 2, \
.width = _width, \
}, \
.mux = { \
.mask = 0x1f, \
.shift = 24, \
.table = lpc18xx_cgu_ ##_table, \
}, \
.gate = { \
.bit_idx = 0, \
.flags = CLK_GATE_SET_TO_DISABLE, \
}, \
}
static struct lpc18xx_cgu_src_clk_div lpc18xx_cgu_src_clk_divs[] = {
LPC1XX_CGU_SRC_CLK_DIV(IDIVA, 2, idiva_src_ids),
LPC1XX_CGU_SRC_CLK_DIV(IDIVB, 4, idivbcde_src_ids),
LPC1XX_CGU_SRC_CLK_DIV(IDIVC, 4, idivbcde_src_ids),
LPC1XX_CGU_SRC_CLK_DIV(IDIVD, 4, idivbcde_src_ids),
LPC1XX_CGU_SRC_CLK_DIV(IDIVE, 8, idivbcde_src_ids),
};
struct lpc18xx_cgu_base_clk {
u8 clk_id;
u8 n_parents;
struct clk_mux mux;
struct clk_gate gate;
};
#define LPC1XX_CGU_BASE_CLK(_id, _table, _flags) \
{ \
.clk_id = BASE_ ##_id ##_CLK, \
.n_parents = ARRAY_SIZE(lpc18xx_cgu_ ##_table), \
.mux = { \
.mask = 0x1f, \
.shift = 24, \
.table = lpc18xx_cgu_ ##_table, \
.flags = _flags, \
}, \
.gate = { \
.bit_idx = 0, \
.flags = CLK_GATE_SET_TO_DISABLE, \
}, \
}
static struct lpc18xx_cgu_base_clk lpc18xx_cgu_base_clks[] = {
LPC1XX_CGU_BASE_CLK(SAFE, base_irc_src_ids, CLK_MUX_READ_ONLY),
LPC1XX_CGU_BASE_CLK(USB0, base_usb0_src_ids, 0),
LPC1XX_CGU_BASE_CLK(PERIPH, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(USB1, base_all_src_ids, 0),
LPC1XX_CGU_BASE_CLK(CPU, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(SPIFI, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(SPI, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(PHY_RX, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(PHY_TX, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(APB1, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(APB3, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(LCD, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(ADCHS, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(SDIO, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(SSP0, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(SSP1, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(UART0, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(UART1, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(UART2, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(UART3, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(OUT, base_all_src_ids, 0),
{ /* 21 reserved */ },
{ /* 22 reserved */ },
{ /* 23 reserved */ },
{ /* 24 reserved */ },
LPC1XX_CGU_BASE_CLK(AUDIO, base_common_src_ids, 0),
LPC1XX_CGU_BASE_CLK(CGU_OUT0, base_all_src_ids, 0),
LPC1XX_CGU_BASE_CLK(CGU_OUT1, base_all_src_ids, 0),
};
struct lpc18xx_pll {
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/delay.h`, `linux/io.h`, `linux/kernel.h`, `linux/of.h`, `linux/of_address.h`, `dt-bindings/clock/lpc18xx-cgu.h`.
- Detected declarations: `struct lpc18xx_cgu_src_clk_div`, `struct lpc18xx_cgu_base_clk`, `struct lpc18xx_pll`, `struct lpc18xx_cgu_pll_clk`, `function manual`, `function lpc18xx_pll0_msel2mdec`, `function lpc18xx_pll0_msel2seli`, `function lpc18xx_pll0_msel2selp`, `function lpc18xx_pll0_recalc_rate`, `function lpc18xx_pll0_determine_rate`.
- 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.