clock.h 877 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * linux/arch/arm/mach-nuc93x/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 nuc93x_clk_enable(struct clk *clk, int enable);
  14. void clks_register(struct clk_lookup *clks, size_t num);
  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 = nuc93x_clk_enable, \
  23. .cken = (1 << _ctrlbit), \
  24. }
  25. #define DEF_CLKLOOK(_clk, _devname, _conname) \
  26. { \
  27. .clk = _clk, \
  28. .dev_id = _devname, \
  29. .con_id = _conname, \
  30. }