clk-pll.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. /* NOTE: Rate table should be kept sorted in descending order. */
  40. struct samsung_pll_rate_table {
  41. unsigned int rate;
  42. unsigned int pdiv;
  43. unsigned int mdiv;
  44. unsigned int sdiv;
  45. unsigned int kdiv;
  46. };
  47. enum pll46xx_type {
  48. pll_4600,
  49. pll_4650,
  50. pll_4650c,
  51. };
  52. extern struct clk * __init samsung_clk_register_pll46xx(const char *name,
  53. const char *pname, const void __iomem *con_reg,
  54. enum pll46xx_type type);
  55. extern struct clk * __init samsung_clk_register_pll2550x(const char *name,
  56. const char *pname, const void __iomem *reg_base,
  57. const unsigned long offset);
  58. #endif /* __SAMSUNG_CLK_PLL_H */