1 // SPDX-License-Identifier: GPL-2.0
3 // Spreadtrum clock infrastructure
5 // Copyright (C) 2017 Spreadtrum, Inc.
6 // Author: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
8 #ifndef _SPRD_CLK_COMMON_H_
9 #define _SPRD_CLK_COMMON_H_
11 #include <linux/clk-provider.h>
12 #include <linux/of_platform.h>
13 #include <linux/regmap.h>
17 struct sprd_clk_common
{
18 struct regmap
*regmap
;
23 struct sprd_clk_desc
{
24 struct sprd_clk_common
**clk_clks
;
25 unsigned long num_clk_clks
;
26 struct clk_hw_onecell_data
*hw_clks
;
29 static inline struct sprd_clk_common
*
30 hw_to_sprd_clk_common(const struct clk_hw
*hw
)
32 return container_of(hw
, struct sprd_clk_common
, hw
);
34 int sprd_clk_regmap_init(struct platform_device
*pdev
,
35 const struct sprd_clk_desc
*desc
);
36 int sprd_clk_probe(struct device
*dev
, struct clk_hw_onecell_data
*clkhw
);
38 #endif /* _SPRD_CLK_COMMON_H_ */