Skip to content

Commit 2b7a02c

Browse files
committed
clk: spacemit: prepare common ccu header
In order to prepare adding clock driver for new K3 SoC, extract generic code to a separate common ccu header file, so they are not defined in K1 SoC-specific file, and then can be shared by all clock drivers. Link: https://lore.kernel.org/r/20260108-06-k1-clk-common-v4-1-badf635993d3@gentoo.org Reviewed-by: Alex Elder <elder@riscstar.com> Signed-off-by: Yixun Lan <dlan@gentoo.org>
1 parent 8f0b4cc commit 2b7a02c

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

include/soc/spacemit/ccu.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
3+
#ifndef __SOC_SPACEMIT_CCU_H__
4+
#define __SOC_SPACEMIT_CCU_H__
5+
6+
#include <linux/auxiliary_bus.h>
7+
#include <linux/regmap.h>
8+
9+
/* Auxiliary device used to represent a CCU reset controller */
10+
struct spacemit_ccu_adev {
11+
struct auxiliary_device adev;
12+
struct regmap *regmap;
13+
};
14+
15+
static inline struct spacemit_ccu_adev *
16+
to_spacemit_ccu_adev(struct auxiliary_device *adev)
17+
{
18+
return container_of(adev, struct spacemit_ccu_adev, adev);
19+
}
20+
21+
#endif /* __SOC_SPACEMIT_CCU_H__ */

include/soc/spacemit/k1-syscon.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@
55
#ifndef __SOC_K1_SYSCON_H__
66
#define __SOC_K1_SYSCON_H__
77

8-
/* Auxiliary device used to represent a CCU reset controller */
9-
struct spacemit_ccu_adev {
10-
struct auxiliary_device adev;
11-
struct regmap *regmap;
12-
};
13-
14-
static inline struct spacemit_ccu_adev *
15-
to_spacemit_ccu_adev(struct auxiliary_device *adev)
16-
{
17-
return container_of(adev, struct spacemit_ccu_adev, adev);
18-
}
8+
#include "ccu.h"
199

2010
/* APBS register offset */
2111
#define APBS_PLL1_SWCR1 0x100

0 commit comments

Comments
 (0)