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>
This commit is contained in:
Satya Rama Aditya Pinapala
2021-04-14 17:44:01 -07:00
parent 28e834679a
commit 3f8ac6983f
5 changed files with 99 additions and 37 deletions

View File

@@ -579,6 +579,38 @@ static void dsi_phy_disable_hw(struct msm_dsi_phy *phy)
phy->hw.ops.regulator_disable(&phy->hw);
}
/**
* dsi_phy_check_resource() - check if DSI PHY is probed
* @of_node: of_node of the DSI PHY.
*
* Checks if the DSI PHY has been probed and is available.
*
* Return: status of DSI PHY
*/
bool dsi_phy_check_resource(struct device_node *of_node)
{
struct list_head *pos, *tmp;
struct msm_dsi_phy *phy = NULL;
mutex_lock(&dsi_phy_list_lock);
list_for_each_safe(pos, tmp, &dsi_phy_list) {
struct dsi_phy_list_item *n;
n = list_entry(pos, struct dsi_phy_list_item, list);
if (!n->phy || !n->phy->pdev)
break;
if (n->phy->pdev->dev.of_node == of_node) {
phy = n->phy;
break;
}
}
mutex_unlock(&dsi_phy_list_lock);
return phy ? true : false;
}
/**
* dsi_phy_get() - get a dsi phy handle from device node
* @of_node: device node for dsi phy controller