linux设备树:phandle和port
参考文档:
https://elixir.bootlin.com/linux/v5.10.209/source/Documentation/devicetree/bindings/graph.txt
https://elixir.bootlin.com/linux/v6.8-rc5/source/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml
https://elixir.bootlin.com/linux/v6.8-rc5/source/Documentation/devicetree/bindings/media/video-interfaces.yaml
phandle:用于设备树上,描述任意设备节点都可以进行关联的有向图。
port:用于设备树上,描述有父子关系节点的有向图。
There already is a simple directed graph between devices tree nodes using
phandle properties pointing to other nodes to describe connections that
can not be inferred from device tree parent-child relationships.
设备树节点之间已经有一个简单的有向图,使用指向其他节点的phandle属性,用于描述无法从设备树父子关系中推断出的连接。
of_graph.h
drivers/of/property.c
bool of_graph_is_present(const struct device_node *node)
{
struct device_node *ports, *port;
ports = of_get_child_by_name(node, "ports");
if (ports)
node = ports;
port = of_get_child_by_name(node, "port");
of_node_put(ports);
of_node_put(port);
return !!port;
}
drm_of.c
dw-mipi-dsi2-rockchip.c
drm_of_find_panel_or_bridge() -> of_graph_is_present()
devcie-1的device_1_output输出端口,连接到device-2的device_2_input输入端口上。
device-2的device_2_input输入端口,连接到devcie-1的device_1_output输出端口上。