clock.h 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * linux/arch/arm/mach-w90x900/clock.h
  3. *
  4. * Copyright (c) 2008 Nuvoton technology corporation
  5. *
  6. * Wan ZongShun <mcuos.com@gmail.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License.
  11. */
  12. #include <linux/clkdev.h>
  13. void nuc900_clk_enable(struct clk *clk, int enable);
  14. void nuc900_subclk_enable(struct clk *clk, int enable);
  15. struct clk {
  16. unsigned long cken;
  17. unsigned int enabled;
  18. void (*enable)(struct clk *, int enable);
  19. };
  20. #define DEFINE_CLK(_name, _ctrlbit) \
  21. struct clk clk_##_name = { \
  22. .enable = nuc900_clk_enable, \
  23. .cken = (1 << _ctrlbit), \
  24. }
  25. #define DEFINE_SUBCLK(_name, _ctrlbit) \
  26. struct clk clk_##_name = { \
  27. .enable = nuc900_subclk_enable, \
  28. .cken = (1 << _ctrlbit), \
  29. }
  30. #define DEF_CLKLOOK(_clk, _devname, _conname) \
  31. { \
  32. .clk = _clk, \
  33. .dev_id = _devname, \
  34. .con_id = _conname, \
  35. }