drivers/clk/stm32/clk-stm32-core.h
Source file repositories/reference/linux-study-clean/drivers/clk/stm32/clk-stm32-core.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/stm32/clk-stm32-core.h- Extension
.h- Size
- 4759 bytes
- Lines
- 186
- 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.h
Detected Declarations
struct stm32_rcc_match_datastruct stm32_mux_cfgstruct stm32_gate_cfgstruct stm32_div_cfgstruct stm32_composite_cfgstruct clock_configstruct clk_stm32_clock_datastruct stm32_rcc_match_datastruct clk_stm32_muxstruct clk_stm32_gatestruct clk_stm32_divstruct clk_stm32_composite
Annotated Snippet
struct stm32_mux_cfg {
u16 offset;
u8 shift;
u8 width;
u8 flags;
u32 *table;
u8 ready;
};
struct stm32_gate_cfg {
u16 offset;
u8 bit_idx;
u8 set_clr;
};
struct stm32_div_cfg {
u16 offset;
u8 shift;
u8 width;
u8 flags;
u8 ready;
const struct clk_div_table *table;
};
struct stm32_composite_cfg {
int mux;
int gate;
int div;
};
#define NO_ID 0xFFFFFFFF
#define NO_STM32_MUX 0xFFFF
#define NO_STM32_DIV 0xFFFF
#define NO_STM32_GATE 0xFFFF
struct clock_config {
unsigned long id;
int sec_id;
void *clock_cfg;
struct clk_hw *(*func)(struct device *dev,
const struct stm32_rcc_match_data *data,
void __iomem *base,
spinlock_t *lock,
const struct clock_config *cfg);
};
struct clk_stm32_clock_data {
u16 *gate_cpt;
const struct stm32_gate_cfg *gates;
const struct stm32_mux_cfg *muxes;
const struct stm32_div_cfg *dividers;
struct clk_hw *(*is_multi_mux)(struct clk_hw *hw);
};
struct stm32_rcc_match_data {
struct clk_hw_onecell_data *hw_clks;
unsigned int num_clocks;
const struct clock_config *tab_clocks;
unsigned int maxbinding;
struct clk_stm32_clock_data *clock_data;
struct clk_stm32_reset_data *reset_data;
int (*check_security)(struct device_node *np, void __iomem *base,
const struct clock_config *cfg);
int (*multi_mux)(void __iomem *base, const struct clock_config *cfg);
};
int stm32_rcc_init(struct device *dev, const struct of_device_id *match_data,
void __iomem *base);
/* MUX define */
#define MUX_NO_RDY 0xFF
#define MUX_SAFE BIT(7)
/* DIV define */
#define DIV_NO_RDY 0xFF
/* Definition of clock structure */
struct clk_stm32_mux {
u16 mux_id;
struct clk_hw hw;
void __iomem *base;
struct clk_stm32_clock_data *clock_data;
spinlock_t *lock; /* spin lock */
};
#define to_clk_stm32_mux(_hw) container_of(_hw, struct clk_stm32_mux, hw)
struct clk_stm32_gate {
Annotation
- Immediate include surface: `linux/clk-provider.h`.
- Detected declarations: `struct stm32_rcc_match_data`, `struct stm32_mux_cfg`, `struct stm32_gate_cfg`, `struct stm32_div_cfg`, `struct stm32_composite_cfg`, `struct clock_config`, `struct clk_stm32_clock_data`, `struct stm32_rcc_match_data`, `struct clk_stm32_mux`, `struct clk_stm32_gate`.
- 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.