[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2c2b51d30f551bf8a9c1fb6507301bb.sboyd@kernel.org>
Date: Thu, 18 Jul 2024 13:46:22 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Alim Akhtar <alim.akhtar@...sung.com>, André Draszik <andre.draszik@...aro.org>, Chanwoo Choi <cw00.choi@...sung.com>, Krzysztof Kozlowski <krzk@...nel.org>, Michael Turquette <mturquette@...libre.com>, Peter Griffin <peter.griffin@...aro.org>, Sam Protsenko <semen.protsenko@...aro.org>, Sylwester Nawrocki <s.nawrocki@...sung.com>, Tudor Ambarus <tudor.ambarus@...aro.org>
Cc: Tudor Ambarus <tudor.ambarus@...aro.org>, Will McVicker <willmcvicker@...gle.com>, kernel-team@...roid.com, linux-arm-kernel@...ts.infradead.org, linux-samsung-soc@...r.kernel.org, linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, André Draszik <andre.draszik@...aro.org>
Subject: Re: [PATCH v4 1/2] clk: samsung: gs101: allow earlycon to work unconditionally
Quoting André Draszik (2024-07-12 10:09:43)
> diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c
> index 85098c61c15e..429690757923 100644
> --- a/drivers/clk/samsung/clk-gs101.c
> +++ b/drivers/clk/samsung/clk-gs101.c
> @@ -4381,6 +4386,99 @@ static const struct samsung_cmu_info peric1_cmu_info __initconst = {
>
> /* ---- platform_driver ----------------------------------------------------- */
>
> +static struct {
> + struct mutex lock;
> +
> + bool bump_refs;
> +
> + struct clk **clks;
> + size_t n_clks;
> +} gs101_stdout_clks __initdata = {
> + .lock = __MUTEX_INITIALIZER(gs101_stdout_clks.lock),
> +};
> +
> +static int __init gs101_keep_uart_clocks_param(char *str)
> +{
> + gs101_stdout_clks.bump_refs = true;
> + return 0;
> +}
> +early_param("earlycon", gs101_keep_uart_clocks_param);
> +
> +static void __init gs101_bump_uart_clock_references(void)
> +{
> + size_t n_clks;
> +
> + /* We only support device trees - do nothing if not available. */
> + if (!IS_ENABLED(CONFIG_OF))
> + return;
> +
> + n_clks = of_clk_get_parent_count(of_stdout);
> + if (!n_clks || !of_stdout)
> + return;
I don't see anything in here that's driver specific. Please move this to
the clk framework, hook something like of_clk_add_provider() similar to
how of_clk_set_defaults(), and have it look at the of_stdout node for
'clocks' to munge the clks in the core framework for the serial console.
Powered by blists - more mailing lists