Re: [PATCH v1 2/5] PCI: tegra: Simplify clock handling by using clk_bulk*() functions
From: Anand Moon
Date: Sat Sep 27 2025 - 01:50:29 EST
Hi Frank,
On Fri, 26 Sept 2025 at 23:42, Frank Li <Frank.li@xxxxxxx> wrote:
>
> On Fri, Sep 26, 2025 at 12:57:43PM +0530, Anand Moon wrote:
> > Currently, the driver acquires clocks and prepare/enable/disable/unprepare
> > the clocks individually thereby making the driver complex to read.
> >
> > The driver can be simplified by using the clk_bulk*() APIs.
> >
> > Use:
> > - devm_clk_bulk_get() API to acquire all the clocks
> > - clk_bulk_prepare_enable() to prepare/enable clocks
> > - clk_bulk_disable_unprepare() APIs to disable/unprepare them in bulk
> >
> > Following change also removes the legacy has_cml_clk flag and its associated
> > conditional logic. Instead, the driver now relies on the clock definitions from
> > the device tree to determine the correct clock sequencing.
> > This reduces hardcoded dependencies and improves the driver's maintainability.
> >
> > Cc: Thierry Reding <thierry.reding@xxxxxxxxx>
> > Cc: Jon Hunter <jonathanh@xxxxxxxxxx>
> > Signed-off-by: Anand Moon <linux.amoon@xxxxxxxxx>
> > ---
> > v1: Switch from devm_clk_bulk_get_all() -> devm_clk_bulk_get() with
> > fix clks array.
>
> why not use devm_clk_bulk_get_all()?
>
My RFC used this devm_clk_bulk_get_all() which could work for all the SoC,
However, Jon recommended switching to named clocks, following the
approach used in .
but Jon suggested to use clock names as per dwmac-tegra.c driver.
[0] https://lore.kernel.org/linux-tegra/8fac00fe-2ad4-4202-a6f2-c5043f7343f9@xxxxxxxxxx/
> Frank
Thanks
-Anand