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:
@@ -4008,35 +4008,27 @@ end:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int dsi_display_validate_res(struct dsi_display *display)
|
||||
static bool dsi_display_validate_res(struct dsi_display *display)
|
||||
{
|
||||
struct device_node *of_node = display->pdev->dev.of_node;
|
||||
struct of_phandle_iterator it;
|
||||
struct dsi_ctrl *dsi_ctrl;
|
||||
bool ctrl_avail = false;
|
||||
bool phy_avail = false;
|
||||
|
||||
/*
|
||||
* At least if one of the controller or PHY is present or has been probed, the
|
||||
* dsi_display_dev_probe can pass this check. Exact ctrl and PHY match will be
|
||||
* done after the DT is parsed.
|
||||
*/
|
||||
of_phandle_iterator_init(&it, of_node, "qcom,dsi-ctrl", NULL, 0);
|
||||
while (of_phandle_iterator_next(&it) == 0) {
|
||||
dsi_ctrl = dsi_ctrl_get(it.node);
|
||||
if (IS_ERR(dsi_ctrl)) {
|
||||
int rc = PTR_ERR(dsi_ctrl);
|
||||
while (of_phandle_iterator_next(&it) == 0)
|
||||
ctrl_avail |= dsi_ctrl_check_resource(it.node);
|
||||
|
||||
if (rc == -EPROBE_DEFER)
|
||||
return rc;
|
||||
/*
|
||||
* With dual display mode, the seconday display needs at least
|
||||
* one ctrl to proceed through the probe. Exact ctrl match
|
||||
* will be done after parsing the DT or firmware data.
|
||||
*/
|
||||
if (rc == -EBUSY)
|
||||
ctrl_avail |= false;
|
||||
} else {
|
||||
dsi_ctrl_put(dsi_ctrl);
|
||||
ctrl_avail = true;
|
||||
}
|
||||
}
|
||||
of_phandle_iterator_init(&it, of_node, "qcom,dsi-phy", NULL, 0);
|
||||
while (of_phandle_iterator_next(&it) == 0)
|
||||
phy_avail |= dsi_phy_check_resource(it.node);
|
||||
|
||||
return ctrl_avail ? 0 : -EBUSY;
|
||||
return (ctrl_avail & phy_avail);
|
||||
}
|
||||
|
||||
static int dsi_display_get_phandle_count(struct dsi_display *display,
|
||||
@@ -5902,22 +5894,9 @@ int dsi_display_dev_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, display);
|
||||
|
||||
rc = dsi_display_validate_res(display);
|
||||
if (rc) {
|
||||
/*
|
||||
* Display's bailing out without probe deferral must register its
|
||||
* components to complete MDSS binding. Scheduled to be fixed in the future
|
||||
* with dynamic component binding.
|
||||
*/
|
||||
if (rc == -EBUSY) {
|
||||
int ret = component_add(&pdev->dev,
|
||||
&dsi_display_comp_ops);
|
||||
if (ret)
|
||||
DSI_ERR(
|
||||
"component add failed for display type: %s, rc=%d\n"
|
||||
, display->type, ret);
|
||||
}
|
||||
|
||||
if (!dsi_display_validate_res(display)) {
|
||||
rc = -EPROBE_DEFER;
|
||||
DSI_ERR("resources required for display probe not present: rc=%d\n", rc);
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
Viittaa uudesa ongelmassa
Block a user