2023-06-22 14:29:21

by Jacky Huang

[permalink] [raw]
Subject: [PATCH v3 0/3] clk: nuvoton: Use clk_parent_data instead and add a header file

From: Jacky Huang <[email protected]>

This set of patches addresses some of the issues that were identified in
the ma35d1 clock driver.

1. The external functions referenced between the .c files in this driver
should not be declared within the .c files themselves. Instead, a shared
.h file should be created to reference them.

2. Update all constant hex values written in uppercase to be lowercase.

3. For the declaration of parent clocks, use struct clk_parent_data instead
of a string. Due to the change in the passed arguments, replace the usage
of devm_clk_hw_register_mux() with clk_hw_register_mux_parent_data() for
all cases.

v3:
- Extract the unrelated parts from patch 1/3 and create another patch,
patch 2/3.
- In patch 3/3, remove the modifications about line reformatting, as they
irrelevant and have no practical effect.

v2:
- In v1, all these modifications were included in a single patch, which is
not ideal. In v2, there were no changes made to the patch content itself,
but the different modification topics were separated into two individual
patches


Jacky Huang (3):
clk: nuvoton: Add clk-ma35d1.h for driver extern functions
clk: nuvoton: Update all constant hex values to lowercase
clk: nuvoton: Use clk_parent_data instead of string for parent clock

drivers/clk/nuvoton/clk-ma35d1-divider.c | 7 +-
drivers/clk/nuvoton/clk-ma35d1-pll.c | 5 +-
drivers/clk/nuvoton/clk-ma35d1.c | 348 +++++++++++++++--------
drivers/clk/nuvoton/clk-ma35d1.h | 18 ++
4 files changed, 259 insertions(+), 119 deletions(-)
create mode 100644 drivers/clk/nuvoton/clk-ma35d1.h

--
2.34.1



2023-06-22 14:29:26

by Jacky Huang

[permalink] [raw]
Subject: [PATCH v3 2/3] clk: nuvoton: Update all constant hex values to lowercase

From: Jacky Huang <[email protected]>

The constant hex values used to define register offsets were written
in uppercase. This patch update all these constant hex values to
be lowercase.

Signed-off-by: Jacky Huang <[email protected]>
---
drivers/clk/nuvoton/clk-ma35d1.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/nuvoton/clk-ma35d1.c b/drivers/clk/nuvoton/clk-ma35d1.c
index 8dfa762494fe..733750dda0f4 100644
--- a/drivers/clk/nuvoton/clk-ma35d1.c
+++ b/drivers/clk/nuvoton/clk-ma35d1.c
@@ -22,19 +22,19 @@ static DEFINE_SPINLOCK(ma35d1_lock);
#define REG_CLK_PWRCTL 0x00
#define REG_CLK_SYSCLK0 0x04
#define REG_CLK_SYSCLK1 0x08
-#define REG_CLK_APBCLK0 0x0C
+#define REG_CLK_APBCLK0 0x0c
#define REG_CLK_APBCLK1 0x10
#define REG_CLK_APBCLK2 0x14
#define REG_CLK_CLKSEL0 0x18
-#define REG_CLK_CLKSEL1 0x1C
+#define REG_CLK_CLKSEL1 0x1c
#define REG_CLK_CLKSEL2 0x20
#define REG_CLK_CLKSEL3 0x24
#define REG_CLK_CLKSEL4 0x28
-#define REG_CLK_CLKDIV0 0x2C
+#define REG_CLK_CLKDIV0 0x2c
#define REG_CLK_CLKDIV1 0x30
#define REG_CLK_CLKDIV2 0x34
#define REG_CLK_CLKDIV3 0x38
-#define REG_CLK_CLKDIV4 0x3C
+#define REG_CLK_CLKDIV4 0x3c
#define REG_CLK_CLKOCTL 0x40
#define REG_CLK_STATUS 0x50
#define REG_CLK_PLL0CTL0 0x60
@@ -44,18 +44,18 @@ static DEFINE_SPINLOCK(ma35d1_lock);
#define REG_CLK_PLL3CTL0 0x90
#define REG_CLK_PLL3CTL1 0x94
#define REG_CLK_PLL3CTL2 0x98
-#define REG_CLK_PLL4CTL0 0xA0
-#define REG_CLK_PLL4CTL1 0xA4
-#define REG_CLK_PLL4CTL2 0xA8
-#define REG_CLK_PLL5CTL0 0xB0
-#define REG_CLK_PLL5CTL1 0xB4
-#define REG_CLK_PLL5CTL2 0xB8
-#define REG_CLK_CLKDCTL 0xC0
-#define REG_CLK_CLKDSTS 0xC4
-#define REG_CLK_CDUPB 0xC8
-#define REG_CLK_CDLOWB 0xCC
-#define REG_CLK_CKFLTRCTL 0xD0
-#define REG_CLK_TESTCLK 0xF0
+#define REG_CLK_PLL4CTL0 0xa0
+#define REG_CLK_PLL4CTL1 0xa4
+#define REG_CLK_PLL4CTL2 0xa8
+#define REG_CLK_PLL5CTL0 0xb0
+#define REG_CLK_PLL5CTL1 0xb4
+#define REG_CLK_PLL5CTL2 0xb8
+#define REG_CLK_CLKDCTL 0xc0
+#define REG_CLK_CLKDSTS 0xc4
+#define REG_CLK_CDUPB 0xc8
+#define REG_CLK_CDLOWB 0xcc
+#define REG_CLK_CKFLTRCTL 0xd0
+#define REG_CLK_TESTCLK 0xf0
#define REG_CLK_PLLCTL 0x40

#define PLL_MODE_INT 0
--
2.34.1


2023-06-22 15:43:27

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] clk: nuvoton: Use clk_parent_data instead and add a header file

On Thu, Jun 22, 2023, at 16:13, Jacky Huang wrote:
> From: Jacky Huang <[email protected]>
>
> This set of patches addresses some of the issues that were identified in
> the ma35d1 clock driver.
>

I've gone ahead and applied all three now, on top of the soc/newsoc
branch. If any other issues come up, please send patches relative
to that.

Thanks,

Arnd