Merge "msm: mdss: shutoff axi memory and periphery when axi clk is off"

This commit is contained in:
Linux Build Service Account 2016-08-18 12:04:24 -07:00 committed by Gerrit - the friendly Code Review server
commit 2c2b895deb

View file

@ -1453,6 +1453,35 @@ end:
return rc;
}
/**
* mdss_mdp_retention_init() - initialize retention setting
* @mdata: pointer to the global mdss data structure.
*/
static int mdss_mdp_retention_init(struct mdss_data_type *mdata)
{
struct clk *mdss_axi_clk = mdss_mdp_get_clk(MDSS_CLK_AXI);
int rc;
if (!mdss_axi_clk) {
pr_err("failed to get AXI clock\n");
return -EINVAL;
}
rc = clk_set_flags(mdss_axi_clk, CLKFLAG_NORETAIN_MEM);
if (rc) {
pr_err("failed to set AXI no memory retention %d\n", rc);
return rc;
}
rc = clk_set_flags(mdss_axi_clk, CLKFLAG_NORETAIN_PERIPH);
if (rc) {
pr_err("failed to set AXI no periphery retention %d\n", rc);
return rc;
}
return rc;
}
/**
* mdss_bus_bandwidth_ctrl() -- place bus bandwidth request
* @enable: value of enable or disable
@ -2735,6 +2764,12 @@ static int mdss_mdp_probe(struct platform_device *pdev)
goto probe_done;
}
rc = mdss_mdp_retention_init(mdata);
if (rc) {
pr_err("unable to initialize mdss mdp retention\n");
goto probe_done;
}
pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT_MS);
if (mdata->idle_pc_enabled)
pm_runtime_use_autosuspend(&pdev->dev);