Skip to content

Commit a36bda7

Browse files
Sam Protsenkokrzk
authored andcommitted
clk: samsung: Pull struct exynos_cpuclk into clk-cpu.c
Reduce the scope of struct exynos_cpuclk, as it's only used in clk-cpu.c internally. All drivers using clk-pll.h already include clk.h as well, so this change doesn't break anything. No functional change. Signed-off-by: Sam Protsenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent f707e89 commit a36bda7

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

drivers/clk/samsung/clk-cpu.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include <linux/slab.h>
3535
#include <linux/clk.h>
3636
#include <linux/clk-provider.h>
37+
38+
#include "clk.h"
3739
#include "clk-cpu.h"
3840

3941
#define E4210_SRC_CPU 0x0
@@ -64,6 +66,33 @@
6466
#define DIV_MASK_ALL GENMASK(31, 0)
6567
#define MUX_MASK GENMASK(2, 0)
6668

69+
/**
70+
* struct exynos_cpuclk - information about clock supplied to a CPU core
71+
* @hw: handle between CCF and CPU clock
72+
* @alt_parent: alternate parent clock to use when switching the speed
73+
* of the primary parent clock
74+
* @ctrl_base: base address of the clock controller
75+
* @lock: cpu clock domain register access lock
76+
* @cfg: cpu clock rate configuration data
77+
* @num_cfgs: number of array elements in @cfg array
78+
* @clk_nb: clock notifier registered for changes in clock speed of the
79+
* primary parent clock
80+
* @flags: configuration flags for the CPU clock
81+
*
82+
* This structure holds information required for programming the CPU clock for
83+
* various clock speeds.
84+
*/
85+
struct exynos_cpuclk {
86+
struct clk_hw hw;
87+
const struct clk_hw *alt_parent;
88+
void __iomem *ctrl_base;
89+
spinlock_t *lock;
90+
const struct exynos_cpuclk_cfg_data *cfg;
91+
const unsigned long num_cfgs;
92+
struct notifier_block clk_nb;
93+
unsigned long flags;
94+
};
95+
6796
/*
6897
* Helper function to wait until divider(s) have stabilized after the divider
6998
* value has changed.

drivers/clk/samsung/clk-cpu.h

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
#ifndef __SAMSUNG_CLK_CPU_H
99
#define __SAMSUNG_CLK_CPU_H
1010

11-
#include "clk.h"
11+
/* The CPU clock registers have DIV1 configuration register */
12+
#define CLK_CPU_HAS_DIV1 BIT(0)
13+
/* When ALT parent is active, debug clocks need safe divider values */
14+
#define CLK_CPU_NEEDS_DEBUG_ALT_DIV BIT(1)
15+
/* The CPU clock registers have Exynos5433-compatible layout */
16+
#define CLK_CPU_HAS_E5433_REGS_LAYOUT BIT(2)
1217

1318
/**
1419
* struct exynos_cpuclk_cfg_data - config data to setup cpu clocks
@@ -28,38 +33,4 @@ struct exynos_cpuclk_cfg_data {
2833
unsigned long div1;
2934
};
3035

31-
/**
32-
* struct exynos_cpuclk - information about clock supplied to a CPU core
33-
* @hw: handle between CCF and CPU clock
34-
* @alt_parent: alternate parent clock to use when switching the speed
35-
* of the primary parent clock
36-
* @ctrl_base: base address of the clock controller
37-
* @lock: cpu clock domain register access lock
38-
* @cfg: cpu clock rate configuration data
39-
* @num_cfgs: number of array elements in @cfg array
40-
* @clk_nb: clock notifier registered for changes in clock speed of the
41-
* primary parent clock
42-
* @flags: configuration flags for the CPU clock
43-
*
44-
* This structure holds information required for programming the CPU clock for
45-
* various clock speeds.
46-
*/
47-
struct exynos_cpuclk {
48-
struct clk_hw hw;
49-
const struct clk_hw *alt_parent;
50-
void __iomem *ctrl_base;
51-
spinlock_t *lock;
52-
const struct exynos_cpuclk_cfg_data *cfg;
53-
const unsigned long num_cfgs;
54-
struct notifier_block clk_nb;
55-
unsigned long flags;
56-
57-
/* The CPU clock registers have DIV1 configuration register */
58-
#define CLK_CPU_HAS_DIV1 (1 << 0)
59-
/* When ALT parent is active, debug clocks need safe divider values */
60-
#define CLK_CPU_NEEDS_DEBUG_ALT_DIV (1 << 1)
61-
/* The CPU clock registers have Exynos5433-compatible layout */
62-
#define CLK_CPU_HAS_E5433_REGS_LAYOUT (1 << 2)
63-
};
64-
6536
#endif /* __SAMSUNG_CLK_CPU_H */

0 commit comments

Comments
 (0)