diff mbox series

[4/5] clk: qcom: Add support for QDU1000 and QRU1000 RPMh clocks

Message ID 20221001030403.27659-5-quic_molvera@quicinc.com (mailing list archive)
State Superseded
Headers show
Series clk: qcom: Add clocks for the QDU1000 and QRU1000 SoCs | expand

Commit Message

Melody Olvera Oct. 1, 2022, 3:04 a.m. UTC
Add support for RMPh clocks for QDU1000 and QRU1000 SoCs.

Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
---
 drivers/clk/qcom/clk-rpmh.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Dmitry Baryshkov Oct. 1, 2022, 7:03 a.m. UTC | #1
On Sat, 1 Oct 2022 at 06:05, Melody Olvera <quic_molvera@quicinc.com> wrote:
>
> Add support for RMPh clocks for QDU1000 and QRU1000 SoCs.
>
> Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
> ---
>  drivers/clk/qcom/clk-rpmh.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
> index c07cab6905cb..27d11ffac71e 100644
> --- a/drivers/clk/qcom/clk-rpmh.c
> +++ b/drivers/clk/qcom/clk-rpmh.c
> @@ -628,6 +628,18 @@ static const struct clk_rpmh_desc clk_rpmh_sdx65 = {
>         .num_clks = ARRAY_SIZE(sdx65_rpmh_clocks),
>  };
>
> +DEFINE_CLK_RPMH_ARC(qdru1000, bi_tcxo, bi_tcxo_ao, "xo.lvl", 0x3, 1);
> +
> +static struct clk_hw *qdru1000_rpmh_clocks[] = {
> +       [RPMH_CXO_CLK]      = &qdru1000_bi_tcxo.hw,
> +       [RPMH_CXO_CLK_A]    = &qdru1000_bi_tcxo_ao.hw,
> +};
> +
> +static const struct clk_rpmh_desc clk_rpmh_qdru1000 = {
> +       .clks = qdru1000_rpmh_clocks,
> +       .num_clks = ARRAY_SIZE(qdru1000_rpmh_clocks),
> +};
> +
>  static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
>                                          void *data)
>  {
> @@ -723,6 +735,8 @@ static const struct of_device_id clk_rpmh_match_table[] = {
>         { .compatible = "qcom,sm8350-rpmh-clk", .data = &clk_rpmh_sm8350},
>         { .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
>         { .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
> +       { .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdru1000},
> +       { .compatible = "qcom,qru1000-rpmh-clk", .data = &clk_rpmh_qdru1000},

Also the list isn't fully sorted, let's target that. Please move your
compat strings into the beginning.

>         { }
>  };
>  MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);
> --
> 2.37.3
>
Melody Olvera Oct. 3, 2022, 7:40 p.m. UTC | #2
On 10/1/2022 2:03 AM, Dmitry Baryshkov wrote:
> On Sat, 1 Oct 2022 at 06:05, Melody Olvera <quic_molvera@quicinc.com> wrote:
>> Add support for RMPh clocks for QDU1000 and QRU1000 SoCs.
>>
>> Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
>> ---
>>  drivers/clk/qcom/clk-rpmh.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
>> index c07cab6905cb..27d11ffac71e 100644
>> --- a/drivers/clk/qcom/clk-rpmh.c
>> +++ b/drivers/clk/qcom/clk-rpmh.c
>> @@ -628,6 +628,18 @@ static const struct clk_rpmh_desc clk_rpmh_sdx65 = {
>>         .num_clks = ARRAY_SIZE(sdx65_rpmh_clocks),
>>  };
>>
>> +DEFINE_CLK_RPMH_ARC(qdru1000, bi_tcxo, bi_tcxo_ao, "xo.lvl", 0x3, 1);
>> +
>> +static struct clk_hw *qdru1000_rpmh_clocks[] = {
>> +       [RPMH_CXO_CLK]      = &qdru1000_bi_tcxo.hw,
>> +       [RPMH_CXO_CLK_A]    = &qdru1000_bi_tcxo_ao.hw,
>> +};
>> +
>> +static const struct clk_rpmh_desc clk_rpmh_qdru1000 = {
>> +       .clks = qdru1000_rpmh_clocks,
>> +       .num_clks = ARRAY_SIZE(qdru1000_rpmh_clocks),
>> +};
>> +
>>  static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
>>                                          void *data)
>>  {
>> @@ -723,6 +735,8 @@ static const struct of_device_id clk_rpmh_match_table[] = {
>>         { .compatible = "qcom,sm8350-rpmh-clk", .data = &clk_rpmh_sm8350},
>>         { .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
>>         { .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
>> +       { .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdru1000},
>> +       { .compatible = "qcom,qru1000-rpmh-clk", .data = &clk_rpmh_qdru1000},
> Also the list isn't fully sorted, let's target that. Please move your
> compat strings into the beginning.
Sure thing.
>
>>         { }
>>  };
>>  MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);
>> --
>> 2.37.3
>>
Thanks,

Melody
diff mbox series

Patch

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index c07cab6905cb..27d11ffac71e 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -628,6 +628,18 @@  static const struct clk_rpmh_desc clk_rpmh_sdx65 = {
 	.num_clks = ARRAY_SIZE(sdx65_rpmh_clocks),
 };
 
+DEFINE_CLK_RPMH_ARC(qdru1000, bi_tcxo, bi_tcxo_ao, "xo.lvl", 0x3, 1);
+
+static struct clk_hw *qdru1000_rpmh_clocks[] = {
+	[RPMH_CXO_CLK]      = &qdru1000_bi_tcxo.hw,
+	[RPMH_CXO_CLK_A]    = &qdru1000_bi_tcxo_ao.hw,
+};
+
+static const struct clk_rpmh_desc clk_rpmh_qdru1000 = {
+	.clks = qdru1000_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(qdru1000_rpmh_clocks),
+};
+
 static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
 					 void *data)
 {
@@ -723,6 +735,8 @@  static const struct of_device_id clk_rpmh_match_table[] = {
 	{ .compatible = "qcom,sm8350-rpmh-clk", .data = &clk_rpmh_sm8350},
 	{ .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
 	{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
+	{ .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdru1000},
+	{ .compatible = "qcom,qru1000-rpmh-clk", .data = &clk_rpmh_qdru1000},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);