Currently dsi_display_init_dsi() calls dss_pll_enable() but it is not
paired with dss_pll_disable() in dsi_display_uninit_dsi(). This leaves
the DSS clocks enabled when the display is blanked wasting about extra
5mW of power while idle.

Let's fix this by setting a dsi->disconnect_lanes flag and making
the current dsi_pll_uninit() into dsi_pll_disable(). This way we can
just call dss_pll_disable() from dsi_display_uninit_dsi() and the
code becomes a bit easier to follow.

Signed-off-by: Tony Lindgren <t...@atomide.com>
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -339,6 +339,7 @@ struct dsi_data {
        int irq;
 
        bool is_enabled;
+       unsigned int disconnect_lanes:1;
 
        struct clk *dss_clk;
        struct regmap *syscon;
@@ -1382,10 +1383,12 @@ static int dsi_pll_enable(struct dss_pll *pll)
        return r;
 }
 
-static void dsi_pll_uninit(struct dsi_data *dsi, bool disconnect_lanes)
+static void dsi_pll_disable(struct dss_pll *pll)
 {
+       struct dsi_data *dsi = container_of(pll, struct dsi_data, pll);
+
        dsi_pll_power(dsi, DSI_PLL_POWER_OFF);
-       if (disconnect_lanes) {
+       if (dsi->disconnect_lanes) {
                WARN_ON(!dsi->vdds_dsi_enabled);
                regulator_disable(dsi->vdds_dsi_reg);
                dsi->vdds_dsi_enabled = false;
@@ -1397,13 +1400,6 @@ static void dsi_pll_uninit(struct dsi_data *dsi, bool 
disconnect_lanes)
        DSSDBG("PLL uninit done\n");
 }
 
-static void dsi_pll_disable(struct dss_pll *pll)
-{
-       struct dsi_data *dsi = container_of(pll, struct dsi_data, pll);
-
-       dsi_pll_uninit(dsi, true);
-}
-
 static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
 {
        struct dsi_data *dsi = p;
@@ -4158,7 +4154,9 @@ static void dsi_display_uninit_dsi(struct dsi_data *dsi, 
bool disconnect_lanes,
 
        dss_select_dsi_clk_source(dsi->dss, dsi->module_id, DSS_CLK_SRC_FCK);
        dsi_cio_uninit(dsi);
-       dsi_pll_uninit(dsi, disconnect_lanes);
+
+       dsi->disconnect_lanes = disconnect_lanes;
+       dss_pll_disable(&dsi->pll);
 }
 
 static int dsi_display_enable(struct omap_dss_device *dssdev)
-- 
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to