clock.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * arch/arm/mach-u300/include/mach/clock.h
  3. *
  4. * Copyright (C) 2004 - 2005 Nokia corporation
  5. * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
  6. * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
  7. * Copyright (C) 2007-2009 ST-Ericsson AB
  8. * Adopted to ST-Ericsson U300 platforms by
  9. * Jonas Aaberg <jonas.aberg@stericsson.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. *
  15. */
  16. #ifndef __MACH_CLOCK_H
  17. #define __MACH_CLOCK_H
  18. #include <linux/clk.h>
  19. struct clk {
  20. struct list_head node;
  21. struct module *owner;
  22. struct device *dev;
  23. const char *name;
  24. struct clk *parent;
  25. spinlock_t lock;
  26. unsigned long rate;
  27. bool reset;
  28. __u16 clk_val;
  29. __s8 usecount;
  30. void __iomem * res_reg;
  31. __u16 res_mask;
  32. bool hw_ctrld;
  33. void (*recalc) (struct clk *);
  34. int (*set_rate) (struct clk *, unsigned long);
  35. unsigned long (*get_rate) (struct clk *);
  36. unsigned long (*round_rate) (struct clk *, unsigned long);
  37. void (*init) (struct clk *);
  38. void (*enable) (struct clk *);
  39. void (*disable) (struct clk *);
  40. };
  41. int u300_clock_init(void);
  42. #endif