linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: dispcc-sm6115: Shrink single-parent definitions
@ 2022-12-13 10:43 Konrad Dybcio
  2022-12-13 22:24 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Dybcio @ 2022-12-13 10:43 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	linux-clk, linux-kernel

There's no need to provide both a parent map and a parent data struct when
there's precisely a single parent. Collapse this to save a few bytes.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/clk/qcom/dispcc-sm6115.c | 30 ++++++++----------------------
 1 file changed, 8 insertions(+), 22 deletions(-)

diff --git a/drivers/clk/qcom/dispcc-sm6115.c b/drivers/clk/qcom/dispcc-sm6115.c
index 818bb8f4637c..a6105033ff7e 100644
--- a/drivers/clk/qcom/dispcc-sm6115.c
+++ b/drivers/clk/qcom/dispcc-sm6115.c
@@ -103,14 +103,6 @@ static const struct clk_parent_data disp_cc_parent_data_0[] = {
 	{ .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
 };
 
-static const struct parent_map disp_cc_parent_map_1[] = {
-	{ P_BI_TCXO, 0 },
-};
-
-static const struct clk_parent_data disp_cc_parent_data_1[] = {
-	{ .index = DT_BI_TCXO },
-};
-
 static const struct parent_map disp_cc_parent_map_2[] = {
 	{ P_BI_TCXO, 0 },
 	{ P_GPLL0_OUT_MAIN, 4 },
@@ -141,14 +133,6 @@ static const struct clk_parent_data disp_cc_parent_data_4[] = {
 	{ .index = DT_DSI0_PHY_PLL_OUT_DSICLK },
 };
 
-static const struct parent_map disp_cc_parent_map_5[] = {
-	{ P_SLEEP_CLK, 0 },
-};
-
-static const struct clk_parent_data disp_cc_parent_data_5[] = {
-	{ .index = DT_SLEEP_CLK, },
-};
-
 static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
 	.cmd_rcgr = 0x20bc,
 	.mnd_width = 0,
@@ -284,12 +268,13 @@ static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
 	.cmd_rcgr = 0x20a4,
 	.mnd_width = 0,
 	.hid_width = 5,
-	.parent_map = disp_cc_parent_map_1,
 	.freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src,
 	.clkr.hw.init = &(struct clk_init_data){
 		.name = "disp_cc_mdss_vsync_clk_src",
-		.parent_data = disp_cc_parent_data_1,
-		.num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
+		.parent_data = &(const struct clk_parent_data){
+			.index = DT_BI_TCXO,
+		},
+		.num_parents = 1,
 		.flags = CLK_SET_RATE_PARENT,
 		.ops = &clk_rcg2_shared_ops,
 	},
@@ -304,12 +289,13 @@ static struct clk_rcg2 disp_cc_sleep_clk_src = {
 	.cmd_rcgr = 0x6050,
 	.mnd_width = 0,
 	.hid_width = 5,
-	.parent_map = disp_cc_parent_map_5,
 	.freq_tbl = ftbl_disp_cc_sleep_clk_src,
 	.clkr.hw.init = &(struct clk_init_data){
 		.name = "disp_cc_sleep_clk_src",
-		.parent_data = disp_cc_parent_data_5,
-		.num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
+		.parent_data = &(const struct clk_parent_data){
+			.index = DT_SLEEP_CLK,
+		},
+		.num_parents = 1,
 		.ops = &clk_rcg2_ops,
 	},
 };
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: qcom: dispcc-sm6115: Shrink single-parent definitions
  2022-12-13 10:43 [PATCH] clk: qcom: dispcc-sm6115: Shrink single-parent definitions Konrad Dybcio
@ 2022-12-13 22:24 ` Stephen Boyd
  2022-12-15 12:58   ` Konrad Dybcio
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2022-12-13 22:24 UTC (permalink / raw)
  To: Konrad Dybcio, agross, andersson, krzysztof.kozlowski, linux-arm-msm
  Cc: marijn.suijten, Konrad Dybcio, Michael Turquette, linux-clk,
	linux-kernel

Quoting Konrad Dybcio (2022-12-13 02:43:33)
> @@ -284,12 +268,13 @@ static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
>         .cmd_rcgr = 0x20a4,
>         .mnd_width = 0,
>         .hid_width = 5,
> -       .parent_map = disp_cc_parent_map_1,
>         .freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src,
>         .clkr.hw.init = &(struct clk_init_data){
>                 .name = "disp_cc_mdss_vsync_clk_src",
> -               .parent_data = disp_cc_parent_data_1,
> -               .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
> +               .parent_data = &(const struct clk_parent_data){
> +                       .index = DT_BI_TCXO,
> +               },
> +               .num_parents = 1,
>                 .flags = CLK_SET_RATE_PARENT,
>                 .ops = &clk_rcg2_shared_ops,

Is clk_rcg2_shared_ops and clk_rcg2_ops prepared for a NULL
'parent_map' pointer? _freq_tbl_determine_rate() is never called?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: qcom: dispcc-sm6115: Shrink single-parent definitions
  2022-12-13 22:24 ` Stephen Boyd
@ 2022-12-15 12:58   ` Konrad Dybcio
  0 siblings, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2022-12-15 12:58 UTC (permalink / raw)
  To: Stephen Boyd, agross, andersson, krzysztof.kozlowski, linux-arm-msm
  Cc: marijn.suijten, Michael Turquette, linux-clk, linux-kernel



On 13.12.2022 23:24, Stephen Boyd wrote:
> Quoting Konrad Dybcio (2022-12-13 02:43:33)
>> @@ -284,12 +268,13 @@ static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
>>         .cmd_rcgr = 0x20a4,
>>         .mnd_width = 0,
>>         .hid_width = 5,
>> -       .parent_map = disp_cc_parent_map_1,
>>         .freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src,
>>         .clkr.hw.init = &(struct clk_init_data){
>>                 .name = "disp_cc_mdss_vsync_clk_src",
>> -               .parent_data = disp_cc_parent_data_1,
>> -               .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
>> +               .parent_data = &(const struct clk_parent_data){
>> +                       .index = DT_BI_TCXO,
>> +               },
>> +               .num_parents = 1,
>>                 .flags = CLK_SET_RATE_PARENT,
>>                 .ops = &clk_rcg2_shared_ops,
> 
> Is clk_rcg2_shared_ops and clk_rcg2_ops prepared for a NULL
> 'parent_map' pointer? _freq_tbl_determine_rate() is never called?
I didn't notice any regressions empirically, but perhaps it was
just by luck, you're right, disregard this patch..

Konrad

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-15 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 10:43 [PATCH] clk: qcom: dispcc-sm6115: Shrink single-parent definitions Konrad Dybcio
2022-12-13 22:24 ` Stephen Boyd
2022-12-15 12:58   ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).