Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 //
0003 // Spreadtrum clock infrastructure
0004 //
0005 // Copyright (C) 2017 Spreadtrum, Inc.
0006 // Author: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
0007 
0008 #ifndef _SPRD_CLK_COMMON_H_
0009 #define _SPRD_CLK_COMMON_H_
0010 
0011 #include <linux/clk-provider.h>
0012 #include <linux/of_platform.h>
0013 #include <linux/regmap.h>
0014 
0015 struct device_node;
0016 
0017 struct sprd_clk_common {
0018     struct regmap   *regmap;
0019     u32     reg;
0020     struct clk_hw   hw;
0021 };
0022 
0023 struct sprd_clk_desc {
0024     struct sprd_clk_common      **clk_clks;
0025     unsigned long           num_clk_clks;
0026     struct clk_hw_onecell_data      *hw_clks;
0027 };
0028 
0029 static inline struct sprd_clk_common *
0030     hw_to_sprd_clk_common(const struct clk_hw *hw)
0031 {
0032     return container_of(hw, struct sprd_clk_common, hw);
0033 }
0034 int sprd_clk_regmap_init(struct platform_device *pdev,
0035              const struct sprd_clk_desc *desc);
0036 int sprd_clk_probe(struct device *dev, struct clk_hw_onecell_data *clkhw);
0037 
0038 #endif /* _SPRD_CLK_COMMON_H_ */