mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Wang <unicorn_wang@outlook.com>
To: Stephen Boyd <sboyd@kernel.org>, Chen Wang <unicornxw@gmail.com>,
	aou@eecs.berkeley.edu, chao.wei@sophgo.com, conor@kernel.org,
	devicetree@vger.kernel.org, guoren@kernel.org,
	haijiao.liu@sophgo.com, inochiama@outlook.com,
	jszhang@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, mturquette@baylibre.com,
	palmer@dabbelt.com, paul.walmsley@sifive.com,
	richardcochran@gmail.com, robh+dt@kernel.org,
	samuel.holland@sifive.com, xiaoguang.xing@sophgo.com
Subject: Re: [PATCH v11 4/5] clk: sophgo: Add SG2042 clock driver
Date: Tue, 19 Mar 2024 15:40:46 +0800	[thread overview]
Message-ID: <MA0P287MB28227C169B0DFB16B1AC762DFE2C2@MA0P287MB2822.INDP287.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <47a83f766c85481b73c6e6dd3759d4d9.sboyd@kernel.org>

Thank you Stephen for your carefully check and comments, I will improve 
the code according to your inputs.

I have some additional explanations for two of these points.

On 2024/3/9 10:11, Stephen Boyd wrote:

[......]

>> +
>> +/*
>> + * Below array is the total combination lists of POSTDIV1 and POSTDIV2
>> + * for example:
>> + * postdiv1_2[0] = {2, 4, 8}
>> + *           ==> div1 = 2, div2 = 4 , div1 * div2 = 8
>> + * And POSTDIV_RESULT_INDEX point to 3rd element in the array
>> + */
>> +#define        POSTDIV_RESULT_INDEX    2
>> +static int postdiv1_2[][3] = {
> const? And move it to the function scope.
>
>> +       {2, 4,  8}, {3, 3,  9}, {2, 5, 10}, {2, 6, 12},
>> +       {2, 7, 14}, {3, 5, 15}, {4, 4, 16}, {3, 6, 18},
>> +       {4, 5, 20}, {3, 7, 21}, {4, 6, 24}, {5, 5, 25},
>> +       {4, 7, 28}, {5, 6, 30}, {5, 7, 35}, {6, 6, 36},
>> +       {6, 7, 42}, {7, 7, 49}
> It may be better to make it a struct with named members because I have
> no idea what each element means.
I plan to add some comments to explain the meaning of this array member. 
This array is only used in this function, and I think it is somewhat 
unnecessary to define a structure specifically for it. Adding some 
comments will help everyone understand better.

[......]

>> +
>> +/*
>> + * Common data of clock-controller
>> + * Note: this structure will be used both by clkgen & sysclk.
>> + * @iobase: base address of clock-controller
>> + * @regmap: base address of clock-controller for pll, just due to PLL uses
>> + *  regmap while others use iomem.
>> + * @lock: clock register access lock
>> + * @onecell_data: used for adding providers.
>> + */
>> +struct sg2042_clk_data {
>> +       void __iomem *iobase;
> Why not use a regmap for the iobase as well?
I plan to unify it as iomem. Anyway, just use one method should be fine.

[......]


  reply	other threads:[~2024-03-19  7:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  3:08 [PATCH v11 0/5] riscv: sophgo: add clock support for sg2042 Chen Wang
2024-02-20  3:08 ` [PATCH v11 1/5] dt-bindings: clock: sophgo: add pll clocks for SG2042 Chen Wang
2024-03-09  2:12   ` Stephen Boyd
2024-03-10  1:35     ` Chen Wang
2024-02-20  3:08 ` [PATCH v11 2/5] dt-bindings: clock: sophgo: add RP gate " Chen Wang
2024-02-23  0:17   ` Rob Herring
2024-03-09  2:12   ` Stephen Boyd
2024-03-09  2:15   ` Stephen Boyd
2024-03-10  1:28     ` Chen Wang
2024-02-20  3:09 ` [PATCH v11 3/5] dt-bindings: clock: sophgo: add clkgen " Chen Wang
2024-02-23  0:18   ` Rob Herring
2024-03-09  2:12   ` Stephen Boyd
2024-02-20  3:09 ` [PATCH v11 4/5] clk: sophgo: Add SG2042 clock driver Chen Wang
2024-02-23  3:01   ` Chen Wang
2024-02-27  1:09     ` Chen Wang
2024-03-09  2:11   ` Stephen Boyd
2024-03-19  7:40     ` Chen Wang [this message]
2024-02-20  3:10 ` [PATCH v11 5/5] riscv: dts: add clock generator for Sophgo SG2042 SoC Chen Wang

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=MA0P287MB28227C169B0DFB16B1AC762DFE2C2@MA0P287MB2822.INDP287.PROD.OUTLOOK.COM \
    --to=unicorn_wang@outlook.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=chao.wei@sophgo.com \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=guoren@kernel.org \
    --cc=haijiao.liu@sophgo.com \
    --cc=inochiama@outlook.com \
    --cc=jszhang@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=sboyd@kernel.org \
    --cc=unicornxw@gmail.com \
    --cc=xiaoguang.xing@sophgo.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

all inboxes | Powered by JetHome®