drivers/clk/actions/owl-gate.h

Source file repositories/reference/linux-study-clean/drivers/clk/actions/owl-gate.h

File Facts

System
Linux kernel
Corpus path
drivers/clk/actions/owl-gate.h
Extension
.h
Size
1815 bytes
Lines
74
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 owl_gate_hw {
	u32			reg;
	u8			bit_idx;
	u8			gate_flags;
};

struct owl_gate {
	struct owl_gate_hw	gate_hw;
	struct owl_clk_common	common;
};

#define OWL_GATE_HW(_reg, _bit_idx, _gate_flags)	\
	{						\
		.reg		= _reg,			\
		.bit_idx	= _bit_idx,		\
		.gate_flags	= _gate_flags,		\
	}

#define OWL_GATE(_struct, _name, _parent, _reg,				\
		_bit_idx, _gate_flags, _flags)				\
	struct owl_gate _struct = {					\
		.gate_hw = OWL_GATE_HW(_reg, _bit_idx, _gate_flags),	\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT(_name,		\
						      _parent,		\
						      &owl_gate_ops,	\
						      _flags),		\
		}							\
	}								\

#define OWL_GATE_NO_PARENT(_struct, _name, _reg,			\
		_bit_idx, _gate_flags, _flags)				\
	struct owl_gate _struct = {					\
		.gate_hw = OWL_GATE_HW(_reg, _bit_idx, _gate_flags),	\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT_NO_PARENT(_name,	\
						      &owl_gate_ops,	\
						      _flags),		\
		},							\
	}								\

static inline struct owl_gate *hw_to_owl_gate(struct clk_hw *hw)
{
	struct owl_clk_common *common = hw_to_owl_clk_common(hw);

	return container_of(common, struct owl_gate, common);
}

void owl_gate_set(const struct owl_clk_common *common,
		 const struct owl_gate_hw *gate_hw, bool enable);
int owl_gate_clk_is_enabled(const struct owl_clk_common *common,
		   const struct owl_gate_hw *gate_hw);

extern const struct clk_ops owl_gate_ops;

#endif /* _OWL_GATE_H_ */

Annotation

Implementation Notes