mcfclk.h 961 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * mcfclk.h -- coldfire specific clock structure
  4. */
  5. #ifndef mcfclk_h
  6. #define mcfclk_h
  7. struct clk;
  8. struct clk_ops {
  9. void (*enable)(struct clk *);
  10. void (*disable)(struct clk *);
  11. };
  12. struct clk {
  13. struct clk_ops *clk_ops;
  14. unsigned long rate;
  15. unsigned long enabled;
  16. u8 slot;
  17. };
  18. #ifdef MCFPM_PPMCR0
  19. extern struct clk_ops clk_ops0;
  20. #ifdef MCFPM_PPMCR1
  21. extern struct clk_ops clk_ops1;
  22. #endif /* MCFPM_PPMCR1 */
  23. extern struct clk_ops clk_ops2;
  24. #define DEFINE_CLK(clk_bank, clk_name, clk_slot, clk_rate) \
  25. static struct clk __clk_##clk_bank##_##clk_slot = { \
  26. .clk_ops = &clk_ops##clk_bank, \
  27. .rate = clk_rate, \
  28. .slot = clk_slot, \
  29. }
  30. void __clk_init_enabled(struct clk *);
  31. void __clk_init_disabled(struct clk *);
  32. #else
  33. #define DEFINE_CLK(clk_ref, clk_name, clk_rate) \
  34. static struct clk clk_##clk_ref = { \
  35. .rate = clk_rate, \
  36. }
  37. #endif /* MCFPM_PPMCR0 */
  38. #endif /* mcfclk_h */