drivers/clk/spacemit/ccu_common.h

Source file repositories/reference/linux-study-clean/drivers/clk/spacemit/ccu_common.h

File Facts

System
Linux kernel
Corpus path
drivers/clk/spacemit/ccu_common.h
Extension
.h
Size
1140 bytes
Lines
60
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 ccu_common {
	struct regmap *regmap;
	struct regmap *lock_regmap;

	union {
		/* For DDN and MIX */
		struct {
			u32 reg_ctrl;
			u32 reg_fc;
			u32 mask_fc;
		};

		/* For PLL */
		struct {
			u32 reg_swcr1;
			u32 reg_swcr2;
			u32 reg_swcr3;
		};
	};

	struct clk_hw hw;
};

static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw)
{
	return container_of(hw, struct ccu_common, hw);
}

struct spacemit_ccu_data {
	const char *reset_name;
	struct clk_hw **hws;
	size_t num;
};

#define ccu_read(c, reg)						\
	({								\
		u32 tmp;						\
		regmap_read((c)->regmap, (c)->reg_##reg, &tmp);		\
		tmp;							\
	 })
#define ccu_update(c, reg, mask, val) \
	regmap_update_bits((c)->regmap, (c)->reg_##reg, mask, val)

int spacemit_ccu_probe(struct platform_device *pdev, const char *compat);

#endif /* _CCU_COMMON_H_ */

Annotation

Implementation Notes