drivers/clk/meson/meson-clkc-utils.h
Source file repositories/reference/linux-study-clean/drivers/clk/meson/meson-clkc-utils.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/meson/meson-clkc-utils.h- Extension
.h- Size
- 3055 bytes
- Lines
- 109
- 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
linux/of_device.hlinux/clk-provider.h
Detected Declarations
struct platform_devicestruct meson_clk_hw_datastruct meson_clkc_data
Annotated Snippet
struct meson_clk_hw_data {
struct clk_hw **hws;
unsigned int num;
};
struct clk_hw *meson_clk_hw_get(struct of_phandle_args *clkspec, void *clk_hw_data);
struct meson_clkc_data {
const struct reg_sequence *init_regs;
unsigned int init_count;
struct meson_clk_hw_data hw_clks;
};
int meson_clkc_syscon_probe(struct platform_device *pdev);
int meson_clkc_mmio_probe(struct platform_device *pdev);
#define __MESON_PCLK(_name, _reg, _bit, _ops, _pdata, _flags) \
struct clk_regmap _name = { \
.data = &(struct clk_regmap_gate_data) { \
.offset = (_reg), \
.bit_idx = (_bit), \
}, \
.hw.init = &(struct clk_init_data) { \
.name = #_name, \
.ops = _ops, \
.parent_data = (_pdata), \
.num_parents = 1, \
.flags = (_flags), \
}, \
}
#define MESON_PCLK(_name, _reg, _bit, _pdata, _flags) \
__MESON_PCLK(_name, _reg, _bit, &clk_regmap_gate_ops, _pdata, _flags)
#define MESON_PCLK_RO(_name, _reg, _bit, _pdata, _flags) \
__MESON_PCLK(_name, _reg, _bit, &clk_regmap_gate_ro_ops, _pdata, _flags)
/* Helpers for the usual sel/div/gate composite clocks */
#define MESON_COMP_SEL(_prefix, _name, _reg, _shift, _mask, _pdata, \
_table, _dflags, _iflags) \
struct clk_regmap _prefix##_name##_sel = { \
.data = &(struct clk_regmap_mux_data) { \
.offset = (_reg), \
.mask = (_mask), \
.shift = (_shift), \
.flags = (_dflags), \
.table = (_table), \
}, \
.hw.init = &(struct clk_init_data){ \
.name = #_name "_sel", \
.ops = &clk_regmap_mux_ops, \
.parent_data = _pdata, \
.num_parents = ARRAY_SIZE(_pdata), \
.flags = (_iflags), \
}, \
}
#define MESON_COMP_DIV(_prefix, _name, _reg, _shift, _width, \
_dflags, _iflags) \
struct clk_regmap _prefix##_name##_div = { \
.data = &(struct clk_regmap_div_data) { \
.offset = (_reg), \
.shift = (_shift), \
.width = (_width), \
.flags = (_dflags), \
}, \
.hw.init = &(struct clk_init_data) { \
.name = #_name "_div", \
.ops = &clk_regmap_divider_ops, \
.parent_hws = (const struct clk_hw *[]) { \
&_prefix##_name##_sel.hw \
}, \
.num_parents = 1, \
.flags = (_iflags), \
}, \
}
#define MESON_COMP_GATE(_prefix, _name, _reg, _bit, _iflags) \
struct clk_regmap _prefix##_name = { \
.data = &(struct clk_regmap_gate_data) { \
.offset = (_reg), \
.bit_idx = (_bit), \
}, \
.hw.init = &(struct clk_init_data) { \
.name = #_name, \
.ops = &clk_regmap_gate_ops, \
.parent_hws = (const struct clk_hw *[]) { \
&_prefix##_name##_div.hw \
}, \
.num_parents = 1, \
Annotation
- Immediate include surface: `linux/of_device.h`, `linux/clk-provider.h`.
- Detected declarations: `struct platform_device`, `struct meson_clk_hw_data`, `struct meson_clkc_data`.
- 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.