]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/omap: dsi: Fix PM for display blank with paired dss_pll calls
authorTony Lindgren <tony@atomide.com>
Thu, 7 Feb 2019 15:45:16 +0000 (07:45 -0800)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 18 Mar 2019 09:42:14 +0000 (11:42 +0200)
commitfe4ed1b457943113ee1138c939fbdeede4af6cf3
tree1e2ecf34f7d5e5beb68a8ae2afd34f686422e40e
parenta0970e87b5d357c8a1ec9c18e128a8d7921c29f9
drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

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.

The clock that is left on by not calling dss_pll_disable() is
DSS_CLKCTRL bit 10 OPTFCLKEN_SYS_CLK that is the source clock for
DSI PLL.

We can fix this issue by by 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.

However, we need to also consider that DSI PLL can be muxed for DVI too
as pointed out by Tomi Valkeinen <tomi.valkeinen@ti.com>. In the DVI
case, we want to unconditionally disable the clocks. To get around this
issue, we separate out the DSI lane handling from dsi_pll_enable() and
dsi_pll_disable() as suggested by Tomi in an earlier experimental patch.

So we must only toggle the DSI regulator based on the vdds_dsi_enabled
flag from dsi_display_init_dsi() and dsi_display_uninit_dsi().

We need to make these two changes together to avoid breaking things
for DVI when fixing the DSI clock handling. And this all causes a
slight renumbering of the error path for dsi_display_init_dsi().

Suggested-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/dss/dsi.c