dsi_pll_28nm.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_28NM_H
  6. #define __MDSS_DSI_PLL_28NM_H
  7. #define DSI_PHY_PLL_UNIPHY_PLL_GLB_CFG (0x0020)
  8. #define DSI_PHY_PLL_UNIPHY_PLL_LKDET_CFG2 (0x0064)
  9. #define DSI_PHY_PLL_UNIPHY_PLL_TEST_CFG (0x0068)
  10. #define DSI_PHY_PLL_UNIPHY_PLL_CAL_CFG1 (0x0070)
  11. #define DSI_PHY_PLL_UNIPHY_PLL_POSTDIV1_CFG (0x0004)
  12. #define DSI_PHY_PLL_UNIPHY_PLL_POSTDIV3_CFG (0x0028)
  13. #define DSI_PHY_PLL_UNIPHY_PLL_VREG_CFG (0x0010)
  14. struct ssc_params {
  15. s32 kdiv;
  16. s64 triang_inc_7_0;
  17. s64 triang_inc_9_8;
  18. s64 triang_steps;
  19. s64 dc_offset;
  20. s64 freq_seed_7_0;
  21. s64 freq_seed_15_8;
  22. };
  23. struct mdss_dsi_vco_calc {
  24. s64 sdm_cfg0;
  25. s64 sdm_cfg1;
  26. s64 sdm_cfg2;
  27. s64 sdm_cfg3;
  28. s64 cal_cfg10;
  29. s64 cal_cfg11;
  30. s64 refclk_cfg;
  31. s64 gen_vco_clk;
  32. u32 lpfr_lut_res;
  33. struct ssc_params ssc;
  34. };
  35. unsigned long vco_28nm_recalc_rate(struct clk_hw *hw,
  36. unsigned long parent_rate);
  37. int vco_28nm_set_rate(struct clk_hw *hw, unsigned long rate,
  38. unsigned long parent_rate);
  39. long vco_28nm_round_rate(struct clk_hw *hw, unsigned long rate,
  40. unsigned long *parent_rate);
  41. int vco_28nm_prepare(struct clk_hw *hw);
  42. void vco_28nm_unprepare(struct clk_hw *hw);
  43. int analog_postdiv_reg_write(void *context,
  44. unsigned int reg, unsigned int div);
  45. int analog_postdiv_reg_read(void *context,
  46. unsigned int reg, unsigned int *div);
  47. int byteclk_mux_write_sel(void *context,
  48. unsigned int reg, unsigned int val);
  49. int byteclk_mux_read_sel(void *context,
  50. unsigned int reg, unsigned int *val);
  51. int pixel_clk_set_div(void *context,
  52. unsigned int reg, unsigned int div);
  53. int pixel_clk_get_div(void *context,
  54. unsigned int reg, unsigned int *div);
  55. int dsi_pll_lock_status(struct mdss_pll_resources *rsc);
  56. #endif /* __MDSS_DSI_PLL_28NM_H */