diff mbox series

[2/3] clk: qcom: videocc-sm8150: Add index based clk lookup

Message ID 20240313-videocc-sm8150-dt-node-v1-2-ae8ec3c822c2@quicinc.com
State New
Headers show
Series Add DT support for video clock controller on SM8150 | expand

Commit Message

Satya Priya Kakitapalli March 13, 2024, 11:08 a.m. UTC
Add support to look up for clocks using index instead of fw_name.

Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
 drivers/clk/qcom/videocc-sm8150.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Satya Priya Kakitapalli March 14, 2024, 9:14 a.m. UTC | #1
On 3/14/2024 12:48 AM, Dmitry Baryshkov wrote:
> On Wed, 13 Mar 2024 at 13:11, Satya Priya Kakitapalli
> <quic_skakitap@quicinc.com> wrote:
>> Add support to look up for clocks using index instead of fw_name.
> Why? You are breaking compatibility with existing bindings.
> Also the commit message is incorrect. You are not _adding_ support.
> You are changing name-based lookup to index-based one.


As per the recent upstream discussions, I see that the clock names is 
not being allowed to use, it is recommended to use the index based 
lookup. Hence I updated this before adding the DT node.

Will update the commit text accordingly.


>> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>> ---
>>   drivers/clk/qcom/videocc-sm8150.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
>> index a0329260157a..2b788a03c5ed 100644
>> --- a/drivers/clk/qcom/videocc-sm8150.c
>> +++ b/drivers/clk/qcom/videocc-sm8150.c
>> @@ -19,6 +19,10 @@
>>   #include "reset.h"
>>   #include "gdsc.h"
>>
>> +enum {
>> +       DT_BI_TCXO,
>> +};
>> +
>>   enum {
>>          P_BI_TCXO,
>>          P_VIDEO_PLL0_OUT_MAIN,
>> @@ -49,7 +53,7 @@ static struct clk_alpha_pll video_pll0 = {
>>                  .hw.init = &(struct clk_init_data){
>>                          .name = "video_pll0",
>>                          .parent_data = &(const struct clk_parent_data){
>> -                               .fw_name = "bi_tcxo",
>> +                               .index = DT_BI_TCXO,
>>                          },
>>                          .num_parents = 1,
>>                          .ops = &clk_alpha_pll_trion_ops,
>> @@ -63,7 +67,7 @@ static const struct parent_map video_cc_parent_map_0[] = {
>>   };
>>
>>   static const struct clk_parent_data video_cc_parent_data_0[] = {
>> -       { .fw_name = "bi_tcxo" },
>> +       { .index = DT_BI_TCXO },
>>          { .hw = &video_pll0.clkr.hw },
>>   };
>>
>>
>> --
>> 2.25.1
>>
>>
>
diff mbox series

Patch

diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
index a0329260157a..2b788a03c5ed 100644
--- a/drivers/clk/qcom/videocc-sm8150.c
+++ b/drivers/clk/qcom/videocc-sm8150.c
@@ -19,6 +19,10 @@ 
 #include "reset.h"
 #include "gdsc.h"
 
+enum {
+	DT_BI_TCXO,
+};
+
 enum {
 	P_BI_TCXO,
 	P_VIDEO_PLL0_OUT_MAIN,
@@ -49,7 +53,7 @@  static struct clk_alpha_pll video_pll0 = {
 		.hw.init = &(struct clk_init_data){
 			.name = "video_pll0",
 			.parent_data = &(const struct clk_parent_data){
-				.fw_name = "bi_tcxo",
+				.index = DT_BI_TCXO,
 			},
 			.num_parents = 1,
 			.ops = &clk_alpha_pll_trion_ops,
@@ -63,7 +67,7 @@  static const struct parent_map video_cc_parent_map_0[] = {
 };
 
 static const struct clk_parent_data video_cc_parent_data_0[] = {
-	{ .fw_name = "bi_tcxo" },
+	{ .index = DT_BI_TCXO },
 	{ .hw = &video_pll0.clkr.hw },
 };