mcfclk.h 997 B

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