clock.h 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __ASM_MIPS_CLOCK_H
  2. #define __ASM_MIPS_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, int algo_id);
  14. long (*round_rate) (struct clk *clk, unsigned long rate);
  15. };
  16. struct clk {
  17. struct list_head node;
  18. const char *name;
  19. int id;
  20. struct module *owner;
  21. struct clk *parent;
  22. struct clk_ops *ops;
  23. struct kref kref;
  24. unsigned long rate;
  25. unsigned long flags;
  26. };
  27. #define CLK_ALWAYS_ENABLED (1 << 0)
  28. #define CLK_RATE_PROPAGATES (1 << 1)
  29. int clk_init(void);
  30. int __clk_enable(struct clk *);
  31. void __clk_disable(struct clk *);
  32. void clk_recalc_rate(struct clk *);
  33. int clk_register(struct clk *);
  34. void clk_unregister(struct clk *);
  35. #endif /* __ASM_MIPS_CLOCK_H */