Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * rl6231.h - RL6231 class device shared support
0004  *
0005  * Copyright 2014 Realtek Semiconductor Corp.
0006  *
0007  * Author: Oder Chiou <oder_chiou@realtek.com>
0008  */
0009 
0010 #ifndef __RL6231_H__
0011 #define __RL6231_H__
0012 
0013 #define RL6231_PLL_INP_MAX  50000000
0014 #define RL6231_PLL_INP_MIN  256000
0015 #define RL6231_PLL_N_MAX    0x1ff
0016 #define RL6231_PLL_K_MAX    0x1f
0017 #define RL6231_PLL_M_MAX    0xf
0018 
0019 struct rl6231_pll_code {
0020     bool m_bp; /* Indicates bypass m code or not. */
0021     bool k_bp; /* Indicates bypass k code or not. */
0022     int m_code;
0023     int n_code;
0024     int k_code;
0025 };
0026 
0027 int rl6231_calc_dmic_clk(int rate);
0028 int rl6231_pll_calc(const unsigned int freq_in,
0029     const unsigned int freq_out, struct rl6231_pll_code *pll_code);
0030 int rl6231_get_clk_info(int sclk, int rate);
0031 int rl6231_get_pre_div(struct regmap *map, unsigned int reg, int sft);
0032 
0033 #endif /* __RL6231_H__ */