linux内核对设备树的处理

参考大神的文章

https://blog.csdn.net/ds1130071727/article/details/94842409

 

以下按照执行顺序依次介绍函数功能:

在static int treesum_init(void)函数中:

of_find_node_by_path:通过路径和名称,获取设备树路由器。

of_property_read_string:通过设备路由器和属性名,获取字符串数据。

of_property_count_strings:通过设备路由器和属性名,获取字符串数量。

of_property_read_string_index:通过设备路由器和属性名,以及编号,获取对应的字符串。

of_property_read_u32:通过设备路由器和属性名,获取u32数据。

of_property_read_u32_array:通过设备例程和属性名,获取u32数组。

of_property_read_u8_array:通过设备例程和属性名,获取u8数组。

of_get_child_by_name:通过路径和名称,获取设备树子路由器。

在static int treesum_probe(struct platform_device * pdev)函数中:

device_property_read_string:通过dev和属性名,获取字符串数据。

device_property_read_string_array:通过dev和属性名,获取字符串数组。

device_property_read_u32:通过dev和属性名,获取u32数据。

device_property_read_u32_array:通过dev和属性名,获取u32数组。

device_property_read_u8_array:通过dev和属性名,获取u8数组。

device_for_each_child_node:通过设备中断,遍历子中断。

fwnode_property_read_string:通过fwnode_handle和属性名,获取字符串数据。

fwnode_property_read_string_array:通过fwnode_handle和属性名,获取字符串数组。

fwnode_property_read_u32_array:通过fwnode_handle和属性名,u32数组。

以上函数原型分布在:“ include / linux / property.h”“ linux / gpio / consumer.h”

“ include / linux / of.h”头文件中。

posted @ 2020-04-17 14:28  蒲城小农  阅读(3225)  评论(0)    收藏  举报