clock.h 1.1 KB

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 <asm/clkdev.h>
  13. void nuc900_clk_enable(struct clk *clk, int enable);
  14. void nuc900_subclk_enable(struct clk *clk, int enable);
  15. void clks_register(struct clk_lookup *clks, size_t num);
  16. struct clk {
  17. unsigned long cken;
  18. unsigned int enabled;
  19. void (*enable)(struct clk *, int enable);
  20. };
  21. #define DEFINE_CLK(_name, _ctrlbit) \
  22. struct clk clk_##_name = { \
  23. .enable = nuc900_clk_enable, \
  24. .cken = (1 << _ctrlbit), \
  25. }
  26. #define DEFINE_SUBCLK(_name, _ctrlbit) \
  27. struct clk clk_##_name = { \
  28. .enable = nuc900_subclk_enable, \
  29. .cken = (1 << _ctrlbit), \
  30. }
  31. #define DEF_CLKLOOK(_clk, _devname, _conname) \
  32. { \
  33. .clk = _clk, \
  34. .dev_id = _devname, \
  35. .con_id = _conname, \
  36. }