owl-common.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  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. #ifndef _OWL_COMMON_H_
  11. #define _OWL_COMMON_H_
  12. #include <linux/clk-provider.h>
  13. #include <linux/of_platform.h>
  14. #include <linux/regmap.h>
  15. struct device_node;
  16. struct owl_clk_common {
  17. struct regmap *regmap;
  18. struct clk_hw hw;
  19. };
  20. struct owl_clk_desc {
  21. struct owl_clk_common **clks;
  22. unsigned long num_clks;
  23. struct clk_hw_onecell_data *hw_clks;
  24. const struct owl_reset_map *resets;
  25. unsigned long num_resets;
  26. struct regmap *regmap;
  27. };
  28. static inline struct owl_clk_common *
  29. hw_to_owl_clk_common(const struct clk_hw *hw)
  30. {
  31. return container_of(hw, struct owl_clk_common, hw);
  32. }
  33. int owl_clk_regmap_init(struct platform_device *pdev,
  34. struct owl_clk_desc *desc);
  35. int owl_clk_probe(struct device *dev, struct clk_hw_onecell_data *hw_clks);
  36. #endif /* _OWL_COMMON_H_ */