owl-common.h 959 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. };
  25. static inline struct owl_clk_common *
  26. hw_to_owl_clk_common(const struct clk_hw *hw)
  27. {
  28. return container_of(hw, struct owl_clk_common, hw);
  29. }
  30. int owl_clk_regmap_init(struct platform_device *pdev,
  31. const struct owl_clk_desc *desc);
  32. int owl_clk_probe(struct device *dev, struct clk_hw_onecell_data *hw_clks);
  33. #endif /* _OWL_COMMON_H_ */