diff mbox series

[v2,3/3] clk: qcom: clk-rpmh: Add support for RPMHCC for SC7180

Message ID 1572371299-16774-4-git-send-email-tdas@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series Add support for RPMHCC for SC7180 | expand

Commit Message

Taniya Das Oct. 29, 2019, 5:48 p.m. UTC
Add support for clock RPMh driver to vote for ARC and VRM managed
clock resources.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
---
 drivers/clk/qcom/clk-rpmh.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the  Linux Foundation.

Comments

Stephen Boyd Nov. 7, 2019, 9:13 p.m. UTC | #1
Quoting Taniya Das (2019-10-29 10:48:19)
> Add support for clock RPMh driver to vote for ARC and VRM managed
> clock resources.
> 
> Signed-off-by: Taniya Das <tdas@codeaurora.org>
> ---
>  drivers/clk/qcom/clk-rpmh.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
> index 20d4258..3f3e08b 100644
> --- a/drivers/clk/qcom/clk-rpmh.c
> +++ b/drivers/clk/qcom/clk-rpmh.c
> @@ -391,6 +391,24 @@ static const struct clk_rpmh_desc clk_rpmh_sm8150 = {
>         .num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),
>  };
> 
> +static struct clk_hw *sc7180_rpmh_clocks[] = {

I don't think we need to duplicate this array either, unless somehow
this driver is running on two different SoCs which seems highly
unlikely.

> +       [RPMH_CXO_CLK]          = &sdm845_bi_tcxo.hw,
> +       [RPMH_CXO_CLK_A]        = &sdm845_bi_tcxo_ao.hw,
> +       [RPMH_LN_BB_CLK2]       = &sdm845_ln_bb_clk2.hw,
> +       [RPMH_LN_BB_CLK2_A]     = &sdm845_ln_bb_clk2_ao.hw,
> +       [RPMH_LN_BB_CLK3]       = &sdm845_ln_bb_clk3.hw,
> +       [RPMH_LN_BB_CLK3_A]     = &sdm845_ln_bb_clk3_ao.hw,
> +       [RPMH_RF_CLK1]          = &sdm845_rf_clk1.hw,
> +       [RPMH_RF_CLK1_A]        = &sdm845_rf_clk1_ao.hw,
> +       [RPMH_RF_CLK2]          = &sdm845_rf_clk2.hw,
> +       [RPMH_RF_CLK2_A]        = &sdm845_rf_clk2_ao.hw,
> +};
> +
> +static const struct clk_rpmh_desc clk_rpmh_sc7180 = {
> +       .clks = sc7180_rpmh_clocks,
> +       .num_clks = ARRAY_SIZE(sc7180_rpmh_clocks),
> +};
> +
>  static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
>                                          void *data)
>  {
> @@ -471,6 +489,7 @@ static int clk_rpmh_probe(struct platform_device *pdev)
>  static const struct of_device_id clk_rpmh_match_table[] = {
>         { .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
>         { .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},
> +       { .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
>         { }
>  };
>  MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);
Stephen Boyd Nov. 7, 2019, 9:19 p.m. UTC | #2
Quoting Stephen Boyd (2019-11-07 13:13:53)
> Quoting Taniya Das (2019-10-29 10:48:19)
> > Add support for clock RPMh driver to vote for ARC and VRM managed
> > clock resources.
> > 
> > Signed-off-by: Taniya Das <tdas@codeaurora.org>
> > ---
> >  drivers/clk/qcom/clk-rpmh.c | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
> > index 20d4258..3f3e08b 100644
> > --- a/drivers/clk/qcom/clk-rpmh.c
> > +++ b/drivers/clk/qcom/clk-rpmh.c
> > @@ -391,6 +391,24 @@ static const struct clk_rpmh_desc clk_rpmh_sm8150 = {
> >         .num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),
> >  };
> > 
> > +static struct clk_hw *sc7180_rpmh_clocks[] = {
> 
> I don't think we need to duplicate this array either, unless somehow
> this driver is running on two different SoCs which seems highly
> unlikely.
> 

Ah but we don't have IPA clk or RF_CLK3 on sc7180. Alright this can be
revisited later.
Stephen Boyd Nov. 7, 2019, 9:24 p.m. UTC | #3
Quoting Taniya Das (2019-10-29 10:48:19)
> Add support for clock RPMh driver to vote for ARC and VRM managed
> clock resources.
> 
> Signed-off-by: Taniya Das <tdas@codeaurora.org>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index 20d4258..3f3e08b 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -391,6 +391,24 @@  static const struct clk_rpmh_desc clk_rpmh_sm8150 = {
 	.num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),
 };

+static struct clk_hw *sc7180_rpmh_clocks[] = {
+	[RPMH_CXO_CLK]		= &sdm845_bi_tcxo.hw,
+	[RPMH_CXO_CLK_A]	= &sdm845_bi_tcxo_ao.hw,
+	[RPMH_LN_BB_CLK2]	= &sdm845_ln_bb_clk2.hw,
+	[RPMH_LN_BB_CLK2_A]	= &sdm845_ln_bb_clk2_ao.hw,
+	[RPMH_LN_BB_CLK3]	= &sdm845_ln_bb_clk3.hw,
+	[RPMH_LN_BB_CLK3_A]	= &sdm845_ln_bb_clk3_ao.hw,
+	[RPMH_RF_CLK1]		= &sdm845_rf_clk1.hw,
+	[RPMH_RF_CLK1_A]	= &sdm845_rf_clk1_ao.hw,
+	[RPMH_RF_CLK2]		= &sdm845_rf_clk2.hw,
+	[RPMH_RF_CLK2_A]	= &sdm845_rf_clk2_ao.hw,
+};
+
+static const struct clk_rpmh_desc clk_rpmh_sc7180 = {
+	.clks = sc7180_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(sc7180_rpmh_clocks),
+};
+
 static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
 					 void *data)
 {
@@ -471,6 +489,7 @@  static int clk_rpmh_probe(struct platform_device *pdev)
 static const struct of_device_id clk_rpmh_match_table[] = {
 	{ .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
 	{ .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},
+	{ .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);