disp: msm: dsi: add check for DSI resources during display probe

The change adds a check for DSI controller and PHY resources during the
DSI display probe. The validation now only checks for the availabilty
of the resources without increasing the refcount of the controller or
PHY till an exact match is found after the device tree is parsed.

Change-Id: I96a5022a8ab5f55271e0df36675037b597e1ec85
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
Cette révision appartient à :
Satya Rama Aditya Pinapala
2021-04-14 17:44:01 -07:00
Parent 28e834679a
révision 3f8ac6983f
5 fichiers modifiés avec 99 ajouts et 37 suppressions

Voir le fichier

@@ -2204,6 +2204,37 @@ int dsi_ctrl_get_io_resources(struct msm_io_res *io_res)
return rc;
}
/**
* dsi_ctrl_check_resource() - check if DSI controller is probed
* @of_node: of_node of the DSI controller.
*
* Checks if the DSI controller has been probed and is available.
*
* Return: status of DSI controller
*/
bool dsi_ctrl_check_resource(struct device_node *of_node)
{
struct list_head *pos, *tmp;
struct dsi_ctrl *ctrl = NULL;
mutex_lock(&dsi_ctrl_list_lock);
list_for_each_safe(pos, tmp, &dsi_ctrl_list) {
struct dsi_ctrl_list_item *n;
n = list_entry(pos, struct dsi_ctrl_list_item, list);
if (!n->ctrl || !n->ctrl->pdev)
break;
if (n->ctrl->pdev->dev.of_node == of_node) {
ctrl = n->ctrl;
break;
}
}
mutex_unlock(&dsi_ctrl_list_lock);
return ctrl ? true : false;
}
/**
* dsi_ctrl_get() - get a dsi_ctrl handle from an of_node
* @of_node: of_node of the DSI controller.