From: 董绪洋 <dongxuyang@eswincomputing.com>
To: "Krzysztof Kozlowski" <krzk@kernel.org>
Cc: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, ningyu@eswincomputing.com,
linmin@eswincomputing.com, huangyifeng@eswincomputing.com,
韦尚娟 <weishangjuan@eswincomputing.com>
Subject: Re: Re: [PATCH v3 2/2] clock: eswin: Add eic7700 clock driver
Date: Fri, 4 Jul 2025 17:46:13 +0800 (GMT+08:00) [thread overview]
Message-ID: <6890259a.2bec.197d4d45239.Coremail.dongxuyang@eswincomputing.com> (raw)
In-Reply-To: <420cc724-e6cf-42d9-b00b-558965bee085@kernel.org>
> On 24/06/2025 12:33, dongxuyang@eswincomputing.com wrote:
> > From: Xuyang Dong <dongxuyang@eswincomputing.com>
> >
> > This driver depends on the CCF framework implementation.
> > Based on this driver, other modules in the SoC can use the APIs
> > provided by CCF to perform clock-related operations.
> > The driver supports eic7700 series chips.
> >
> > Signed-off-by: Yifeng Huang <huangyifeng@eswincomputing.com>
> > Signed-off-by: Xuyang Dong <dongxuyang@eswincomputing.com>
> > ---
> > drivers/clk/Kconfig | 1 +
> > drivers/clk/Makefile | 1 +
> > drivers/clk/eswin/Kconfig | 10 +
> > drivers/clk/eswin/Makefile | 8 +
> > drivers/clk/eswin/clk-eic7700.c | 3809 +++++++++++++++++++++++++++++++
> > drivers/clk/eswin/clk-eic7700.h | 194 ++
>
>
>
> ...
>
>
> > +void eswin_clk_register_pll(struct eswin_pll_clock *clks, int nums,
> > + struct eswin_clock_data *data, struct device *dev)
> > +{
> > + void __iomem *base = data->base;
> > + struct eswin_clk_pll *p_clk = NULL;
> > + struct clk *clk = NULL;
> > + struct clk_init_data init;
> > + int i;
> > + static struct gpio_desc *cpu_voltage_gpio;
> > +
> > + p_clk = devm_kzalloc(dev, sizeof(*p_clk) * nums, GFP_KERNEL);
> > +
> > + if (!p_clk)
> > + return;
> > + /*
> > + *In the D2D system, the boost operation is performed using the GPIO on Die0.
>
> What is the Linux coding style of comment?
>
> > + *However, the same GPIO pin cannot be acquired twice, so special handling is implemented:
> > + *Once the GPIO is acquired,the other driver simply uses it directly
> > + */
> > + cpu_voltage_gpio =
> > + IS_ERR_OR_NULL(cpu_voltage_gpio) ?
> > + devm_gpiod_get(dev, "cpu-voltage", GPIOD_OUT_HIGH) :
> > + cpu_voltage_gpio;
> > + if (IS_ERR_OR_NULL(cpu_voltage_gpio)) {
> > + dev_warn(dev, "failed to get cpu volatge gpio\n");
> > + cpu_voltage_gpio = NULL;
> > + } else {
> > + /*cpu default freq is 1400M, the volatge should be VOLTAGE_0_8V*/
> > + eswin_clk_set_cpu_volatge(cpu_voltage_gpio, VOLTAGE_0_8V);
>
> Amount of typos and unreadable stuff like missing spaces in this driver
> is just discouraging and making review unnecessary difficult. Fix the
> typos, fix the style. Driver is also way too big for simple clock driver
> and I am surprised to see so many redundancies.
>
> Anyway, your binding said it is not 1400M but something else so this is
> a mess.
>
When higher cpu frequency is applied, the higher voltage must be
configured accordingly. So, from my perspective, it's better to
implement the clk, regulator and cpu frequency separately.
clk.c and clk-eic7700.c are responsible for setting clk only.
regulator-eic7700.c is for voltage configuration.
cpufreq-eic7700.c is for cpu frequency configuration, and it will call
the APIs of clk and regulator.
Is this the right approach?
The clk driver too big is because clk trees are defined in the .c file.
We appreciate your review of our proposed changes. Please let us know
if these modifications meet the project's standards. Should any
adjustments be needed, we'd welcome your specific feedback to help
us improve the implementation.
Best regards,
Xuyang Dong
next prev parent reply other threads:[~2025-07-04 9:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 10:32 [PATCH v3 0/2] Add driver support for ESWIN eic700 SoC clock controller dongxuyang
2025-06-24 10:32 ` [PATCH v3 1/2] dt-bindings: clock: eswin: Documentation for eic7700 SoC dongxuyang
2025-06-24 11:00 ` Krzysztof Kozlowski
2025-06-25 6:07 ` Krzysztof Kozlowski
2025-06-24 10:33 ` [PATCH v3 2/2] clock: eswin: Add eic7700 clock driver dongxuyang
2025-06-24 11:04 ` Krzysztof Kozlowski
2025-07-04 9:46 ` 董绪洋 [this message]
2025-07-07 9:12 ` Bo Gan
2025-07-08 9:09 ` Xuyang Dong
2025-07-09 22:52 ` Bo Gan
2025-07-10 0:52 ` Xuyang Dong
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=6890259a.2bec.197d4d45239.Coremail.dongxuyang@eswincomputing.com \
--to=dongxuyang@eswincomputing.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=huangyifeng@eswincomputing.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linmin@eswincomputing.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=ningyu@eswincomputing.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=weishangjuan@eswincomputing.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;
as well as URLs for NNTP newsgroup(s).