clk-regmap.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2014, The Linux Foundation. All rights reserved. */
  3. #ifndef __QCOM_CLK_REGMAP_H__
  4. #define __QCOM_CLK_REGMAP_H__
  5. #include <linux/clk-provider.h>
  6. struct regmap;
  7. /**
  8. * struct clk_regmap - regmap supporting clock
  9. * @hw: handle between common and hardware-specific interfaces
  10. * @regmap: regmap to use for regmap helpers and/or by providers
  11. * @enable_reg: register when using regmap enable/disable ops
  12. * @enable_mask: mask when using regmap enable/disable ops
  13. * @enable_is_inverted: flag to indicate set enable_mask bits to disable
  14. * when using clock_enable_regmap and friends APIs.
  15. */
  16. struct clk_regmap {
  17. struct clk_hw hw;
  18. struct regmap *regmap;
  19. unsigned int enable_reg;
  20. unsigned int enable_mask;
  21. bool enable_is_inverted;
  22. };
  23. static inline struct clk_regmap *to_clk_regmap(struct clk_hw *hw)
  24. {
  25. return container_of(hw, struct clk_regmap, hw);
  26. }
  27. int clk_is_enabled_regmap(struct clk_hw *hw);
  28. int clk_enable_regmap(struct clk_hw *hw);
  29. void clk_disable_regmap(struct clk_hw *hw);
  30. int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk);
  31. #endif