bypass.h 1004 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2020 Sean Anderson <seanga2@gmail.com>
  4. */
  5. #ifndef K210_BYPASS_H
  6. #define K210_BYPASS_H
  7. struct clk;
  8. struct k210_bypass {
  9. struct clk clk;
  10. struct clk **children; /* Clocks to reparent */
  11. struct clk **saved_parents; /* Parents saved over en-/dis-able */
  12. struct clk *bypassee; /* Clock to bypass */
  13. const struct clk_ops *bypassee_ops; /* Ops of the bypass clock */
  14. struct clk *alt; /* Clock to set children to when bypassing */
  15. size_t child_count;
  16. };
  17. #define to_k210_bypass(_clk) container_of(_clk, struct k210_bypass, clk)
  18. int k210_bypass_set_children(struct clk *clk, struct clk **children,
  19. size_t child_count);
  20. struct clk *k210_register_bypass_struct(const char *name,
  21. const char *parent_name,
  22. struct k210_bypass *bypass);
  23. struct clk *k210_register_bypass(const char *name, const char *parent_name,
  24. struct clk *bypassee,
  25. const struct clk_ops *bypassee_ops,
  26. struct clk *alt);
  27. #endif /* K210_BYPASS_H */