clock.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Clock management for AT32AP CPUs
  3. *
  4. * Copyright (C) 2006 Atmel Corporation
  5. *
  6. * Based on arch/arm/mach-at91/clock.c
  7. * Copyright (C) 2005 David Brownell
  8. * Copyright (C) 2005 Ivan Kokshaysky
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/clk.h>
  15. #include <linux/list.h>
  16. void at32_clk_register(struct clk *clk);
  17. struct clk {
  18. struct list_head list; /* linking element */
  19. const char *name; /* Clock name/function */
  20. struct device *dev; /* Device the clock is used by */
  21. struct clk *parent; /* Parent clock, if any */
  22. void (*mode)(struct clk *clk, int enabled);
  23. unsigned long (*get_rate)(struct clk *clk);
  24. long (*set_rate)(struct clk *clk, unsigned long rate,
  25. int apply);
  26. int (*set_parent)(struct clk *clk, struct clk *parent);
  27. u16 users; /* Enabled if non-zero */
  28. u16 index; /* Sibling index */
  29. };
  30. unsigned long pba_clk_get_rate(struct clk *clk);
  31. void pba_clk_mode(struct clk *clk, int enabled);