Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 //
0003 // OWL common clock driver
0004 //
0005 // Copyright (c) 2014 Actions Semi Inc.
0006 // Author: David Liu <liuwei@actions-semi.com>
0007 //
0008 // Copyright (c) 2018 Linaro Ltd.
0009 // Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
0010 
0011 #ifndef _OWL_COMMON_H_
0012 #define _OWL_COMMON_H_
0013 
0014 #include <linux/clk-provider.h>
0015 #include <linux/of_platform.h>
0016 #include <linux/regmap.h>
0017 
0018 struct device_node;
0019 
0020 struct owl_clk_common {
0021     struct regmap           *regmap;
0022     struct clk_hw           hw;
0023 };
0024 
0025 struct owl_clk_desc {
0026     struct owl_clk_common       **clks;
0027     unsigned long           num_clks;
0028     struct clk_hw_onecell_data  *hw_clks;
0029     const struct owl_reset_map  *resets;
0030     unsigned long           num_resets;
0031     struct regmap           *regmap;
0032 };
0033 
0034 static inline struct owl_clk_common *
0035     hw_to_owl_clk_common(const struct clk_hw *hw)
0036 {
0037     return container_of(hw, struct owl_clk_common, hw);
0038 }
0039 
0040 int owl_clk_regmap_init(struct platform_device *pdev,
0041             struct owl_clk_desc *desc);
0042 int owl_clk_probe(struct device *dev, struct clk_hw_onecell_data *hw_clks);
0043 
0044 #endif /* _OWL_COMMON_H_ */