Skip to content
Snippets Groups Projects
Commit e8a7398d authored by Oliver Brown's avatar Oliver Brown
Browse files

MLK-25340-1: drm: imx: hdp: Added power off function


The power off need to be handled for the remove case so the
clock enable counts are correct.

Signed-off-by: default avatarOliver Brown <oliver.brown@nxp.com>
parent b6181a1a
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ int cdns_mhdp_firmware_init_imx8qm(struct cdns_mhdp_device *mhdp);
int cdns_mhdp_resume_imx8qm(struct cdns_mhdp_device *mhdp);
int cdns_mhdp_suspend_imx8qm(struct cdns_mhdp_device *mhdp);
int cdns_mhdp_power_on_imx8qm(struct cdns_mhdp_device *mhdp);
int cdns_mhdp_power_off_imx8qm(struct cdns_mhdp_device *mhdp);
int cdns_mhdp_power_on_ls1028a(struct cdns_mhdp_device *mhdp);
void cdns_mhdp_pclk_rate_ls1028a(struct cdns_mhdp_device *mhdp);
#endif /* CDNS_MHDP_IMX_H_ */
......@@ -373,6 +373,65 @@ static int imx8qm_ipg_clk_enable(struct imx_mhdp_device *imx_mhdp)
return ret;
}
static int imx8qm_ipg_clk_disable(struct imx_mhdp_device *imx_mhdp)
{
int ret;
struct imx_hdp_clks *clks = &imx_mhdp->clks;
struct device *dev = imx_mhdp->mhdp.dev;
ret = clk_prepare_enable(clks->clk_i2s_bypass);
if (ret < 0) {
dev_err(dev, "%s, pre clk i2s bypass error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->lpcg_i2s);
if (ret < 0) {
dev_err(dev, "%s, pre clk i2s error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->lpcg_apb_ctrl);
if (ret < 0) {
dev_err(dev, "%s, pre clk apb ctrl error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->lpcg_apb_csr);
if (ret < 0) {
dev_err(dev, "%s, pre clk apb csr error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->lpcg_msi);
if (ret < 0) {
dev_err(dev, "%s, pre clk msierror\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->lpcg_lis);
if (ret < 0) {
dev_err(dev, "%s, pre clk lis error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->lpcg_apb);
if (ret < 0) {
dev_err(dev, "%s, pre clk apb error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->clk_core);
if (ret < 0) {
dev_err(dev, "%s, pre clk core error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->clk_ipg);
if (ret < 0) {
dev_err(dev, "%s, pre clk_ipg error\n", __func__);
return ret;
}
ret = clk_prepare_enable(clks->dig_pll);
if (ret < 0) {
dev_err(dev, "%s, pre dig pll error\n", __func__);
return ret;
}
return ret;
}
static void imx8qm_ipg_clk_set_rate(struct imx_mhdp_device *imx_mhdp)
{
struct imx_hdp_clks *clks = &imx_mhdp->clks;
......@@ -464,6 +523,7 @@ int cdns_mhdp_power_on_imx8qm(struct cdns_mhdp_device *mhdp)
{
struct imx_mhdp_device *imx_mhdp =
container_of(mhdp, struct imx_mhdp_device, mhdp);
/* Power on PM Domains */
imx8qm_attach_pm_domains(imx_mhdp);
......@@ -487,6 +547,21 @@ int cdns_mhdp_power_on_imx8qm(struct cdns_mhdp_device *mhdp)
return 0;
}
int cdns_mhdp_power_off_imx8qm(struct cdns_mhdp_device *mhdp)
{
struct imx_mhdp_device *imx_mhdp =
container_of(mhdp, struct imx_mhdp_device, mhdp);
imx8qm_phy_reset(0);
imx8qm_pixel_clk_disable(imx_mhdp);
imx8qm_ipg_clk_disable(imx_mhdp);
/* Power off PM Domains */
imx8qm_detach_pm_domains(imx_mhdp);
return 0;
}
void cdns_mhdp_plat_init_imx8qm(struct cdns_mhdp_device *mhdp)
{
struct imx_mhdp_device *imx_mhdp =
......
......@@ -82,6 +82,7 @@ static struct cdns_plat_data imx8qm_hdmi_drv_data = {
.phy_set = cdns_hdmi_phy_set_imx8qm,
.phy_video_valid = cdns_hdmi_phy_video_valid_imx8qm,
.power_on = cdns_mhdp_power_on_imx8qm,
.power_off = cdns_mhdp_power_off_imx8qm,
.firmware_init = cdns_mhdp_firmware_init_imx8qm,
.resume = cdns_mhdp_resume_imx8qm,
.suspend = cdns_mhdp_suspend_imx8qm,
......@@ -98,6 +99,7 @@ static struct cdns_plat_data imx8qm_dp_drv_data = {
.unbind = cdns_dp_unbind,
.phy_set = cdns_dp_phy_set_imx8qm,
.power_on = cdns_mhdp_power_on_imx8qm,
.power_off = cdns_mhdp_power_off_imx8qm,
.firmware_init = cdns_mhdp_firmware_init_imx8qm,
.resume = cdns_mhdp_resume_imx8qm,
.suspend = cdns_mhdp_suspend_imx8qm,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment