All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Chuan Liu <chuan.liu@amlogic.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	 Kevin Hilman <khilman@baylibre.com>,
	 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	 linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 12/26] clk: amlogic: s4-peripherals: naming consistency alignment
Date: Thu, 03 Jul 2025 09:54:34 +0200	[thread overview]
Message-ID: <1jsejdd805.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <a7738c67-25fc-4919-bee8-69a72abb4871@amlogic.com> (Chuan Liu's message of "Thu, 3 Jul 2025 11:18:04 +0800")

On Thu 03 Jul 2025 at 11:18, Chuan Liu <chuan.liu@amlogic.com> wrote:

> Hi Jerome:
>
>
> On 7/2/2025 11:26 PM, Jerome Brunet wrote:
>> [ EXTERNAL EMAIL ]
>>
>> Amlogic clock controller drivers are all doing the same thing, more or
>> less. Yet, over the years, tiny (and often pointless) differences have
>> emerged.
>>
>> This makes reviews more difficult, allows some errors to slip through and
>> make it more difficult to exploit SoC commonalities, leading to code
>> duplication.
>>
>> This change enforce, wherever possible, a consistent and predictable scheme
>> when it comes to code organisation and naming, The scheme chosen is what
>> was used the most already, to try and minimise the size of the ugly
>> resulting diff. Here are some of the rules applied:
>> - Aligning clock names, variable names and IDs.
>>    - ID cannot change (used in DT)
>>    - Variable names w/ SoC name prefixes
>>    - Clock names w/o SoC name prefixes, except pclks for historic reasons
>> - Composite clock systematic naming : mux: X_sel, div:X_div, gate:X
>> - Parent table systematically named with the same name as the clock and
>>    a '_parents' suffix
>> - Group various tables next to the related clock
>> - etc ...
>>
>> Doing so removes what would otherwise show up as unrelated diff in
>> following changes. It will allow to introduce common definitions for
>> peripheral clocks, probe helpers, composite clocks, etc ... making further
>> review and maintenance easier.
>>
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>   drivers/clk/meson/s4-peripherals.c | 746 ++++++++++++++++++-------------------
>>   1 file changed, 370 insertions(+), 376 deletions(-)
>>
>> diff --git a/drivers/clk/meson/s4-peripherals.c b/drivers/clk/meson/s4-peripherals.c
>> index c9400cf54c84c3dc7c63d0636933951b0cac230c..9bcd35f12836de5e318fd1ad9c9ae15a2bfc3dd7 100644
>> --- a/drivers/clk/meson/s4-peripherals.c
>> +++ b/drivers/clk/meson/s4-peripherals.c
>
>
> [...]
>
>
>> @@ -1320,7 +1320,7 @@ static struct clk_regmap s4_ts_clk_gate = {
>>    * mux because it does top-to-bottom updates the each clock tree and
>>    * switches to the "inactive" one when CLK_SET_RATE_GATE is set.
>>    */
>> -static const struct clk_parent_data s4_mali_0_1_parent_data[] = {
>> +static const struct clk_parent_data s4_mali_parents[] = {
>>          { .fw_name = "xtal", },
>>          { .fw_name = "gp0_pll", },
>>          { .fw_name = "hifi_pll", },
>> @@ -1340,8 +1340,8 @@ static struct clk_regmap s4_mali_0_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "mali_0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_mali_0_1_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_mali_0_1_parent_data),
>> +               .parent_data = s4_mali_parents,
>> +               .num_parents = ARRAY_SIZE(s4_mali_parents),
>>                  /*
>>                   * Don't request the parent to change the rate because
>>                   * all GPU frequencies can be derived from the fclk_*
>> @@ -1394,8 +1394,8 @@ static struct clk_regmap s4_mali_1_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "mali_1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_mali_0_1_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_mali_0_1_parent_data),
>> +               .parent_data = s4_mali_parents,
>> +               .num_parents = ARRAY_SIZE(s4_mali_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1433,28 +1433,26 @@ static struct clk_regmap s4_mali_1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_mali_parent_hws[] = {
>> -       &s4_mali_0.hw,
>> -       &s4_mali_1.hw
>> -};
>> -
>> -static struct clk_regmap s4_mali_mux = {
>> +static struct clk_regmap s4_mali_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_MALI_CLK_CTRL,
>>                  .mask = 1,
>>                  .shift = 31,
>>          },
>>          .hw.init = &(struct clk_init_data){
>> -               .name = "mali",
>> +               .name = "mali_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_mali_parent_hws,
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_mali_0.hw,
>> +                       &s4_mali_1.hw,
>> +               },
>>                  .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>>
>>   /* VDEC clocks */
>> -static const struct clk_parent_data s4_dec_parent_data[] = {
>> +static const struct clk_parent_data s4_dec_parents[] = {
>>          { .fw_name = "fclk_div2p5", },
>>          { .fw_name = "fclk_div3", },
>>          { .fw_name = "fclk_div4", },
>> @@ -1465,7 +1463,7 @@ static const struct clk_parent_data s4_dec_parent_data[] = {
>>          { .fw_name = "xtal", }
>>   };
>>
>> -static struct clk_regmap s4_vdec_p0_mux = {
>> +static struct clk_regmap s4_vdec_p0_sel = {
>
>
> Since both vdec_clk and mali_clk are 'no glitch clock', should we also unify
> the naming from 's4_vdec_p0'/'s4_vdec_p1' to 's4_vdec_0'/'s4_vdec_1'?

Please have another look at the description.

As much as possible, I want the ID, clock name, and variable names
aligned. ID do not change and has that 'p' ... so no, the 'p' stays.

>
>
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1473,10 +1471,10 @@ static struct clk_regmap s4_vdec_p0_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vdec_p0_mux",
>> +               .name = "vdec_p0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1492,7 +1490,7 @@ static struct clk_regmap s4_vdec_p0_div = {
>>                  .name = "vdec_p0_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vdec_p0_mux.hw
>> +                       &s4_vdec_p0_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1515,7 +1513,7 @@ static struct clk_regmap s4_vdec_p0 = {
>>          },
>>   };
>>
>> -static struct clk_regmap s4_vdec_p1_mux = {
>> +static struct clk_regmap s4_vdec_p1_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC3_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1523,10 +1521,10 @@ static struct clk_regmap s4_vdec_p1_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vdec_p1_mux",
>> +               .name = "vdec_p1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1542,7 +1540,7 @@ static struct clk_regmap s4_vdec_p1_div = {
>>                  .name = "vdec_p1_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vdec_p1_mux.hw
>> +                       &s4_vdec_p1_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1565,27 +1563,25 @@ static struct clk_regmap s4_vdec_p1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_vdec_mux_parent_hws[] = {
>> -       &s4_vdec_p0.hw,
>> -       &s4_vdec_p1.hw
>> -};
>> -
>> -static struct clk_regmap s4_vdec_mux = {
>> +static struct clk_regmap s4_vdec_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC3_CLK_CTRL,
>>                  .mask = 0x1,
>>                  .shift = 15,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vdec_mux",
>> +               .name = "vdec_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_vdec_mux_parent_hws,
>> -               .num_parents = ARRAY_SIZE(s4_vdec_mux_parent_hws),
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_vdec_p0.hw,
>> +                       &s4_vdec_p1.hw,
>> +               },
>> +               .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>>
>> -static struct clk_regmap s4_hevcf_p0_mux = {
>> +static struct clk_regmap s4_hevcf_p0_sel = {
>
>
> +static struct clk_regmap s4_hevcf_0_sel
> +static struct clk_regmap s4_hevcf_0_div
> .
> .
> .
>
>
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC2_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1593,10 +1589,10 @@ static struct clk_regmap s4_hevcf_p0_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "hevcf_p0_mux",
>> +               .name = "hevcf_p0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1612,7 +1608,7 @@ static struct clk_regmap s4_hevcf_p0_div = {
>>                  .name = "hevcf_p0_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_hevcf_p0_mux.hw
>> +                       &s4_hevcf_p0_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1625,7 +1621,7 @@ static struct clk_regmap s4_hevcf_p0 = {
>>                  .bit_idx = 8,
>>          },
>>          .hw.init = &(struct clk_init_data){
>> -               .name = "hevcf_p0_gate",
>> +               .name = "hevcf_p0",
>>                  .ops = &clk_regmap_gate_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>>                          &s4_hevcf_p0_div.hw
>> @@ -1635,7 +1631,7 @@ static struct clk_regmap s4_hevcf_p0 = {
>>          },
>>   };
>>
>> -static struct clk_regmap s4_hevcf_p1_mux = {
>> +static struct clk_regmap s4_hevcf_p1_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC4_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1643,10 +1639,10 @@ static struct clk_regmap s4_hevcf_p1_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "hevcf_p1_mux",
>> +               .name = "hevcf_p1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1662,7 +1658,7 @@ static struct clk_regmap s4_hevcf_p1_div = {
>>                  .name = "hevcf_p1_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_hevcf_p1_mux.hw
>> +                       &s4_hevcf_p1_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1685,28 +1681,26 @@ static struct clk_regmap s4_hevcf_p1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_hevcf_mux_parent_hws[] = {
>> -       &s4_hevcf_p0.hw,
>> -       &s4_hevcf_p1.hw
>> -};
>> -
>> -static struct clk_regmap s4_hevcf_mux = {
>> +static struct clk_regmap s4_hevcf_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC4_CLK_CTRL,
>>                  .mask = 0x1,
>>                  .shift = 15,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "hevcf",
>> +               .name = "hevcf_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_hevcf_mux_parent_hws,
>> -               .num_parents = ARRAY_SIZE(s4_hevcf_mux_parent_hws),
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_hevcf_p0.hw,
>> +                       &s4_hevcf_p1.hw,
>> +               },
>> +               .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>>
>>   /* VPU Clock */
>> -static const struct clk_parent_data s4_vpu_parent_data[] = {
>> +static const struct clk_parent_data s4_vpu_parents[] = {
>>          { .fw_name = "fclk_div3", },
>>          { .fw_name = "fclk_div4", },
>>          { .fw_name = "fclk_div5", },
>> @@ -1726,8 +1720,8 @@ static struct clk_regmap s4_vpu_0_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "vpu_0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_parent_data),
>> +               .parent_data = s4_vpu_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1770,8 +1764,8 @@ static struct clk_regmap s4_vpu_1_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "vpu_1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_parent_data),
>> +               .parent_data = s4_vpu_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1823,24 +1817,24 @@ static struct clk_regmap s4_vpu = {
>>          },
>>   };
>>
>> -static const struct clk_parent_data vpu_clkb_tmp_parent_data[] = {
>> +static const struct clk_parent_data vpu_clkb_tmp_parents[] = {
>>          { .hw = &s4_vpu.hw },
>>          { .fw_name = "fclk_div4", },
>>          { .fw_name = "fclk_div5", },
>>          { .fw_name = "fclk_div7", }
>>   };
>>
>> -static struct clk_regmap s4_vpu_clkb_tmp_mux = {
>> +static struct clk_regmap s4_vpu_clkb_tmp_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKB_CTRL,
>>                  .mask = 0x3,
>>                  .shift = 20,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkb_tmp_mux",
>> +               .name = "vpu_clkb_tmp_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = vpu_clkb_tmp_parent_data,
>> -               .num_parents = ARRAY_SIZE(vpu_clkb_tmp_parent_data),
>> +               .parent_data = vpu_clkb_tmp_parents,
>> +               .num_parents = ARRAY_SIZE(vpu_clkb_tmp_parents),
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>> @@ -1855,7 +1849,7 @@ static struct clk_regmap s4_vpu_clkb_tmp_div = {
>>                  .name = "vpu_clkb_tmp_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vpu_clkb_tmp_mux.hw
>> +                       &s4_vpu_clkb_tmp_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1911,7 +1905,7 @@ static struct clk_regmap s4_vpu_clkb = {
>>          },
>>   };
>>
>> -static const struct clk_parent_data s4_vpu_clkc_parent_data[] = {
>> +static const struct clk_parent_data s4_vpu_clkc_parents[] = {
>>          { .fw_name = "fclk_div4", },
>>          { .fw_name = "fclk_div3", },
>>          { .fw_name = "fclk_div5", },
>> @@ -1922,17 +1916,17 @@ static const struct clk_parent_data s4_vpu_clkc_parent_data[] = {
>>          { .fw_name = "gp0_pll", },
>>   };
>>
>> -static struct clk_regmap s4_vpu_clkc_p0_mux  = {
>> +static struct clk_regmap s4_vpu_clkc_p0_sel  = {
>
>
> +static struct clk_regmap s4_vpu_clkc_0_sel
> +static struct clk_regmap s4_vpu_clkc_0_div
> .
> .
> .
>
>
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKC_CTRL,
>>                  .mask = 0x7,
>>                  .shift = 9,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkc_p0_mux",
>> +               .name = "vpu_clkc_p0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_clkc_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parent_data),
>> +               .parent_data = s4_vpu_clkc_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1947,7 +1941,7 @@ static struct clk_regmap s4_vpu_clkc_p0_div = {
>>                  .name = "vpu_clkc_p0_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vpu_clkc_p0_mux.hw
>> +                       &s4_vpu_clkc_p0_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1970,17 +1964,17 @@ static struct clk_regmap s4_vpu_clkc_p0 = {
>>          },
>>   };
>>
>> -static struct clk_regmap s4_vpu_clkc_p1_mux = {
>> +static struct clk_regmap s4_vpu_clkc_p1_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKC_CTRL,
>>                  .mask = 0x7,
>>                  .shift = 25,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkc_p1_mux",
>> +               .name = "vpu_clkc_p1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_clkc_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parent_data),
>> +               .parent_data = s4_vpu_clkc_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1995,7 +1989,7 @@ static struct clk_regmap s4_vpu_clkc_p1_div = {
>>                  .name = "vpu_clkc_p1_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vpu_clkc_p1_mux.hw
>> +                       &s4_vpu_clkc_p1_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -2018,28 +2012,26 @@ static struct clk_regmap s4_vpu_clkc_p1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_vpu_mux_parent_hws[] = {
>> -       &s4_vpu_clkc_p0.hw,
>> -       &s4_vpu_clkc_p1.hw
>> -};
>> -
>> -static struct clk_regmap s4_vpu_clkc_mux = {
>> +static struct clk_regmap s4_vpu_clkc_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKC_CTRL,
>>                  .mask = 0x1,
>>                  .shift = 31,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkc_mux",
>> +               .name = "vpu_clkc_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_vpu_mux_parent_hws,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_mux_parent_hws),
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_vpu_clkc_p0.hw,
>> +                       &s4_vpu_clkc_p1.hw,
>> +               },
>> +               .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>
>
> [...]
>
>
>>   MODULE_DESCRIPTION("Amlogic S4 Peripherals Clock Controller driver");
>>   MODULE_AUTHOR("Yu Tu <yu.tu@amlogic.com>");
>>
>> --
>> 2.47.2
>>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic

-- 
Jerome

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

WARNING: multiple messages have this Message-ID (diff)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Chuan Liu <chuan.liu@amlogic.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	 Kevin Hilman <khilman@baylibre.com>,
	 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	 linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 12/26] clk: amlogic: s4-peripherals: naming consistency alignment
Date: Thu, 03 Jul 2025 09:54:34 +0200	[thread overview]
Message-ID: <1jsejdd805.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <a7738c67-25fc-4919-bee8-69a72abb4871@amlogic.com> (Chuan Liu's message of "Thu, 3 Jul 2025 11:18:04 +0800")

On Thu 03 Jul 2025 at 11:18, Chuan Liu <chuan.liu@amlogic.com> wrote:

> Hi Jerome:
>
>
> On 7/2/2025 11:26 PM, Jerome Brunet wrote:
>> [ EXTERNAL EMAIL ]
>>
>> Amlogic clock controller drivers are all doing the same thing, more or
>> less. Yet, over the years, tiny (and often pointless) differences have
>> emerged.
>>
>> This makes reviews more difficult, allows some errors to slip through and
>> make it more difficult to exploit SoC commonalities, leading to code
>> duplication.
>>
>> This change enforce, wherever possible, a consistent and predictable scheme
>> when it comes to code organisation and naming, The scheme chosen is what
>> was used the most already, to try and minimise the size of the ugly
>> resulting diff. Here are some of the rules applied:
>> - Aligning clock names, variable names and IDs.
>>    - ID cannot change (used in DT)
>>    - Variable names w/ SoC name prefixes
>>    - Clock names w/o SoC name prefixes, except pclks for historic reasons
>> - Composite clock systematic naming : mux: X_sel, div:X_div, gate:X
>> - Parent table systematically named with the same name as the clock and
>>    a '_parents' suffix
>> - Group various tables next to the related clock
>> - etc ...
>>
>> Doing so removes what would otherwise show up as unrelated diff in
>> following changes. It will allow to introduce common definitions for
>> peripheral clocks, probe helpers, composite clocks, etc ... making further
>> review and maintenance easier.
>>
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>   drivers/clk/meson/s4-peripherals.c | 746 ++++++++++++++++++-------------------
>>   1 file changed, 370 insertions(+), 376 deletions(-)
>>
>> diff --git a/drivers/clk/meson/s4-peripherals.c b/drivers/clk/meson/s4-peripherals.c
>> index c9400cf54c84c3dc7c63d0636933951b0cac230c..9bcd35f12836de5e318fd1ad9c9ae15a2bfc3dd7 100644
>> --- a/drivers/clk/meson/s4-peripherals.c
>> +++ b/drivers/clk/meson/s4-peripherals.c
>
>
> [...]
>
>
>> @@ -1320,7 +1320,7 @@ static struct clk_regmap s4_ts_clk_gate = {
>>    * mux because it does top-to-bottom updates the each clock tree and
>>    * switches to the "inactive" one when CLK_SET_RATE_GATE is set.
>>    */
>> -static const struct clk_parent_data s4_mali_0_1_parent_data[] = {
>> +static const struct clk_parent_data s4_mali_parents[] = {
>>          { .fw_name = "xtal", },
>>          { .fw_name = "gp0_pll", },
>>          { .fw_name = "hifi_pll", },
>> @@ -1340,8 +1340,8 @@ static struct clk_regmap s4_mali_0_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "mali_0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_mali_0_1_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_mali_0_1_parent_data),
>> +               .parent_data = s4_mali_parents,
>> +               .num_parents = ARRAY_SIZE(s4_mali_parents),
>>                  /*
>>                   * Don't request the parent to change the rate because
>>                   * all GPU frequencies can be derived from the fclk_*
>> @@ -1394,8 +1394,8 @@ static struct clk_regmap s4_mali_1_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "mali_1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_mali_0_1_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_mali_0_1_parent_data),
>> +               .parent_data = s4_mali_parents,
>> +               .num_parents = ARRAY_SIZE(s4_mali_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1433,28 +1433,26 @@ static struct clk_regmap s4_mali_1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_mali_parent_hws[] = {
>> -       &s4_mali_0.hw,
>> -       &s4_mali_1.hw
>> -};
>> -
>> -static struct clk_regmap s4_mali_mux = {
>> +static struct clk_regmap s4_mali_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_MALI_CLK_CTRL,
>>                  .mask = 1,
>>                  .shift = 31,
>>          },
>>          .hw.init = &(struct clk_init_data){
>> -               .name = "mali",
>> +               .name = "mali_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_mali_parent_hws,
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_mali_0.hw,
>> +                       &s4_mali_1.hw,
>> +               },
>>                  .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>>
>>   /* VDEC clocks */
>> -static const struct clk_parent_data s4_dec_parent_data[] = {
>> +static const struct clk_parent_data s4_dec_parents[] = {
>>          { .fw_name = "fclk_div2p5", },
>>          { .fw_name = "fclk_div3", },
>>          { .fw_name = "fclk_div4", },
>> @@ -1465,7 +1463,7 @@ static const struct clk_parent_data s4_dec_parent_data[] = {
>>          { .fw_name = "xtal", }
>>   };
>>
>> -static struct clk_regmap s4_vdec_p0_mux = {
>> +static struct clk_regmap s4_vdec_p0_sel = {
>
>
> Since both vdec_clk and mali_clk are 'no glitch clock', should we also unify
> the naming from 's4_vdec_p0'/'s4_vdec_p1' to 's4_vdec_0'/'s4_vdec_1'?

Please have another look at the description.

As much as possible, I want the ID, clock name, and variable names
aligned. ID do not change and has that 'p' ... so no, the 'p' stays.

>
>
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1473,10 +1471,10 @@ static struct clk_regmap s4_vdec_p0_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vdec_p0_mux",
>> +               .name = "vdec_p0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1492,7 +1490,7 @@ static struct clk_regmap s4_vdec_p0_div = {
>>                  .name = "vdec_p0_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vdec_p0_mux.hw
>> +                       &s4_vdec_p0_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1515,7 +1513,7 @@ static struct clk_regmap s4_vdec_p0 = {
>>          },
>>   };
>>
>> -static struct clk_regmap s4_vdec_p1_mux = {
>> +static struct clk_regmap s4_vdec_p1_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC3_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1523,10 +1521,10 @@ static struct clk_regmap s4_vdec_p1_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vdec_p1_mux",
>> +               .name = "vdec_p1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1542,7 +1540,7 @@ static struct clk_regmap s4_vdec_p1_div = {
>>                  .name = "vdec_p1_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vdec_p1_mux.hw
>> +                       &s4_vdec_p1_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1565,27 +1563,25 @@ static struct clk_regmap s4_vdec_p1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_vdec_mux_parent_hws[] = {
>> -       &s4_vdec_p0.hw,
>> -       &s4_vdec_p1.hw
>> -};
>> -
>> -static struct clk_regmap s4_vdec_mux = {
>> +static struct clk_regmap s4_vdec_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC3_CLK_CTRL,
>>                  .mask = 0x1,
>>                  .shift = 15,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vdec_mux",
>> +               .name = "vdec_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_vdec_mux_parent_hws,
>> -               .num_parents = ARRAY_SIZE(s4_vdec_mux_parent_hws),
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_vdec_p0.hw,
>> +                       &s4_vdec_p1.hw,
>> +               },
>> +               .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>>
>> -static struct clk_regmap s4_hevcf_p0_mux = {
>> +static struct clk_regmap s4_hevcf_p0_sel = {
>
>
> +static struct clk_regmap s4_hevcf_0_sel
> +static struct clk_regmap s4_hevcf_0_div
> .
> .
> .
>
>
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC2_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1593,10 +1589,10 @@ static struct clk_regmap s4_hevcf_p0_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "hevcf_p0_mux",
>> +               .name = "hevcf_p0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1612,7 +1608,7 @@ static struct clk_regmap s4_hevcf_p0_div = {
>>                  .name = "hevcf_p0_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_hevcf_p0_mux.hw
>> +                       &s4_hevcf_p0_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1625,7 +1621,7 @@ static struct clk_regmap s4_hevcf_p0 = {
>>                  .bit_idx = 8,
>>          },
>>          .hw.init = &(struct clk_init_data){
>> -               .name = "hevcf_p0_gate",
>> +               .name = "hevcf_p0",
>>                  .ops = &clk_regmap_gate_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>>                          &s4_hevcf_p0_div.hw
>> @@ -1635,7 +1631,7 @@ static struct clk_regmap s4_hevcf_p0 = {
>>          },
>>   };
>>
>> -static struct clk_regmap s4_hevcf_p1_mux = {
>> +static struct clk_regmap s4_hevcf_p1_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC4_CLK_CTRL,
>>                  .mask = 0x7,
>> @@ -1643,10 +1639,10 @@ static struct clk_regmap s4_hevcf_p1_mux = {
>>                  .flags = CLK_MUX_ROUND_CLOSEST,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "hevcf_p1_mux",
>> +               .name = "hevcf_p1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_dec_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_dec_parent_data),
>> +               .parent_data = s4_dec_parents,
>> +               .num_parents = ARRAY_SIZE(s4_dec_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1662,7 +1658,7 @@ static struct clk_regmap s4_hevcf_p1_div = {
>>                  .name = "hevcf_p1_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_hevcf_p1_mux.hw
>> +                       &s4_hevcf_p1_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1685,28 +1681,26 @@ static struct clk_regmap s4_hevcf_p1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_hevcf_mux_parent_hws[] = {
>> -       &s4_hevcf_p0.hw,
>> -       &s4_hevcf_p1.hw
>> -};
>> -
>> -static struct clk_regmap s4_hevcf_mux = {
>> +static struct clk_regmap s4_hevcf_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VDEC4_CLK_CTRL,
>>                  .mask = 0x1,
>>                  .shift = 15,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "hevcf",
>> +               .name = "hevcf_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_hevcf_mux_parent_hws,
>> -               .num_parents = ARRAY_SIZE(s4_hevcf_mux_parent_hws),
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_hevcf_p0.hw,
>> +                       &s4_hevcf_p1.hw,
>> +               },
>> +               .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>>
>>   /* VPU Clock */
>> -static const struct clk_parent_data s4_vpu_parent_data[] = {
>> +static const struct clk_parent_data s4_vpu_parents[] = {
>>          { .fw_name = "fclk_div3", },
>>          { .fw_name = "fclk_div4", },
>>          { .fw_name = "fclk_div5", },
>> @@ -1726,8 +1720,8 @@ static struct clk_regmap s4_vpu_0_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "vpu_0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_parent_data),
>> +               .parent_data = s4_vpu_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1770,8 +1764,8 @@ static struct clk_regmap s4_vpu_1_sel = {
>>          .hw.init = &(struct clk_init_data){
>>                  .name = "vpu_1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_parent_data),
>> +               .parent_data = s4_vpu_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1823,24 +1817,24 @@ static struct clk_regmap s4_vpu = {
>>          },
>>   };
>>
>> -static const struct clk_parent_data vpu_clkb_tmp_parent_data[] = {
>> +static const struct clk_parent_data vpu_clkb_tmp_parents[] = {
>>          { .hw = &s4_vpu.hw },
>>          { .fw_name = "fclk_div4", },
>>          { .fw_name = "fclk_div5", },
>>          { .fw_name = "fclk_div7", }
>>   };
>>
>> -static struct clk_regmap s4_vpu_clkb_tmp_mux = {
>> +static struct clk_regmap s4_vpu_clkb_tmp_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKB_CTRL,
>>                  .mask = 0x3,
>>                  .shift = 20,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkb_tmp_mux",
>> +               .name = "vpu_clkb_tmp_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = vpu_clkb_tmp_parent_data,
>> -               .num_parents = ARRAY_SIZE(vpu_clkb_tmp_parent_data),
>> +               .parent_data = vpu_clkb_tmp_parents,
>> +               .num_parents = ARRAY_SIZE(vpu_clkb_tmp_parents),
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>> @@ -1855,7 +1849,7 @@ static struct clk_regmap s4_vpu_clkb_tmp_div = {
>>                  .name = "vpu_clkb_tmp_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vpu_clkb_tmp_mux.hw
>> +                       &s4_vpu_clkb_tmp_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1911,7 +1905,7 @@ static struct clk_regmap s4_vpu_clkb = {
>>          },
>>   };
>>
>> -static const struct clk_parent_data s4_vpu_clkc_parent_data[] = {
>> +static const struct clk_parent_data s4_vpu_clkc_parents[] = {
>>          { .fw_name = "fclk_div4", },
>>          { .fw_name = "fclk_div3", },
>>          { .fw_name = "fclk_div5", },
>> @@ -1922,17 +1916,17 @@ static const struct clk_parent_data s4_vpu_clkc_parent_data[] = {
>>          { .fw_name = "gp0_pll", },
>>   };
>>
>> -static struct clk_regmap s4_vpu_clkc_p0_mux  = {
>> +static struct clk_regmap s4_vpu_clkc_p0_sel  = {
>
>
> +static struct clk_regmap s4_vpu_clkc_0_sel
> +static struct clk_regmap s4_vpu_clkc_0_div
> .
> .
> .
>
>
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKC_CTRL,
>>                  .mask = 0x7,
>>                  .shift = 9,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkc_p0_mux",
>> +               .name = "vpu_clkc_p0_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_clkc_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parent_data),
>> +               .parent_data = s4_vpu_clkc_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1947,7 +1941,7 @@ static struct clk_regmap s4_vpu_clkc_p0_div = {
>>                  .name = "vpu_clkc_p0_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vpu_clkc_p0_mux.hw
>> +                       &s4_vpu_clkc_p0_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -1970,17 +1964,17 @@ static struct clk_regmap s4_vpu_clkc_p0 = {
>>          },
>>   };
>>
>> -static struct clk_regmap s4_vpu_clkc_p1_mux = {
>> +static struct clk_regmap s4_vpu_clkc_p1_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKC_CTRL,
>>                  .mask = 0x7,
>>                  .shift = 25,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkc_p1_mux",
>> +               .name = "vpu_clkc_p1_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_data = s4_vpu_clkc_parent_data,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parent_data),
>> +               .parent_data = s4_vpu_clkc_parents,
>> +               .num_parents = ARRAY_SIZE(s4_vpu_clkc_parents),
>>                  .flags = 0,
>>          },
>>   };
>> @@ -1995,7 +1989,7 @@ static struct clk_regmap s4_vpu_clkc_p1_div = {
>>                  .name = "vpu_clkc_p1_div",
>>                  .ops = &clk_regmap_divider_ops,
>>                  .parent_hws = (const struct clk_hw *[]) {
>> -                       &s4_vpu_clkc_p1_mux.hw
>> +                       &s4_vpu_clkc_p1_sel.hw
>>                  },
>>                  .num_parents = 1,
>>                  .flags = CLK_SET_RATE_PARENT,
>> @@ -2018,28 +2012,26 @@ static struct clk_regmap s4_vpu_clkc_p1 = {
>>          },
>>   };
>>
>> -static const struct clk_hw *s4_vpu_mux_parent_hws[] = {
>> -       &s4_vpu_clkc_p0.hw,
>> -       &s4_vpu_clkc_p1.hw
>> -};
>> -
>> -static struct clk_regmap s4_vpu_clkc_mux = {
>> +static struct clk_regmap s4_vpu_clkc_sel = {
>>          .data = &(struct clk_regmap_mux_data){
>>                  .offset = CLKCTRL_VPU_CLKC_CTRL,
>>                  .mask = 0x1,
>>                  .shift = 31,
>>          },
>>          .hw.init = &(struct clk_init_data) {
>> -               .name = "vpu_clkc_mux",
>> +               .name = "vpu_clkc_sel",
>>                  .ops = &clk_regmap_mux_ops,
>> -               .parent_hws = s4_vpu_mux_parent_hws,
>> -               .num_parents = ARRAY_SIZE(s4_vpu_mux_parent_hws),
>> +               .parent_hws = (const struct clk_hw *[]) {
>> +                       &s4_vpu_clkc_p0.hw,
>> +                       &s4_vpu_clkc_p1.hw,
>> +               },
>> +               .num_parents = 2,
>>                  .flags = CLK_SET_RATE_PARENT,
>>          },
>>   };
>
>
> [...]
>
>
>>   MODULE_DESCRIPTION("Amlogic S4 Peripherals Clock Controller driver");
>>   MODULE_AUTHOR("Yu Tu <yu.tu@amlogic.com>");
>>
>> --
>> 2.47.2
>>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic

-- 
Jerome

  reply	other threads:[~2025-07-03  8:01 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 15:25 [PATCH 00/26] clk: amlogic: clock controllers clean-up and factorisation Jerome Brunet
2025-07-02 15:25 ` Jerome Brunet
2025-07-02 15:25 ` [PATCH 01/26] clk: amlogic: a1-peripherals: naming consistency alignment Jerome Brunet
2025-07-02 15:25   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 02/26] clk: amlogic: a1-pll: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 03/26] clk: amlogic: axg-ao: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 04/26] clk: amlogic: axg: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 05/26] clk: amlogic: c3-peripherals: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  2:51   ` Chuan Liu
2025-07-03  2:51     ` Chuan Liu
2025-07-03  7:48     ` Jerome Brunet
2025-07-03  7:48       ` Jerome Brunet
2025-07-03  8:31       ` Chuan Liu
2025-07-03  8:31         ` Chuan Liu
2025-07-03  9:02         ` Jerome Brunet
2025-07-03  9:02           ` Jerome Brunet
2025-07-03  9:23           ` Chuan Liu
2025-07-03  9:23             ` Chuan Liu
2025-07-02 15:26 ` [PATCH 06/26] clk: amlogic: c3-pll: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  2:57   ` Chuan Liu
2025-07-03  2:57     ` Chuan Liu
2025-07-02 15:26 ` [PATCH 07/26] clk: amlogic: g12a-ao: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 08/26] clk: amlogic: g12a: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 09/26] clk: amlogic: gxbb-ao: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 10/26] clk: amlogic: gxbb: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 11/26] clk: amlogic: meson8b: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 12/26] clk: amlogic: s4-peripherals: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  3:18   ` Chuan Liu
2025-07-03  3:18     ` Chuan Liu
2025-07-03  7:54     ` Jerome Brunet [this message]
2025-07-03  7:54       ` Jerome Brunet
2025-07-03  8:00       ` Chuan Liu
2025-07-03  8:00         ` Chuan Liu
2025-07-02 15:26 ` [PATCH 13/26] clk: amlogic: s4-pll: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  3:19   ` Chuan Liu
2025-07-03  3:19     ` Chuan Liu
2025-07-02 15:26 ` [PATCH 14/26] clk: amlogic: meson8-ddr: " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 15/26] clk: amlogic: drop meson-clkcee Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 16/26] clk: amlogic: add probe helper for mmio based controllers Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  3:29   ` Chuan Liu
2025-07-03  3:29     ` Chuan Liu
2025-07-03  8:35     ` Jerome Brunet
2025-07-03  8:35       ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 17/26] clk: amlogic: use probe helper in " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  6:29   ` Chuan Liu
2025-07-03  6:29     ` Chuan Liu
2025-07-02 15:26 ` [PATCH 18/26] clk: amlogic: aoclk: use clkc-utils syscon probe Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 19/26] clk: amlogic: move PCLK definition to clkc-utils Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 20/26] clk: amlogic: drop CLK_SET_RATE_PARENT from peripheral clocks Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 21/26] clk: amlogic: pclk explicitly use CLK_IGNORE_UNUSED Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  7:05   ` Chuan Liu
2025-07-03  7:05     ` Chuan Liu
2025-07-02 15:26 ` [PATCH 22/26] clk: amlogic: introduce a common pclk definition Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  7:10   ` Chuan Liu
2025-07-03  7:10     ` Chuan Liu
2025-07-02 15:26 ` [PATCH 23/26] clk: amlogic: use the " Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  7:16   ` Chuan Liu
2025-07-03  7:16     ` Chuan Liu
2025-07-03  8:39     ` Jerome Brunet
2025-07-03  8:39       ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 24/26] clk: amlogic: add composite clock helpers Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  7:24   ` Chuan Liu
2025-07-03  7:24     ` Chuan Liu
2025-07-03  8:39     ` Jerome Brunet
2025-07-03  8:39       ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 25/26] clk: amlogic: align s4 and c3 pwm clock descriptions Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  7:27   ` Chuan Liu
2025-07-03  7:27     ` Chuan Liu
2025-07-02 15:26 ` [PATCH 26/26] clk: amlogic: c3-peripherals: use helper for basic composite clocks Jerome Brunet
2025-07-02 15:26   ` Jerome Brunet
2025-07-03  7:56   ` Chuan Liu
2025-07-03  7:56     ` Chuan Liu
2025-07-03  8:44     ` Jerome Brunet
2025-07-03  8:44       ` Jerome Brunet
2025-08-06  7:10 ` [PATCH 00/26] clk: amlogic: clock controllers clean-up and factorisation Chuan Liu
2025-08-06  7:10   ` Chuan Liu
2025-08-25 14:24 ` Jerome Brunet
2025-08-25 14:24   ` Jerome Brunet
2025-09-21 11:25 ` Mark Brown
2025-09-21 11:25   ` Mark Brown
2025-09-21 12:21   ` Martin Blumenstingl
2025-09-21 12:21     ` Martin Blumenstingl
2025-09-21 12:59     ` Jerome Brunet
2025-09-21 12:59       ` Jerome Brunet
2025-09-22  9:40       ` Mark Brown
2025-09-22  9:40         ` Mark Brown
2025-09-22 11:02         ` Martin Blumenstingl
2025-09-22 11:02           ` Martin Blumenstingl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1jsejdd805.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=chuan.liu@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.