Skip to content

Commit a5e3f37

Browse files
ychuang3arndb
authored andcommitted
clk: nuvoton: Add clk-ma35d1.h for driver extern functions
Moved the declaration of extern functions ma35d1_reg_clk_pll() and ma35d1_reg_adc_clkdiv() from the .c files to the newly created header file clk-ma35d1.h. Signed-off-by: Jacky Huang <ychuang3@nuvoton.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 03bd158 commit a5e3f37

4 files changed

Lines changed: 24 additions & 16 deletions

File tree

drivers/clk/nuvoton/clk-ma35d1-divider.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <linux/regmap.h>
1010
#include <linux/spinlock.h>
1111

12+
#include "clk-ma35d1.h"
13+
1214
struct ma35d1_adc_clk_div {
1315
struct clk_hw hw;
1416
void __iomem *reg;
@@ -20,11 +22,6 @@ struct ma35d1_adc_clk_div {
2022
spinlock_t *lock;
2123
};
2224

23-
struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name,
24-
struct clk_hw *parent_hw, spinlock_t *lock,
25-
unsigned long flags, void __iomem *reg,
26-
u8 shift, u8 width, u32 mask_bit);
27-
2825
static inline struct ma35d1_adc_clk_div *to_ma35d1_adc_clk_div(struct clk_hw *_hw)
2926
{
3027
return container_of(_hw, struct ma35d1_adc_clk_div, hw);

drivers/clk/nuvoton/clk-ma35d1-pll.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <linux/units.h>
1616
#include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
1717

18+
#include "clk-ma35d1.h"
19+
1820
/* PLL frequency limits */
1921
#define PLL_FREF_MAX_FREQ (200 * HZ_PER_MHZ)
2022
#define PLL_FREF_MIN_FREQ (1 * HZ_PER_MHZ)
@@ -71,9 +73,6 @@ struct ma35d1_clk_pll {
7173
void __iomem *ctl2_base;
7274
};
7375

74-
struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name,
75-
struct clk_hw *parent_hw, void __iomem *base);
76-
7776
static inline struct ma35d1_clk_pll *to_ma35d1_clk_pll(struct clk_hw *_hw)
7877
{
7978
return container_of(_hw, struct ma35d1_clk_pll, hw);

drivers/clk/nuvoton/clk-ma35d1.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <linux/spinlock.h>
1313
#include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
1414

15+
#include "clk-ma35d1.h"
16+
1517
static DEFINE_SPINLOCK(ma35d1_lock);
1618

1719
#define PLL_MAX_NUM 5
@@ -60,14 +62,6 @@ static DEFINE_SPINLOCK(ma35d1_lock);
6062
#define PLL_MODE_FRAC 1
6163
#define PLL_MODE_SS 2
6264

63-
struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode,
64-
const char *name, struct clk_hw *parent_hw,
65-
void __iomem *base);
66-
struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name,
67-
struct clk_hw *hw, spinlock_t *lock,
68-
unsigned long flags, void __iomem *reg,
69-
u8 shift, u8 width, u32 mask_bit);
70-
7165
static const struct clk_parent_data ca35clk_sel_clks[] = {
7266
{ .index = 0 }, /* HXT */
7367
{ .index = 1 }, /* CAPLL */

drivers/clk/nuvoton/clk-ma35d1.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright (C) 2023 Nuvoton Technology Corp.
4+
* Author: Chi-Fang Li <cfli0@nuvoton.com>
5+
*/
6+
7+
#ifndef __DRV_CLK_NUVOTON_MA35D1_H
8+
#define __DRV_CLK_NUVOTON_MA35D1_H
9+
10+
struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name,
11+
struct clk_hw *parent_hw, void __iomem *base);
12+
13+
struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name,
14+
struct clk_hw *parent_hw, spinlock_t *lock,
15+
unsigned long flags, void __iomem *reg,
16+
u8 shift, u8 width, u32 mask_bit);
17+
18+
#endif /* __DRV_CLK_NUVOTON_MA35D1_H */

0 commit comments

Comments
 (0)