mcfclk.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. const char *name;
  14. struct clk_ops *clk_ops;
  15. unsigned long rate;
  16. unsigned long enabled;
  17. u8 slot;
  18. };
  19. extern struct clk *mcf_clks[];
  20. #ifdef MCFPM_PPMCR0
  21. extern struct clk_ops clk_ops0;
  22. #ifdef MCFPM_PPMCR1
  23. extern struct clk_ops clk_ops1;
  24. #endif /* MCFPM_PPMCR1 */
  25. #define DEFINE_CLK(clk_bank, clk_name, clk_slot, clk_rate) \
  26. static struct clk __clk_##clk_bank##_##clk_slot = { \
  27. .name = clk_name, \
  28. .clk_ops = &clk_ops##clk_bank, \
  29. .rate = clk_rate, \
  30. .slot = clk_slot, \
  31. }
  32. void __clk_init_enabled(struct clk *);
  33. void __clk_init_disabled(struct clk *);
  34. #else
  35. #define DEFINE_CLK(clk_ref, clk_name, clk_rate) \
  36. static struct clk clk_##clk_ref = { \
  37. .name = clk_name, \
  38. .rate = clk_rate, \
  39. }
  40. #endif /* MCFPM_PPMCR0 */
  41. #endif /* mcfclk_h */