Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 679f9218 authored by Chaithrika U S's avatar Chaithrika U S Committed by Kevin Hilman
Browse files

davinci: clock: Check CLK_PSC flag before disabling PSC



Some modules do not have PSC to control their clocks.
The 'lpsc' field in the clk structure is 0 for such clocks.

In the clock disable function check for CLK PSC flag before
disabling the PSC. If this is not taken care of then it may
so happen that module controlled by LPSC 0 is erroneously disabled.

Signed-off-by: default avatarChaithrika U S <chaithrika@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent ad021ae8
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -49,7 +49,8 @@ static void __clk_disable(struct clk *clk)
{
{
	if (WARN_ON(clk->usecount == 0))
	if (WARN_ON(clk->usecount == 0))
		return;
		return;
	if (--clk->usecount == 0 && !(clk->flags & CLK_PLL))
	if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
	    (clk->flags & CLK_PSC))
		davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 0);
		davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 0);
	if (clk->parent)
	if (clk->parent)
		__clk_disable(clk->parent);
		__clk_disable(clk->parent);