clock.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
  15. #define __ARCH_ARM_MACH_MSM_CLOCK_H
  16. #include <linux/clkdev.h>
  17. /**
  18. * struct clock_init_data - SoC specific clock initialization data
  19. * @table: table of lookups to add
  20. * @size: size of @table
  21. * @pre_init: called before initializing the clock driver.
  22. * @post_init: called after registering @table. clock APIs can be called inside.
  23. * @late_init: called during late init
  24. */
  25. struct clock_init_data {
  26. struct list_head list;
  27. struct clk_lookup *table;
  28. size_t size;
  29. void (*pre_init)(void);
  30. void (*post_init)(void);
  31. int (*late_init)(void);
  32. };
  33. extern struct clock_init_data msm9615_clock_init_data;
  34. extern struct clock_init_data msm9625_clock_init_data;
  35. extern struct clock_init_data apq8064_clock_init_data;
  36. extern struct clock_init_data fsm9xxx_clock_init_data;
  37. extern struct clock_init_data msm7x01a_clock_init_data;
  38. extern struct clock_init_data msm7x27_clock_init_data;
  39. extern struct clock_init_data msm7x27a_clock_init_data;
  40. extern struct clock_init_data msm7x30_clock_init_data;
  41. extern struct clock_init_data msm8960_clock_init_data;
  42. extern struct clock_init_data msm8x60_clock_init_data;
  43. extern struct clock_init_data qds8x50_clock_init_data;
  44. extern struct clock_init_data msm8625_dummy_clock_init_data;
  45. extern struct clock_init_data msm8930_clock_init_data;
  46. extern struct clock_init_data msm8930_pm8917_clock_init_data;
  47. extern struct clock_init_data msm8974_clock_init_data;
  48. extern struct clock_init_data msm8974_rumi_clock_init_data;
  49. extern struct clock_init_data msm8610_clock_init_data;
  50. extern struct clock_init_data msm8610_rumi_clock_init_data;
  51. extern struct clock_init_data msm8226_clock_init_data;
  52. extern struct clock_init_data msm8226_rumi_clock_init_data;
  53. extern struct clock_init_data msm8084_clock_init_data;
  54. extern struct clock_init_data mpq8092_clock_init_data;
  55. extern struct clock_init_data msmkrypton_clock_init_data;
  56. int msm_clock_init(struct clock_init_data *data);
  57. int find_vdd_level(struct clk *clk, unsigned long rate);
  58. #ifdef CONFIG_DEBUG_FS
  59. int clock_debug_register(struct clk_lookup *t, size_t s);
  60. void clock_debug_print_enabled(void);
  61. #else
  62. static inline int clock_debug_register(struct clk_lookup *t, size_t s)
  63. {
  64. return 0;
  65. }
  66. static inline void clock_debug_print_enabled(void) { return; }
  67. #endif
  68. #endif