drivers/clk/actions/owl-factor.h
Source file repositories/reference/linux-study-clean/drivers/clk/actions/owl-factor.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/actions/owl-factor.h- Extension
.h- Size
- 2049 bytes
- Lines
- 84
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
owl-common.h
Detected Declarations
struct clk_factor_tablestruct owl_factor_hwstruct owl_factor
Annotated Snippet
struct clk_factor_table {
unsigned int val;
unsigned int mul;
unsigned int div;
};
struct owl_factor_hw {
u32 reg;
u8 shift;
u8 width;
u8 fct_flags;
struct clk_factor_table *table;
};
struct owl_factor {
struct owl_factor_hw factor_hw;
struct owl_clk_common common;
};
#define OWL_FACTOR_HW(_reg, _shift, _width, _fct_flags, _table) \
{ \
.reg = _reg, \
.shift = _shift, \
.width = _width, \
.fct_flags = _fct_flags, \
.table = _table, \
}
#define OWL_FACTOR(_struct, _name, _parent, _reg, \
_shift, _width, _table, _fct_flags, _flags) \
struct owl_factor _struct = { \
.factor_hw = OWL_FACTOR_HW(_reg, _shift, \
_width, _fct_flags, _table), \
.common = { \
.regmap = NULL, \
.hw.init = CLK_HW_INIT(_name, \
_parent, \
&owl_factor_ops, \
_flags), \
}, \
}
#define div_mask(d) ((1 << ((d)->width)) - 1)
static inline struct owl_factor *hw_to_owl_factor(struct clk_hw *hw)
{
struct owl_clk_common *common = hw_to_owl_clk_common(hw);
return container_of(common, struct owl_factor, common);
}
long owl_factor_helper_round_rate(struct owl_clk_common *common,
const struct owl_factor_hw *factor_hw,
unsigned long rate,
unsigned long *parent_rate);
unsigned long owl_factor_helper_recalc_rate(struct owl_clk_common *common,
const struct owl_factor_hw *factor_hw,
unsigned long parent_rate);
int owl_factor_helper_set_rate(const struct owl_clk_common *common,
const struct owl_factor_hw *factor_hw,
unsigned long rate,
unsigned long parent_rate);
extern const struct clk_ops owl_factor_ops;
#endif /* _OWL_FACTOR_H_ */
Annotation
- Immediate include surface: `owl-common.h`.
- Detected declarations: `struct clk_factor_table`, `struct owl_factor_hw`, `struct owl_factor`.
- 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.