riscv: linux: vout: fix hdmi hibernation resume failure cause by pmic
authorshengyang.chen <shengyang.chen@starfivetech.com>
Mon, 16 Jan 2023 11:45:28 +0000 (19:45 +0800)
committershengyang.chen <shengyang.chen@starfivetech.com>
Mon, 30 Jan 2023 09:56:48 +0000 (17:56 +0800)
fix hdmi hibernation resume failure cause by pmic

Signed-off-by: shengyang.chen<shengyang.chen@starfivetech.com>
drivers/gpu/drm/verisilicon/inno_hdmi.c

index 36c11c1..892ca45 100644 (file)
@@ -163,11 +163,34 @@ static void inno_hdmi_disable_clk_assert_rst(struct device *dev, struct inno_hdm
 #ifdef CONFIG_PM_SLEEP
 static int hdmi_system_pm_suspend(struct device *dev)
 {
-       return pm_runtime_force_suspend(dev);
+       struct inno_hdmi *hdmi = dev_get_drvdata(dev);
+
+       pm_runtime_force_suspend(dev);
+
+       regulator_disable(hdmi->hdmi_1p8);
+       udelay(100);
+       regulator_disable(hdmi->hdmi_0p9);
+       udelay(100);
+       return 0;
 }
 
 static int hdmi_system_pm_resume(struct device *dev)
 {
+       struct inno_hdmi *hdmi = dev_get_drvdata(dev);
+       int ret;
+       //pmic turn on
+       ret = regulator_enable(hdmi->hdmi_1p8);
+       if (ret) {
+               dev_err(dev, "Cannot enable hdmi_1p8 regulator\n");
+               return ret;
+       }
+       udelay(100);
+       ret = regulator_enable(hdmi->hdmi_0p9);
+       if (ret) {
+               dev_err(dev, "Cannot enable hdmi_0p9 regulator\n");
+               return ret;
+       }
+       udelay(100);
        return pm_runtime_force_resume(dev);
 }
 #endif