From 97b6ae50e05c533b6455e304d36bdf2bb5604ee6 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Fri, 12 Feb 2016 14:48:34 +0530 Subject: drm/dsi: Get DSI host by DT device node MIPI DSI devices are inherently aware of their host because they share a parent-child hierarchy in the device tree. Non-DSI drivers that create DSI device don't have this data. In order to get this information, they require to a phandle to the DSI host in the device tree. Maintain a list of all the DSI hosts that are currently registered. This list will be used to find the struct mipi_dsi_host corresponding to the device tree node passed to of_find_mipi_dsi_host_by_node(). Reviewed-by: Andrzej Hajda Signed-off-by: Archit Taneja Signed-off-by: Thierry Reding --- include/drm/drm_mipi_dsi.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/drm/drm_mipi_dsi.h') diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 06e0a9382b35..7a9840f8b38e 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -96,14 +96,17 @@ struct mipi_dsi_host_ops { * struct mipi_dsi_host - DSI host device * @dev: driver model device node for this DSI host * @ops: DSI host operations + * @list: list management */ struct mipi_dsi_host { struct device *dev; const struct mipi_dsi_host_ops *ops; + struct list_head list; }; int mipi_dsi_host_register(struct mipi_dsi_host *host); void mipi_dsi_host_unregister(struct mipi_dsi_host *host); +struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node); /* DSI mode flags */ -- cgit v1.2.3