Re: [PATCH v3 06/11] clk: tegra: remove EMC to MC clock mux in Tegra114

From: Svyatoslav Ryhel

Date: Thu Nov 13 2025 - 09:21:37 EST


нд, 21 вер. 2025 р. о 20:54 Stephen Boyd <sboyd@xxxxxxxxxx> пише:
>
> Quoting Svyatoslav Ryhel (2025-09-15 01:01:52)
> > diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
> > index 8bde72aa5e68..6b3a140772c2 100644
> > --- a/drivers/clk/tegra/clk-tegra114.c
> > +++ b/drivers/clk/tegra/clk-tegra114.c
> > @@ -1321,6 +1309,28 @@ static int tegra114_reset_deassert(unsigned long id)
> > return 0;
> > }
> >
> > +#ifdef CONFIG_TEGRA124_CLK_EMC
> > +static struct clk *tegra114_clk_src_onecell_get(struct of_phandle_args *clkspec,
> > + void *data)
> > +{
> > + struct clk_hw *hw;
> > + struct clk *clk;
> > +
> > + clk = of_clk_src_onecell_get(clkspec, data);
> > + if (IS_ERR(clk))
> > + return clk;
> > +
> > + hw = __clk_get_hw(clk);
>
> Can you just use of_clk_hw_onecell_get() instead? Then we don't need to
> use __clk_get_hw(). Or is this whole function used to return a clk
> pointer to something that isn't the clk framework?
>

This logic was adopted from Tegra124 driver, but of_clk_hw_onecell_get
might be applicable. I will adjust to use it and if all works as
expected, I will apply it in v4. Thank you.

> > +
> > + if (clkspec->args[0] == TEGRA114_CLK_EMC) {
> > + if (!tegra124_clk_emc_driver_available(hw))
> > + return ERR_PTR(-EPROBE_DEFER);
> > + }
> > +
> > + return clk;