clk-pll.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 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. #ifndef __QCOM_CLK_PLL_H__
  14. #define __QCOM_CLK_PLL_H__
  15. #include <linux/clk-provider.h>
  16. #include "clk-regmap.h"
  17. /**
  18. * struct clk_pll - phase locked loop (PLL)
  19. * @l_reg: L register
  20. * @m_reg: M register
  21. * @n_reg: N register
  22. * @config_reg: config register
  23. * @mode_reg: mode register
  24. * @status_reg: status register
  25. * @status_bit: ANDed with @status_reg to determine if PLL is enabled
  26. * @hw: handle between common and hardware-specific interfaces
  27. */
  28. struct clk_pll {
  29. u32 l_reg;
  30. u32 m_reg;
  31. u32 n_reg;
  32. u32 config_reg;
  33. u32 mode_reg;
  34. u32 status_reg;
  35. u8 status_bit;
  36. struct clk_regmap clkr;
  37. };
  38. extern const struct clk_ops clk_pll_ops;
  39. extern const struct clk_ops clk_pll_vote_ops;
  40. #define to_clk_pll(_hw) container_of(to_clk_regmap(_hw), struct clk_pll, clkr)
  41. struct pll_config {
  42. u16 l;
  43. u32 m;
  44. u32 n;
  45. u32 vco_val;
  46. u32 vco_mask;
  47. u32 pre_div_val;
  48. u32 pre_div_mask;
  49. u32 post_div_val;
  50. u32 post_div_mask;
  51. u32 mn_ena_mask;
  52. u32 main_output_mask;
  53. u32 aux_output_mask;
  54. };
  55. void clk_pll_configure_sr_hpm_lp(struct clk_pll *pll, struct regmap *regmap,
  56. const struct pll_config *config, bool fsm_mode);
  57. #endif