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.

Dependency Surface

Detected Declarations

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

Implementation Notes