Nishad Kamdar | ddd3e8b | 2019-05-01 12:37:11 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Manivannan Sadhasivam | 3495e29 | 2018-03-26 23:08:57 +0530 | [diff] [blame] | 2 | // |
| 3 | // OWL common clock driver |
| 4 | // |
| 5 | // Copyright (c) 2014 Actions Semi Inc. |
| 6 | // Author: David Liu <liuwei@actions-semi.com> |
| 7 | // |
| 8 | // Copyright (c) 2018 Linaro Ltd. |
| 9 | // Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
| 10 | |
| 11 | #ifndef _OWL_COMMON_H_ |
| 12 | #define _OWL_COMMON_H_ |
| 13 | |
| 14 | #include <linux/clk-provider.h> |
Manivannan Sadhasivam | 3495e29 | 2018-03-26 23:08:57 +0530 | [diff] [blame] | 15 | #include <linux/regmap.h> |
| 16 | |
| 17 | struct device_node; |
Rob Herring | a96cbb1 | 2023-07-18 08:31:43 -0600 | [diff] [blame] | 18 | struct platform_device; |
Manivannan Sadhasivam | 3495e29 | 2018-03-26 23:08:57 +0530 | [diff] [blame] | 19 | |
| 20 | struct owl_clk_common { |
| 21 | struct regmap *regmap; |
| 22 | struct clk_hw hw; |
| 23 | }; |
| 24 | |
| 25 | struct owl_clk_desc { |
| 26 | struct owl_clk_common **clks; |
| 27 | unsigned long num_clks; |
| 28 | struct clk_hw_onecell_data *hw_clks; |
Manivannan Sadhasivam | 09dbde0 | 2018-08-10 15:21:11 +0530 | [diff] [blame] | 29 | const struct owl_reset_map *resets; |
| 30 | unsigned long num_resets; |
Manivannan Sadhasivam | 3a23eb7 | 2018-08-10 15:21:05 +0530 | [diff] [blame] | 31 | struct regmap *regmap; |
Manivannan Sadhasivam | 3495e29 | 2018-03-26 23:08:57 +0530 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | static inline struct owl_clk_common * |
| 35 | hw_to_owl_clk_common(const struct clk_hw *hw) |
| 36 | { |
| 37 | return container_of(hw, struct owl_clk_common, hw); |
| 38 | } |
| 39 | |
| 40 | int owl_clk_regmap_init(struct platform_device *pdev, |
Manivannan Sadhasivam | 3a23eb7 | 2018-08-10 15:21:05 +0530 | [diff] [blame] | 41 | struct owl_clk_desc *desc); |
Manivannan Sadhasivam | 3495e29 | 2018-03-26 23:08:57 +0530 | [diff] [blame] | 42 | int owl_clk_probe(struct device *dev, struct clk_hw_onecell_data *hw_clks); |
| 43 | |
| 44 | #endif /* _OWL_COMMON_H_ */ |