[PATCH v4 1/2] clk: samsung: gs101: allow earlycon to work unconditionally

Stephen Boyd sboyd at kernel.org
Thu Jul 18 13:46:22 PDT 2024


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.



More information about the linux-arm-kernel mailing list