RE: [PATCH V9 2/7] clk: imx: add scu clock common part
From: Aisheng Dong <aisheng.dong@nxp.com>
Date: 2018-12-11 03:35:54
Also in:
linux-clk
-----Original Message----- From: Stephen Boyd [mailto:sboyd@kernel.org] Quoting Aisheng DONG (2018-12-04 06:39:25)quoted
diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index43a3ecc..63e7b01 100644--- a/drivers/clk/imx/Kconfig +++ b/drivers/clk/imx/Kconfig@@ -3,3 +3,7 @@ config MXC_CLK bool depends on ARCH_MXC + +config MXC_CLK_SCUIs there any reason to make this a hidden option instead of making it a selectable option? It can still depend on ARCH_MXC and ARM64, but otherwise it should be compilable as long as CONFIG_IMX_SCU is defined (this should also be a config we depend on here).
This is mostly following the exist using that CLK is selected by SoC config option. https://patchwork.kernel.org/patch/10677309/ As CLK usually is required for platform to run well, so we did not make it selectable.
quoted
+ bool + depends on ARCH_MXC && ARM64diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile indexf850424..4abed37 100644--- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile@@ -20,6 +20,9 @@ obj-$(CONFIG_MXC_CLK) += \ clk-pllv4.o \ clk-sccg-pll.o +obj-$(CONFIG_MXC_CLK_SCU) += \ + clk-scu.o + obj-$(CONFIG_SOC_IMX1) += clk-imx1.o obj-$(CONFIG_SOC_IMX21) += clk-imx21.o obj-$(CONFIG_SOC_IMX25) += clk-imx25.o diff --gita/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c new file mode 100644 index 0000000..ec8a471--- /dev/null +++ b/drivers/clk/imx/clk-scu.c@@ -0,0 +1,265 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2018 NXP + * Dong Aisheng <aisheng.dong@nxp.com> + */ + +#include <linux/clk-provider.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "clk-scu.h" + +struct imx_sc_ipc *ccm_ipc_handle;Why does this need to be a global? Can it be in each clk_scu instance instead?
No, no need to be in each clk_scu instance. There's only one handler.
quoted
+diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h newfile mode 100644 index 0000000..09f381b--- /dev/null +++ b/drivers/clk/imx/clk-scu.h@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2018 NXP + * Dong Aisheng <aisheng.dong@nxp.com> + */ + +#ifndef __IMX_CLK_SCU_H +#define __IMX_CLK_SCU_H + +#include <linux/firmware/imx/sci.h> + +extern struct imx_sc_ipc *ccm_ipc_handle; + +static inline int imx_clk_scu_init(void) { + return imx_scu_get_handle(&ccm_ipc_handle);And then this can be implemented in the C driver so that ccm_ipc_handle doesn't need to be exported into the header file?
Looks like a good suggestion. I will take this as there's no other users of ccm_ipc_handle now, so no need in headfile. Thanks Regards Dong Aisheng _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel