clock.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. __u32 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. void u300_clock_primecells(void);
  42. void u300_unclock_primecells(void);
  43. void u300_enable_intcon_clock(void);
  44. void u300_enable_timer_clock(void);
  45. #endif