[2/4] clk: qcom: gdsc: Don't override existing gdsc pd functions

Submitted by Jordan Crouse on Nov. 19, 2018, 11:47 p.m.

Details

Message ID 20181119234706.5821-3-jcrouse@codeaurora.org
State New
Headers show
Series "msm: clk: Define a special power domain for SDM845 GX" ( rev: 1 ) in Freedreno

Not browsing as part of any series.

Commit Message

Jordan Crouse Nov. 19, 2018, 11:47 p.m.
In very 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.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 drivers/clk/qcom/gdsc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
index b6adca1f3918..7b55368b9a9c 100644
--- a/drivers/clk/qcom/gdsc.c
+++ b/drivers/clk/qcom/gdsc.c
@@ -394,8 +394,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;

Comments

On 11/20/2018 5:17 AM, Jordan Crouse wrote:
> In very 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.
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Looks good to me,
Acked-by: Rajendra Nayak <rnayak@codeaurora.org>

> ---
>   drivers/clk/qcom/gdsc.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index b6adca1f3918..7b55368b9a9c 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -394,8 +394,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;
>