clk-gate.h 623 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2022 Alibaba Group Holding Limited.
  4. */
  5. #ifndef CLK_GATE_H
  6. #define CLK_GATE_H
  7. #include <linux/clk-provider.h>
  8. #include <linux/mfd/syscon.h>
  9. enum clk_gate_type {
  10. GATE_NOT_SHARED,
  11. GATE_SHARED,
  12. };
  13. struct thead_clk_gate {
  14. struct clk_hw hw;
  15. struct regmap *regmap;
  16. u32 offset;
  17. u8 bit;
  18. bool shared;
  19. u32 *share_count;
  20. };
  21. struct clk *thead_gate_clk_register(const char *name,
  22. const char *parent_name,
  23. struct regmap *regmap,
  24. int offset,
  25. u8 bit,
  26. bool shared,
  27. u32 *share_count,
  28. struct device *dev);
  29. #endif