clk-pll.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2013 Samsung Electronics Co., Ltd.
  3. * Copyright (c) 2013 Linaro Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Common Clock Framework support for all PLL's in Samsung platforms
  10. */
  11. #ifndef __SAMSUNG_CLK_PLL_H
  12. #define __SAMSUNG_CLK_PLL_H
  13. enum samsung_pll_type {
  14. pll_35xx,
  15. pll_36xx,
  16. pll_2550,
  17. pll_2650,
  18. pll_4500,
  19. pll_4502,
  20. pll_4508,
  21. pll_6552,
  22. pll_6553,
  23. };
  24. #define PLL_35XX_RATE(_rate, _m, _p, _s) \
  25. { \
  26. .rate = (_rate), \
  27. .mdiv = (_m), \
  28. .pdiv = (_p), \
  29. .sdiv = (_s), \
  30. }
  31. #define PLL_36XX_RATE(_rate, _m, _p, _s, _k) \
  32. { \
  33. .rate = (_rate), \
  34. .mdiv = (_m), \
  35. .pdiv = (_p), \
  36. .sdiv = (_s), \
  37. .kdiv = (_k), \
  38. }
  39. #define PLL_45XX_RATE(_rate, _m, _p, _s, _afc) \
  40. { \
  41. .rate = (_rate), \
  42. .mdiv = (_m), \
  43. .pdiv = (_p), \
  44. .sdiv = (_s), \
  45. .afc = (_afc), \
  46. }
  47. /* NOTE: Rate table should be kept sorted in descending order. */
  48. struct samsung_pll_rate_table {
  49. unsigned int rate;
  50. unsigned int pdiv;
  51. unsigned int mdiv;
  52. unsigned int sdiv;
  53. unsigned int kdiv;
  54. unsigned int afc;
  55. };
  56. enum pll46xx_type {
  57. pll_4600,
  58. pll_4650,
  59. pll_4650c,
  60. };
  61. extern struct clk * __init samsung_clk_register_pll46xx(const char *name,
  62. const char *pname, const void __iomem *con_reg,
  63. enum pll46xx_type type);
  64. extern struct clk * __init samsung_clk_register_pll2550x(const char *name,
  65. const char *pname, const void __iomem *reg_base,
  66. const unsigned long offset);
  67. #endif /* __SAMSUNG_CLK_PLL_H */