Skip to contentSkip to conversation

clk: imx: Remove __init for imx_register_uart_clocks() API

PATCH Applied [email protected] 2 participants 3 messages Jun 19, 2019 – Jun 24, 2019

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 clk: imx: Remove __init for imx_register_uart_clocks() API

From: Anson Huang <[email protected]>

Some of i.MX SoCs' clock driver use platform driver model, and they need to call imx_register_uart_clocks() API, so imx_register_uart_clocks() API should NOT be in .init section.

---
 drivers/clk/imx/clk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/imx/clk.c +3 -3
index f241189..76457b2 100644
@@ -123,8 +123,8 @@ void imx_cscmr1_fixup(u32 *val)
 	return;
 }
 
-static int imx_keep_uart_clocks __initdata;
-static struct clk ** const *imx_uart_clocks __initdata;
+static int imx_keep_uart_clocks;
+static struct clk ** const *imx_uart_clocks;
 
 static int __init imx_keep_uart_clocks_param(char *str)
 {
@@ -137,7 +137,7 @@ __setup_param("earlycon", imx_keep_uart_earlycon,
 __setup_param("earlyprintk", imx_keep_uart_earlyprintk,
 	      imx_keep_uart_clocks_param, 0);
 
-void __init imx_register_uart_clocks(struct clk ** const clks[])
+void imx_register_uart_clocks(struct clk ** const clks[])
 {
 	if (imx_keep_uart_clocks) {
 		int i;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 clk: imx8mq: Keep uart clocks on during system boot

From: Anson Huang <[email protected]>

Call imx_register_uart_clocks() API to keep uart clocks enabled when earlyprintk or earlycon is active.

---
 drivers/clk/imx/clk-imx8mq.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/clk/imx/clk-imx8mq.c +10 -0
index 5fbc2a7..d407a07 100644
@@ -272,6 +272,14 @@ static const char * const imx8mq_clko2_sels[] = {"osc_25m", "sys2_pll_200m", "sy
 
 static struct clk_onecell_data clk_data;
 
+static struct clk ** const uart_clks[] = {
+	&clks[IMX8MQ_CLK_UART1_ROOT],
+	&clks[IMX8MQ_CLK_UART2_ROOT],
+	&clks[IMX8MQ_CLK_UART3_ROOT],
+	&clks[IMX8MQ_CLK_UART4_ROOT],
+	NULL
+};
+
 static int imx8mq_clocks_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -555,6 +563,8 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
 	err = of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
 	WARN_ON(err);
 
+	imx_register_uart_clocks(uart_clks);
+
 	return err;
 }
 
Signature · 1 line
2.7.4