我有兴趣从设备树的父节点向子节点传递一些数据(在运行时动态创建)。举例来说,我在设备树下面的条目:(?正确的)linux内核设备从父到子数据树传递数据
parent_node {
a-string-property = "A string";
a-string-list-property = "first string", "second string";
a-byte-data-property = [0x01 0x23 0x34 0x56];
child-node1 {
first-child-property;
second-child-property = <1>;
a-string-property = "Hello, world";
};
child-node2 {
some_data ;
};
};
据我所知,你不能在运行时创建的设备树节点的/更新属性。
那么,有没有一种机制来传递父节点和子节点(可能通过struct bus_type
,struct device
或 struct device_driver
)之间的数据?
此数据传递的最终目的是为设备的内存映射(子节点)的地址转换提供偏移量。
你有没有“父节点和子节点之间*通数据*”的例子吗? – sergej
如果我有一个例子,我不会问:) – user426639
“从父母到孩子传递数据”太含糊。有很多方法可以传递数据。你能更具体些吗?你在说什么子系统(时钟,声音......)?请描述用例。 – sergej