struct clk_core { const char *name; const struct clk_ops *ops; struct clk_hw *hw; struct module *owner; struct clk_core *parent; const char **parent_names; struct clk_core **parents; u8 num_parents; u8 new_parent_index; unsigned long rate; unsigned long req_rate; unsigned long new_rate; struct clk_core *new_parent; struct clk_core *new_child; unsigned long flags; bool orphan; unsigned int enable_count; unsigned int prepare_count; unsigned long min_rate; unsigned long max_rate; unsigned long accuracy; int phase; struct hlist_head children; struct hlist_node child_node; struct hlist_head clks; unsigned int notifier_count; #ifdef CONFIG_DEBUG_FS struct dentry *dentry; struct hlist_node debug_node; #endif struct kref ref; };
驱动实现 私有数据块 clk框架层实现,接口 clk_register clk_priv | |________struct clk_hw | core |----------------------------------------------->struct clk_core |------| |name | | clk |-------------------------->struct clk____ |ops | |------| | core | |hw | | init | | dev_id | |owner | |_____ |-->_____________________ | con_id | |parent | | name | |min_rate | |parent_names | |--------------------- |max_rate | |parents | 驱动<------------- |struct clk_ops *ops | |clks_node | | | 实现 |--------------------- |------------ |---------------- | parent_names | |--------------------- | num_parents | |--------------------- | flags | ----------------------