diff mbox

[v2,2/8] clk: imx25: retain early UART clocks during kernel init

Message ID 1441382419-4343-3-git-send-email-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Stach Sept. 4, 2015, 4 p.m. UTC
Make sure to keep UART clocks enabled during kernel init if
earlyprintk or earlycon are active.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/clk/imx/clk-imx25.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Shawn Guo Sept. 6, 2015, 2:23 p.m. UTC | #1
On Fri, Sep 04, 2015 at 06:00:13PM +0200, Lucas Stach wrote:
> Make sure to keep UART clocks enabled during kernel init if
> earlyprintk or earlycon are active.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/clk/imx/clk-imx25.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-imx25.c b/drivers/clk/imx/clk-imx25.c
> index ec1a4c1dacf1..e55acea762fb 100644
> --- a/drivers/clk/imx/clk-imx25.c
> +++ b/drivers/clk/imx/clk-imx25.c
> @@ -86,6 +86,14 @@ enum mx25_clks {
>  
>  static struct clk *clk[clk_max];
>  
> +static struct clk **uart_clks[] __initdata = { &clk[uart_ipg_per],
> +					       &clk[uart1_ipg],
> +					       &clk[uart2_ipg],
> +					       &clk[uart3_ipg],
> +					       &clk[uart4_ipg],
> +					       &clk[uart5_ipg],
> +					       NULL };
> +

I prefer to code it like:

static struct clk **uart_clks[] __initdata = {
	&clk[uart_ipg_per],
	&clk[uart1_ipg],
	&clk[uart2_ipg],
	&clk[uart3_ipg],
	&clk[uart4_ipg],
	&clk[uart5_ipg],
	NULL
};

Other than that, I'm fine with the series.

Shawn

>  static int __init __mx25_clocks_init(unsigned long osc_rate,
>  				     void __iomem *ccm_base)
>  {
> @@ -233,6 +241,8 @@ static int __init __mx25_clocks_init(unsigned long osc_rate,
>  	 */
>  	clk_set_parent(clk[cko_sel], clk[ipg]);
>  
> +	imx_register_uart_clocks(uart_clks);
> +
>  	return 0;
>  }
>  
> -- 
> 2.5.0
>
Uwe Kleine-König Sept. 7, 2015, 9:10 a.m. UTC | #2
On Sun, Sep 06, 2015 at 10:23:15PM +0800, Shawn Guo wrote:
> 
> I prefer to code it like:
> 
> static struct clk **uart_clks[] __initdata = {
> 	&clk[uart_ipg_per],
> 	&clk[uart1_ipg],
> 	&clk[uart2_ipg],
> 	&clk[uart3_ipg],
> 	&clk[uart4_ipg],
> 	&clk[uart5_ipg],
> 	NULL
> };

And maybe also use mx25_ as prefix to make the name unique.

Best regards
Uwe
Lucas Stach Sept. 7, 2015, 9:18 a.m. UTC | #3
Am Montag, den 07.09.2015, 11:10 +0200 schrieb Uwe Kleine-König:
> On Sun, Sep 06, 2015 at 10:23:15PM +0800, Shawn Guo wrote:
> > 
> > I prefer to code it like:
> > 
> > static struct clk **uart_clks[] __initdata = {
> > 	&clk[uart_ipg_per],
> > 	&clk[uart1_ipg],
> > 	&clk[uart2_ipg],
> > 	&clk[uart3_ipg],
> > 	&clk[uart4_ipg],
> > 	&clk[uart5_ipg],
> > 	NULL
> > };
> 
> And maybe also use mx25_ as prefix to make the name unique.
> 
We already have a lot of non-unique names in those files. As this is a
static variable it will not leak into other compilation units, so I
prefer to keep the current style of the file.

Regards,
Lucas
diff mbox

Patch

diff --git a/drivers/clk/imx/clk-imx25.c b/drivers/clk/imx/clk-imx25.c
index ec1a4c1dacf1..e55acea762fb 100644
--- a/drivers/clk/imx/clk-imx25.c
+++ b/drivers/clk/imx/clk-imx25.c
@@ -86,6 +86,14 @@  enum mx25_clks {
 
 static struct clk *clk[clk_max];
 
+static struct clk **uart_clks[] __initdata = { &clk[uart_ipg_per],
+					       &clk[uart1_ipg],
+					       &clk[uart2_ipg],
+					       &clk[uart3_ipg],
+					       &clk[uart4_ipg],
+					       &clk[uart5_ipg],
+					       NULL };
+
 static int __init __mx25_clocks_init(unsigned long osc_rate,
 				     void __iomem *ccm_base)
 {
@@ -233,6 +241,8 @@  static int __init __mx25_clocks_init(unsigned long osc_rate,
 	 */
 	clk_set_parent(clk[cko_sel], clk[ipg]);
 
+	imx_register_uart_clocks(uart_clks);
+
 	return 0;
 }