大家帮我看看clk_get究竟是怎么实现的。谢谢
linux-2.6.21.5/arch/arm/plat-s3c24xx/clock.c
/* Clock API calls */
struct clk *(struct device *dev, const char *id)
{
struct clk *p;
struct clk *clk = ERR_PTR(-ENOENT);
int idno;
if (dev == NULL || dev->bus != &platform_bus_type)
idno = -1;
else
idno = to_platform_device(dev)->id;
mutex_lock(&clocks_mutex);
list_for_each_entry(p, & clocks, list) {
if (p->id == idno &&
strcmp(id, p->name) == 0 &&
try_module_get(p->owner)) {
clk = p;
break;
}
}
/* check for the case where a device was supplied, but the
* clock that was being searched for is not device specific */
if (IS_ERR(clk)) {
list_for_each_entry(p, &clocks, list) {
if (p->id == -1 && strcmp(id, p->name) == 0 &&
try_module_get(p->owner)) {
clk = p;
break;
}
}
}
mutex_unlock(&clocks_mutex);
return clk;
}
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
prefetch(pos->member.next), &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
说白了define list_for_each_entry 就是一个for循环。。。。
怎么和
struct clk clk_xtal = {
.name = "xtal",
.id = -1,
.rate = 0,
.parent = NULL,
.ctrlbit = 0,
};
这些结构体联系起来的呢???
...全文
相关推荐
clk-periph.rar_V2
clk periph get parent for Linux v2.13.6.
Linux CLK驱动笔记
clk_register首先初始化clk_ops,clk_core_populate_parent_map初这个函数主要是根据parent_num申请了clk_parent_map,则将parent_names[i]字符串赋值给了clk_parent_map的name。clk的parent是在__clk_init_parent的时候被填充的,没有全部填充,先执行get_parent获取index,然后执行clk_core_fill_parent_index填充当前的parent。
clk-cpu.rar_Linux/Unix编程_Unix_Linux_
Marvell MVEBU CPU clock handling for Embedded Linux.
uC-Clk-Manual
uC-Clk-Manual的技术手册
CLK_getltime()函数使用说明
自己把HELP文件翻译了一下,关于CLK_getltime()函数使用说明,希望对大家有帮助


