rl6231.h 864 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * rl6231.h - RL6231 class device shared support
  4. *
  5. * Copyright 2014 Realtek Semiconductor Corp.
  6. *
  7. * Author: Oder Chiou <[email protected]>
  8. */
  9. #ifndef __RL6231_H__
  10. #define __RL6231_H__
  11. #define RL6231_PLL_INP_MAX 50000000
  12. #define RL6231_PLL_INP_MIN 256000
  13. #define RL6231_PLL_N_MAX 0x1ff
  14. #define RL6231_PLL_K_MAX 0x1f
  15. #define RL6231_PLL_M_MAX 0xf
  16. struct rl6231_pll_code {
  17. bool m_bp; /* Indicates bypass m code or not. */
  18. bool k_bp; /* Indicates bypass k code or not. */
  19. int m_code;
  20. int n_code;
  21. int k_code;
  22. };
  23. int rl6231_calc_dmic_clk(int rate);
  24. int rl6231_pll_calc(const unsigned int freq_in,
  25. const unsigned int freq_out, struct rl6231_pll_code *pll_code);
  26. int rl6231_get_clk_info(int sclk, int rate);
  27. int rl6231_get_pre_div(struct regmap *map, unsigned int reg, int sft);
  28. #endif /* __RL6231_H__ */