clock.h 1.0 KB

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