drivers/clk/aspeed/clk-ast2700.c
Source file repositories/reference/linux-study-clean/drivers/clk/aspeed/clk-ast2700.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/aspeed/clk-ast2700.c- Extension
.c- Size
- 34484 bytes
- Lines
- 1056
- 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/auxiliary_bus.hlinux/bitfield.hlinux/clk-provider.hlinux/io.hlinux/mod_devicetable.hlinux/platform_device.hlinux/slab.hlinux/units.hdt-bindings/clock/aspeed,ast2700-scu.h
Detected Declarations
struct ast2700_clk_fixed_factor_datastruct ast2700_clk_gate_datastruct ast2700_clk_mux_datastruct ast2700_clk_div_datastruct ast2700_clk_pll_datastruct ast2700_clk_fixed_rate_datastruct ast2700_clk_display_fixed_datastruct ast2700_clk_infostruct ast2700_clk_datastruct ast2700_clk_ctrlenum ast2700_clk_typefunction ast2700_clk_is_enabledfunction ast2700_clk_enablefunction ast2700_clk_disablefunction ast2700_soc1_configure_i3c_clkfunction ast2700_soc_clk_probe
Annotated Snippet
struct ast2700_clk_fixed_factor_data {
unsigned int mult;
unsigned int div;
int parent_id;
};
struct ast2700_clk_gate_data {
int parent_id;
u32 flags;
u32 reg;
u8 bit;
};
struct ast2700_clk_mux_data {
const struct clk_hw **parent_hws;
const unsigned int *parent_ids;
unsigned int num_parents;
u8 bit_shift;
u8 bit_width;
u32 reg;
};
struct ast2700_clk_div_data {
const struct clk_div_table *div_table;
unsigned int parent_id;
u8 bit_shift;
u8 bit_width;
u32 reg;
};
struct ast2700_clk_pll_data {
unsigned int parent_id;
u32 reg;
};
struct ast2700_clk_fixed_rate_data {
unsigned long fixed_rate;
};
struct ast2700_clk_display_fixed_data {
u32 reg;
};
struct ast2700_clk_info {
const char *name;
u32 id;
u32 reg;
u32 type;
union {
struct ast2700_clk_fixed_factor_data factor;
struct ast2700_clk_fixed_rate_data rate;
struct ast2700_clk_display_fixed_data display_rate;
struct ast2700_clk_gate_data gate;
struct ast2700_clk_div_data div;
struct ast2700_clk_pll_data pll;
struct ast2700_clk_mux_data mux;
} data;
};
struct ast2700_clk_data {
const struct ast2700_clk_info *clk_info;
unsigned int nr_clks;
const int scu;
};
struct ast2700_clk_ctrl {
const struct ast2700_clk_data *clk_data;
struct device *dev;
void __iomem *base;
spinlock_t lock; /* clk lock */
};
static const struct clk_div_table ast2700_rgmii_div_table[] = {
{ 0x0, 4 },
{ 0x1, 4 },
{ 0x2, 6 },
{ 0x3, 8 },
{ 0x4, 10 },
{ 0x5, 12 },
{ 0x6, 14 },
{ 0x7, 16 },
{ 0 }
};
static const struct clk_div_table ast2700_rmii_div_table[] = {
{ 0x0, 8 },
{ 0x1, 8 },
{ 0x2, 12 },
{ 0x3, 16 },
{ 0x4, 20 },
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/bitfield.h`, `linux/clk-provider.h`, `linux/io.h`, `linux/mod_devicetable.h`, `linux/platform_device.h`, `linux/slab.h`, `linux/units.h`.
- Detected declarations: `struct ast2700_clk_fixed_factor_data`, `struct ast2700_clk_gate_data`, `struct ast2700_clk_mux_data`, `struct ast2700_clk_div_data`, `struct ast2700_clk_pll_data`, `struct ast2700_clk_fixed_rate_data`, `struct ast2700_clk_display_fixed_data`, `struct ast2700_clk_info`, `struct ast2700_clk_data`, `struct ast2700_clk_ctrl`.
- 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.