Skip to content

Commit

Permalink
clk: qcom: gdsc: Don't override existing gdsc pd functions
Browse files Browse the repository at this point in the history
In extreme cases an individual gdsc may wish to override the
power domain enable or disable callback functions for their own
purposes. Only set the generic gdsc callback if the function pointers
are not already set.

Acked-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Jordan Crouse authored and Stephen Boyd committed Nov 28, 2018
1 parent 453361c commit 7895861
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/clk/qcom/gdsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,10 @@ static int gdsc_init(struct gdsc *sc)
else
gdsc_clear_mem_on(sc);

sc->pd.power_off = gdsc_disable;
sc->pd.power_on = gdsc_enable;
if (!sc->pd.power_off)
sc->pd.power_off = gdsc_disable;
if (!sc->pd.power_on)
sc->pd.power_on = gdsc_enable;
pm_genpd_init(&sc->pd, NULL, !on);

return 0;
Expand Down

0 comments on commit 7895861

Please sign in to comment.