drivers/clk/tenstorrent/atlantis-prcm.c
Source file repositories/reference/linux-study-clean/drivers/clk/tenstorrent/atlantis-prcm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/tenstorrent/atlantis-prcm.c- Extension
.c- Size
- 29047 bytes
- Lines
- 871
- 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.
- 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/tenstorrent,atlantis-prcm-rcpu.hlinux/auxiliary_bus.hlinux/bitfield.hlinux/clk-provider.hlinux/platform_device.hlinux/regmap.hlinux/slab.h
Detected Declarations
struct atlantis_clk_commonstruct atlantis_clk_mux_configstruct atlantis_clk_muxstruct atlantis_clk_gate_configstruct atlantis_clk_gatestruct atlantis_clk_divider_configstruct atlantis_clk_dividerstruct atlantis_clk_pll_configstruct atlantis_clk_pllstruct atlantis_clk_gate_shared_configstruct atlantis_clk_gate_sharedstruct atlantis_clk_fixed_factor_configstruct atlantis_clk_fixed_factorstruct atlantis_prcm_datafunction hw_to_atlantis_clk_commonfunction hw_to_atlantis_clk_gatefunction hw_to_atlantis_clk_dividerfunction hw_to_atlantis_clk_gate_sharedfunction hw_to_atlantis_clk_fixed_factorfunction atlantis_clk_mux_get_parentfunction atlantis_clk_mux_set_parentfunction atlantis_clk_mux_determine_ratefunction atlantis_clk_gate_endisablefunction atlantis_clk_gate_enablefunction atlantis_clk_gate_disablefunction atlantis_clk_gate_is_enabledfunction atlantis_clk_divider_recalc_ratefunction atlantis_clk_fixed_factor_recalc_ratefunction atlantis_clk_pll_is_enabledfunction atlantis_clk_pll_enablefunction atlantis_clk_pll_disablefunction atlantis_clk_pll_recalc_ratefunction atlantis_clk_gate_shared_enablefunction scoped_guardfunction atlantis_clk_gate_shared_disablefunction scoped_guardfunction atlantis_clk_gate_shared_is_enabledfunction atlantis_clk_gate_shared_disable_unusedfunction scoped_guardfunction atlantis_prcm_clocks_registerfunction atlantis_prcm_probe
Annotated Snippet
struct atlantis_clk_common {
int clkid;
struct regmap *regmap;
struct clk_hw hw;
};
static inline struct atlantis_clk_common *
hw_to_atlantis_clk_common(struct clk_hw *hw)
{
return container_of(hw, struct atlantis_clk_common, hw);
}
struct atlantis_clk_mux_config {
u8 shift;
u8 width;
u32 reg_offset;
};
struct atlantis_clk_mux {
struct atlantis_clk_common common;
struct atlantis_clk_mux_config config;
};
struct atlantis_clk_gate_config {
u32 reg_offset;
u32 enable;
};
struct atlantis_clk_gate {
struct atlantis_clk_common common;
struct atlantis_clk_gate_config config;
};
struct atlantis_clk_divider_config {
u8 shift;
u8 width;
u32 flags;
u32 reg_offset;
};
struct atlantis_clk_divider {
struct atlantis_clk_common common;
struct atlantis_clk_divider_config config;
};
struct atlantis_clk_pll_config {
u32 tbl_num;
u32 reg_offset;
u32 en_reg_offset;
u32 cg_reg_offset;
u32 cg_reg_enable;
};
/* Models a PLL with Bypass Functionality and Enable Bit + an optional Gate Clock at it's output */
struct atlantis_clk_pll {
struct atlantis_clk_common common;
struct atlantis_clk_pll_config config;
};
struct atlantis_clk_gate_shared_config {
u32 reg_offset;
u32 enable;
unsigned int *share_count;
spinlock_t *refcount_lock;
};
struct atlantis_clk_gate_shared {
struct atlantis_clk_common common;
struct atlantis_clk_gate_shared_config config;
};
struct atlantis_clk_fixed_factor_config {
unsigned int mult;
unsigned int div;
};
struct atlantis_clk_fixed_factor {
struct atlantis_clk_fixed_factor_config config;
struct atlantis_clk_common common;
};
static inline struct atlantis_clk_mux *hw_to_atlantis_clk_mux(struct clk_hw *hw)
{
struct atlantis_clk_common *common = hw_to_atlantis_clk_common(hw);
return container_of(common, struct atlantis_clk_mux, common);
}
static inline struct atlantis_clk_gate *
hw_to_atlantis_clk_gate(struct clk_hw *hw)
Annotation
- Immediate include surface: `dt-bindings/clock/tenstorrent,atlantis-prcm-rcpu.h`, `linux/auxiliary_bus.h`, `linux/bitfield.h`, `linux/clk-provider.h`, `linux/platform_device.h`, `linux/regmap.h`, `linux/slab.h`.
- Detected declarations: `struct atlantis_clk_common`, `struct atlantis_clk_mux_config`, `struct atlantis_clk_mux`, `struct atlantis_clk_gate_config`, `struct atlantis_clk_gate`, `struct atlantis_clk_divider_config`, `struct atlantis_clk_divider`, `struct atlantis_clk_pll_config`, `struct atlantis_clk_pll`, `struct atlantis_clk_gate_shared_config`.
- 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.