drivers/clk/clk-bm1880.c
Source file repositories/reference/linux-study-clean/drivers/clk/clk-bm1880.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/clk-bm1880.c- Extension
.c- Size
- 27134 bytes
- Lines
- 947
- 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
linux/clk-provider.hlinux/io.hlinux/kernel.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/slab.hdt-bindings/clock/bm1880-clock.h
Detected Declarations
struct bm1880_clock_datastruct bm1880_gate_clockstruct bm1880_mux_clockstruct bm1880_div_clockstruct bm1880_div_hw_clockstruct bm1880_composite_clockstruct bm1880_pll_clockstruct bm1880_pll_hw_clockfunction bm1880_pll_rate_calcfunction bm1880_pll_recalc_ratefunction bm1880_clk_register_pllsfunction bm1880_clk_register_muxfunction bm1880_clk_div_recalc_ratefunction bm1880_clk_div_determine_ratefunction bm1880_clk_div_set_ratefunction bm1880_clk_register_divsfunction bm1880_clk_register_gatefunction bm1880_clk_register_compositesfunction bm1880_clk_probe
Annotated Snippet
struct bm1880_clock_data {
void __iomem *pll_base;
void __iomem *sys_base;
struct clk_hw_onecell_data hw_data;
};
struct bm1880_gate_clock {
unsigned int id;
const char *name;
const char *parent;
u32 gate_reg;
s8 gate_shift;
unsigned long flags;
};
struct bm1880_mux_clock {
unsigned int id;
const char *name;
const char * const *parents;
s8 num_parents;
u32 reg;
s8 shift;
unsigned long flags;
};
struct bm1880_div_clock {
unsigned int id;
const char *name;
u32 reg;
u8 shift;
u8 width;
u32 initval;
const struct clk_div_table *table;
unsigned long flags;
};
struct bm1880_div_hw_clock {
struct bm1880_div_clock div;
void __iomem *base;
spinlock_t *lock;
struct clk_hw hw;
struct clk_init_data init;
};
struct bm1880_composite_clock {
unsigned int id;
const char *name;
const char *parent;
const char * const *parents;
unsigned int num_parents;
unsigned long flags;
u32 gate_reg;
u32 mux_reg;
u32 div_reg;
s8 gate_shift;
s8 mux_shift;
s8 div_shift;
s8 div_width;
s16 div_initval;
const struct clk_div_table *table;
};
struct bm1880_pll_clock {
unsigned int id;
const char *name;
u32 reg;
unsigned long flags;
};
struct bm1880_pll_hw_clock {
struct bm1880_pll_clock pll;
void __iomem *base;
struct clk_hw hw;
struct clk_init_data init;
};
static const struct clk_ops bm1880_pll_ops;
static const struct clk_ops bm1880_clk_div_ops;
#define GATE_DIV(_id, _name, _parent, _gate_reg, _gate_shift, _div_reg, \
_div_shift, _div_width, _div_initval, _table, \
_flags) { \
.id = _id, \
.parent = _parent, \
.name = _name, \
.gate_reg = _gate_reg, \
.gate_shift = _gate_shift, \
.div_reg = _div_reg, \
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/io.h`, `linux/kernel.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/slab.h`, `dt-bindings/clock/bm1880-clock.h`.
- Detected declarations: `struct bm1880_clock_data`, `struct bm1880_gate_clock`, `struct bm1880_mux_clock`, `struct bm1880_div_clock`, `struct bm1880_div_hw_clock`, `struct bm1880_composite_clock`, `struct bm1880_pll_clock`, `struct bm1880_pll_hw_clock`, `function bm1880_pll_rate_calc`, `function bm1880_pll_recalc_rate`.
- 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.