Linux clock framework development
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jian Hu <jian.hu@amlogic.com>
Cc: Xianwei Zhao <xianwei.zhao@amlogic.com>,
	 Chuan Liu <chuan.liu@amlogic.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	 Dmitry Rokosov <ddrokosov@sberdevices.ru>,
	 robh+dt <robh+dt@kernel.org>,  Rob Herring <robh@kernel.org>,
	 devicetree <devicetree@vger.kernel.org>,
	 linux-clk <linux-clk@vger.kernel.org>,
	 linux-amlogic <linux-amlogic@lists.infradead.org>,
	 linux-kernel <linux-kernel@vger.kernel.org>,
	 linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 5/5] clk: meson: t7: add t7 clock peripherals controller driver
Date: Fri, 07 Nov 2025 18:10:23 +0100	[thread overview]
Message-ID: <1jv7jlvke8.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <236a568d-c809-4dc7-be2f-e813d0d85368@amlogic.com> (Jian Hu's message of "Sat, 8 Nov 2025 00:20:33 +0800")

On Sat 08 Nov 2025 at 00:20, Jian Hu <jian.hu@amlogic.com> wrote:

> On 11/4/2025 6:14 PM, Jerome Brunet wrote:
>> [ EXTERNAL EMAIL ]
>>
>> On Tue 04 Nov 2025 at 17:17, Jian Hu <jian.hu@amlogic.com> wrote:
>>
>>>>> +
>>>>> +static struct clk_regmap t7_dspa = {
>>>>> +     .data = &(struct clk_regmap_mux_data){
>>>>> +             .offset = DSPA_CLK_CTRL0,
>>>>> +             .mask = 0x1,
>>>>> +             .shift = 15,
>>>>> +     },
>>>>> +     .hw.init = &(struct clk_init_data){
>>>>> +             .name = "dspa",
>>>>> +             .ops = &clk_regmap_mux_ops,
>>>>> +             .parent_hws = (const struct clk_hw *[]) {
>>>>> +                     &t7_dspa_a.hw,
>>>>> +                     &t7_dspa_b.hw,
>>>>> +             },
>>>>> +             .num_parents = 2,
>>>>> +             .flags = CLK_SET_RATE_PARENT,
>>>>> +     },
>>>>> +};
>>>>> +
>>>>> ......
>>>>> +
>>>>> +static struct clk_regmap t7_anakin_0 = {
>>>> Nitpick: for the DSP it was a/b, here it is 0/1
>>>> Could you pick one way or the other and stick to it ?
>>>
>>> ok , I will use 0/1 for DSP.
>> I think I prefer a/b if you don't mind. see below for why ...
>
>
> Mali is named as mali_0, mali_1 in this driver.   And G12A/S4/GXBB series
> do the same.

... A1 use dspa_a dspa_b (etc ...) 

>
> If they are named as anakin_a and anakin_b here, there will be two naming
> methods.
>

Already have that unfortunately

> Shall we keep consistent ?
>

Please try yes

>
> If use 0/1 to name them.
>
> dsp clocks are:
>
>     dspa_0_sel
>
>     dspa_0_div
>
>     dspa_0
>
>     dspa_1_sel
>
>     dspa_1_div
>
>     dspa_1
>
>     dspb_0_sel
>
>     dspb_0_div
>
>     dspb_0
>
>     dspb_1_sel
>
>     dspb_1_div
>
>     dspb_1
>
>
> anakin clocks are:
>
>     anakin_0_sel
>
>     anakin_0_div
>
>     anakin_0
>
>     anakin_1_sel
>
>     anakin_1_div
>
>     anakin_1
>
>     anakin_01_sel
>
>     anakin
>
>
> If use a/b to name them.
>
> dsp clocks are:
>
>     dspa_a_sel
>
>     dspa_a_div
>
>     dspa_a
>
>     dspa_b_sel
>
>     dspa_b_div
>
>     dspa_b
>
>     dspb_a_sel
>
>     dspb_a_div
>
>     dspb_a
>
>     dspb_b_sel
>
>     dspb_b_div
>
>     dspb_b
>
>
> anakin clocks are:
>
>     anakin_a_sel
>
>     anakin_a_div
>
>     anakin_a
>
>     anakin_b_sel
>
>     anakin_b_div
>
>     anakin_b
>
>     anakin_ab_sel
>
>     anakin
>
>
> Which one is better?

a/b or 0/1, we already have both

Pick which ever scheme you prefer, just stick to it from now on.

>
>>>>> +     .data = &(struct clk_regmap_gate_data){
>>>>> +             .offset = ANAKIN_CLK_CTRL,
>>>>> +             .bit_idx = 8,
>>>>> +     },
>>>>> +     .hw.init = &(struct clk_init_data) {
>>>>> +             .name = "anakin_0",
>>>>> +             .ops = &clk_regmap_gate_ops,
>>>>> +             .parent_hws = (const struct clk_hw *[]) { &t7_anakin_0_div.hw },
>>>>> +             .num_parents = 1,
>>>>> +             .flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
>>>>> +     },
>>>>> +};
>> [...]
>>
>>>>> +
>>>>> +static struct clk_regmap t7_anakin_clk = {
>>>>> +     .data = &(struct clk_regmap_gate_data){
>>>>> +             .offset = ANAKIN_CLK_CTRL,
>>>>> +             .bit_idx = 30,
>>>>> +     },
>>>>> +     .hw.init = &(struct clk_init_data) {
>>>>> +             .name = "anakin_clk",
>>>> Again, not a great name, especially considering the one above.
>>>> Is this really really how the doc refers to these 2 clocks ?
>>>
>>> bit30 gate clock is after bit31 mux clock,  and the gate clock is the final
>>> output clock, it is used to gate anakin clock.
>>>
>>> I will rename bit31 as anakin_pre, rename bit30 as anakin.
>> Ok for the last element
>>
>> ... but I don't  like "_pre" for a mux selecting one the 2 glitch free
>> path. It does not help understanding the tree.
>>
>> For such mux, when it is not the last element, I would suggest
>> "_ab_sel" ... at least it is clear what it does so, "anakin_ab_sel" ?
>>
>
> ok, anakin_ab_sel and anakin for these two clocks.
>
>
> Maybe anakin_01_sel and anakin for these two clocks, if you agree to 0/1
> naming convention.
>
>>>>> +             .ops = &clk_regmap_gate_ops,
>>>>> +             .parent_hws = (const struct clk_hw *[]) {
>>>>> +                     &t7_anakin.hw
>>>>> +             },
>>>>> +             .num_parents = 1,
>>>>> +             .flags = CLK_SET_RATE_PARENT
>>>>> +     },
>>>>> +};
>>>>> +

-- 
Jerome

  reply	other threads:[~2025-11-07 17:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30  9:43 [PATCH v4 0/5] add support for T7 family clock controller Jian Hu
2025-10-30  9:43 ` [PATCH v4 1/5] dt-bindings: clock: add Amlogic T7 PLL " Jian Hu
2025-10-30  9:43 ` [PATCH v4 2/5] dt-bindings: clock: add Amlogic T7 SCMI " Jian Hu
2025-10-30  9:43 ` [PATCH v4 3/5] dt-bindings: clock: add Amlogic T7 peripherals " Jian Hu
2025-10-30  9:43 ` [PATCH v4 4/5] clk: meson: t7: add support for the T7 SoC PLL clock Jian Hu
2025-10-30  9:43 ` [PATCH v4 5/5] clk: meson: t7: add t7 clock peripherals controller driver Jian Hu
2025-10-31  9:51   ` Jerome Brunet
2025-11-04  9:17     ` Jian Hu
2025-11-04 10:14       ` Jerome Brunet
2025-11-07 16:20         ` Jian Hu
2025-11-07 17:10           ` Jerome Brunet [this message]
2025-11-13  7:41             ` Jian Hu

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=1jv7jlvke8.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=chuan.liu@amlogic.com \
    --cc=ddrokosov@sberdevices.ru \
    --cc=devicetree@vger.kernel.org \
    --cc=jian.hu@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=xianwei.zhao@amlogic.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox