我是靠谱客的博主 默默超短裙,这篇文章主要介绍从零开始之驱动发开、linux驱动(三十八、Linux common clock framework(3)_实现逻辑分析),现在分享给大家,希望可以做个参考。

1. 前言

前面两篇clock framework的分析文章,分别从clock consumer和clock provider的角度,介绍了Linux kernel怎么管理系统的clock资源,以及device driver怎么使用clock资源。本文将深入到clock framework的内部,分析相关的实现逻辑。

注:本文使用的kernel版本为linux-3.16.57。虽然最新版本的kernel增加了一些内容,但主要逻辑没有改变,就不紧跟kernel的步伐了。

2. struct clk结构

到目前为止,我们还没有仔细介绍过struct clk这个代表了一个clock的数据结构呢。对consumer和provider来说,可以不关心,但对内部实现逻辑来说,就不得不提了:


struct clk {
	const char		*name;
	const struct clk_ops	*ops;
	struct clk_hw		*hw;
	struct module		*owner;
	struct clk		*parent;
	const char		**parent_names;
	struct clk		**parents;
	u8			num_parents;
	u8			new_parent_index;
	unsigned long		rate;
	unsigned long		new_rate;
	struct clk		*new_parent;
	struct c

最后

以上就是默默超短裙最近收集整理的关于从零开始之驱动发开、linux驱动(三十八、Linux common clock framework(3)_实现逻辑分析)的全部内容,更多相关从零开始之驱动发开、linux驱动(三十八、Linux内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(122)

评论列表共有 0 条评论

立即
投稿
返回
顶部