drivers/clk/rockchip/clk.h
Source file repositories/reference/linux-study-clean/drivers/clk/rockchip/clk.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/rockchip/clk.h- Extension
.h- Size
- 48334 bytes
- Lines
- 1400
- 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/io.hlinux/clk-provider.hlinux/hashtable.h
Detected Declarations
struct clkstruct rockchip_aux_grfstruct rockchip_clk_providerstruct rockchip_pll_rate_tablestruct rockchip_pll_clockstruct rockchip_cpuclk_clkselstruct rockchip_cpuclk_rate_tablestruct rockchip_cpuclk_reg_datastruct rockchip_clk_branchstruct rockchip_gate_link_platdataenum rockchip_pll_typeenum rockchip_grf_typeenum rockchip_clk_branch_typefunction FACTORfunction rockchip_clk_set_lookupfunction rockchip_register_softrst_lut
Annotated Snippet
struct rockchip_aux_grf {
struct regmap *grf;
enum rockchip_grf_type type;
struct hlist_node node;
};
/**
* struct rockchip_clk_provider - information about clock provider
* @reg_base: virtual address for the register base.
* @clk_data: holds clock related data like clk* and number of clocks.
* @cru_node: device-node of the clock-provider
* @grf: regmap of the general-register-files syscon
* @aux_grf_table: hashtable of auxiliary GRF regmaps, indexed by grf_type
* @lock: maintains exclusion between callbacks for a given clock-provider.
*/
struct rockchip_clk_provider {
void __iomem *reg_base;
struct clk_onecell_data clk_data;
struct device_node *cru_node;
struct regmap *grf;
DECLARE_HASHTABLE(aux_grf_table, GRF_HASH_ORDER);
spinlock_t lock;
};
struct rockchip_pll_rate_table {
unsigned long rate;
union {
struct {
/* for RK3066 */
unsigned int nr;
unsigned int nf;
unsigned int no;
unsigned int nb;
};
struct {
/* for RK3036/RK3399 */
unsigned int fbdiv;
unsigned int postdiv1;
unsigned int refdiv;
unsigned int postdiv2;
unsigned int dsmpd;
unsigned int frac;
};
struct {
/* for RK3588 */
unsigned int m;
unsigned int p;
unsigned int s;
unsigned int k;
};
};
};
/**
* struct rockchip_pll_clock - information about pll clock
* @id: platform specific id of the clock.
* @name: name of this pll clock.
* @parent_names: name of the parent clock.
* @num_parents: number of parents
* @flags: optional flags for basic clock.
* @con_offset: offset of the register for configuring the PLL.
* @mode_offset: offset of the register for configuring the PLL-mode.
* @mode_shift: offset inside the mode-register for the mode of this pll.
* @lock_shift: offset inside the lock register for the lock status.
* @type: Type of PLL to be registered.
* @pll_flags: hardware-specific flags
* @rate_table: Table of usable pll rates
*
* Flags:
* ROCKCHIP_PLL_SYNC_RATE - check rate parameters to match against the
* rate_table parameters and adjust them if necessary.
* ROCKCHIP_PLL_FIXED_MODE - the pll operates in normal mode only
*/
struct rockchip_pll_clock {
unsigned int id;
const char *name;
const char *const *parent_names;
u8 num_parents;
unsigned long flags;
int con_offset;
int mode_offset;
int mode_shift;
int lock_shift;
enum rockchip_pll_type type;
u8 pll_flags;
struct rockchip_pll_rate_table *rate_table;
};
#define ROCKCHIP_PLL_SYNC_RATE BIT(0)
#define ROCKCHIP_PLL_FIXED_MODE BIT(1)
Annotation
- Immediate include surface: `linux/io.h`, `linux/clk-provider.h`, `linux/hashtable.h`.
- Detected declarations: `struct clk`, `struct rockchip_aux_grf`, `struct rockchip_clk_provider`, `struct rockchip_pll_rate_table`, `struct rockchip_pll_clock`, `struct rockchip_cpuclk_clksel`, `struct rockchip_cpuclk_rate_table`, `struct rockchip_cpuclk_reg_data`, `struct rockchip_clk_branch`, `struct rockchip_gate_link_platdata`.
- 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.