dsi_pll.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __MDSS_DSI_PLL_H
  6. #define __MDSS_DSI_PLL_H
  7. #include <linux/clk-provider.h>
  8. #include "pll_drv.h"
  9. #define MAX_DSI_PLL_EN_SEQS 10
  10. /* Register offsets for 20nm PHY PLL */
  11. #define MMSS_DSI_PHY_PLL_PLL_CNTRL (0x0014)
  12. #define MMSS_DSI_PHY_PLL_PLL_BKG_KVCO_CAL_EN (0x002C)
  13. #define MMSS_DSI_PHY_PLL_PLLLOCK_CMP_EN (0x009C)
  14. struct lpfr_cfg {
  15. unsigned long vco_rate;
  16. u32 r;
  17. };
  18. struct dsi_pll_vco_clk {
  19. struct clk_hw hw;
  20. unsigned long ref_clk_rate;
  21. unsigned long min_rate;
  22. unsigned long max_rate;
  23. u32 pll_en_seq_cnt;
  24. struct lpfr_cfg *lpfr_lut;
  25. u32 lpfr_lut_size;
  26. void *priv;
  27. int (*pll_enable_seqs[MAX_DSI_PLL_EN_SEQS])
  28. (struct mdss_pll_resources *dsi_pll_Res);
  29. };
  30. int dsi_pll_clock_register_10nm(struct platform_device *pdev,
  31. struct mdss_pll_resources *pll_res);
  32. int dsi_pll_clock_register_7nm(struct platform_device *pdev,
  33. struct mdss_pll_resources *pll_res);
  34. int dsi_pll_clock_register_28lpm(struct platform_device *pdev,
  35. struct mdss_pll_resources *pll_res);
  36. static inline struct dsi_pll_vco_clk *to_vco_clk_hw(struct clk_hw *hw)
  37. {
  38. return container_of(hw, struct dsi_pll_vco_clk, hw);
  39. }
  40. int dsi_pll_clock_register_14nm(struct platform_device *pdev,
  41. struct mdss_pll_resources *pll_res);
  42. #endif