clock.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __ASM_SH_CLOCK_H
  2. #define __ASM_SH_CLOCK_H
  3. #include <linux/kref.h>
  4. #include <linux/list.h>
  5. #include <linux/seq_file.h>
  6. struct clk;
  7. struct clk_ops {
  8. void (*init)(struct clk *clk);
  9. void (*enable)(struct clk *clk);
  10. void (*disable)(struct clk *clk);
  11. void (*recalc)(struct clk *clk);
  12. int (*set_rate)(struct clk *clk, unsigned long rate);
  13. };
  14. struct clk {
  15. struct list_head node;
  16. const char *name;
  17. struct module *owner;
  18. struct clk *parent;
  19. struct clk_ops *ops;
  20. struct kref kref;
  21. unsigned long rate;
  22. unsigned long flags;
  23. };
  24. #define CLK_ALWAYS_ENABLED (1 << 0)
  25. #define CLK_RATE_PROPAGATES (1 << 1)
  26. /* Should be defined by processor-specific code */
  27. void arch_init_clk_ops(struct clk_ops **, int type);
  28. /* arch/sh/kernel/cpu/clock.c */
  29. int clk_init(void);
  30. int __clk_enable(struct clk *);
  31. int clk_enable(struct clk *);
  32. void __clk_disable(struct clk *);
  33. void clk_disable(struct clk *);
  34. int clk_set_rate(struct clk *, unsigned long rate);
  35. unsigned long clk_get_rate(struct clk *);
  36. void clk_recalc_rate(struct clk *);
  37. struct clk *clk_get(const char *id);
  38. void clk_put(struct clk *);
  39. int clk_register(struct clk *);
  40. void clk_unregister(struct clk *);
  41. int show_clocks(struct seq_file *m);
  42. #endif /* __ASM_SH_CLOCK_H */