18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * rt5514.h  --  RT5514 ALSA SoC audio driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright 2015 Realtek Microelectronics
68c2ecf20Sopenharmony_ci * Author: Oder Chiou <oder_chiou@realtek.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __RT5514_H__
108c2ecf20Sopenharmony_ci#define __RT5514_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <linux/clk.h>
138c2ecf20Sopenharmony_ci#include <sound/rt5514.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define RT5514_DEVICE_ID			0x10ec5514
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define RT5514_RESET				0x2000
188c2ecf20Sopenharmony_ci#define RT5514_PWR_ANA1				0x2004
198c2ecf20Sopenharmony_ci#define RT5514_PWR_ANA2				0x2008
208c2ecf20Sopenharmony_ci#define RT5514_I2S_CTRL1			0x2010
218c2ecf20Sopenharmony_ci#define RT5514_I2S_CTRL2			0x2014
228c2ecf20Sopenharmony_ci#define RT5514_VAD_CTRL6			0x2030
238c2ecf20Sopenharmony_ci#define RT5514_EXT_VAD_CTRL			0x206c
248c2ecf20Sopenharmony_ci#define RT5514_DIG_IO_CTRL			0x2070
258c2ecf20Sopenharmony_ci#define RT5514_PAD_CTRL1			0x2080
268c2ecf20Sopenharmony_ci#define RT5514_DMIC_DATA_CTRL			0x20a0
278c2ecf20Sopenharmony_ci#define RT5514_DIG_SOURCE_CTRL			0x20a4
288c2ecf20Sopenharmony_ci#define RT5514_SRC_CTRL				0x20ac
298c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER2_CTRL1		0x20d0
308c2ecf20Sopenharmony_ci#define RT5514_PLL_SOURCE_CTRL			0x2100
318c2ecf20Sopenharmony_ci#define RT5514_CLK_CTRL1			0x2104
328c2ecf20Sopenharmony_ci#define RT5514_CLK_CTRL2			0x2108
338c2ecf20Sopenharmony_ci#define RT5514_PLL3_CALIB_CTRL1			0x2110
348c2ecf20Sopenharmony_ci#define RT5514_PLL3_CALIB_CTRL4			0x2120
358c2ecf20Sopenharmony_ci#define RT5514_PLL3_CALIB_CTRL5			0x2124
368c2ecf20Sopenharmony_ci#define RT5514_PLL3_CALIB_CTRL6			0x2128
378c2ecf20Sopenharmony_ci#define RT5514_DELAY_BUF_CTRL1			0x2140
388c2ecf20Sopenharmony_ci#define RT5514_DELAY_BUF_CTRL3			0x2148
398c2ecf20Sopenharmony_ci#define RT5514_ASRC_IN_CTRL1			0x2180
408c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER0_CTRL1		0x2190
418c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER0_CTRL2		0x2194
428c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER0_CTRL3		0x2198
438c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER1_CTRL1		0x21a0
448c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER1_CTRL2		0x21a4
458c2ecf20Sopenharmony_ci#define RT5514_DOWNFILTER1_CTRL3		0x21a8
468c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_LDO10			0x2200
478c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_LDO18_16		0x2204
488c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_ADC12			0x2210
498c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_ADC21			0x2214
508c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_ADC22			0x2218
518c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_ADC23			0x221c
528c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_MICBST			0x2220
538c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_ADCFED			0x2224
548c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_INBUF			0x2228
558c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_VREF			0x222c
568c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_PLL3			0x2240
578c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_PLL1_1			0x2260
588c2ecf20Sopenharmony_ci#define RT5514_ANA_CTRL_PLL1_2			0x2264
598c2ecf20Sopenharmony_ci#define RT5514_DMIC_LP_CTRL			0x2e00
608c2ecf20Sopenharmony_ci#define RT5514_MISC_CTRL_DSP			0x2e04
618c2ecf20Sopenharmony_ci#define RT5514_DSP_CTRL1			0x2f00
628c2ecf20Sopenharmony_ci#define RT5514_DSP_CTRL3			0x2f08
638c2ecf20Sopenharmony_ci#define RT5514_DSP_CTRL4			0x2f10
648c2ecf20Sopenharmony_ci#define RT5514_VENDOR_ID1			0x2ff0
658c2ecf20Sopenharmony_ci#define RT5514_VENDOR_ID2			0x2ff4
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define RT5514_DSP_MAPPING			0x18000000
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci/* RT5514_PWR_ANA1 (0x2004) */
708c2ecf20Sopenharmony_ci#define RT5514_POW_LDO18_IN			(0x1 << 5)
718c2ecf20Sopenharmony_ci#define RT5514_POW_LDO18_IN_BIT			5
728c2ecf20Sopenharmony_ci#define RT5514_POW_LDO18_ADC			(0x1 << 4)
738c2ecf20Sopenharmony_ci#define RT5514_POW_LDO18_ADC_BIT		4
748c2ecf20Sopenharmony_ci#define RT5514_POW_LDO21			(0x1 << 3)
758c2ecf20Sopenharmony_ci#define RT5514_POW_LDO21_BIT			3
768c2ecf20Sopenharmony_ci#define RT5514_POW_BG_LDO18_IN			(0x1 << 2)
778c2ecf20Sopenharmony_ci#define RT5514_POW_BG_LDO18_IN_BIT		2
788c2ecf20Sopenharmony_ci#define RT5514_POW_BG_LDO21			(0x1 << 1)
798c2ecf20Sopenharmony_ci#define RT5514_POW_BG_LDO21_BIT			1
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/* RT5514_PWR_ANA2 (0x2008) */
828c2ecf20Sopenharmony_ci#define RT5514_POW_PLL1				(0x1 << 18)
838c2ecf20Sopenharmony_ci#define RT5514_POW_PLL1_BIT			18
848c2ecf20Sopenharmony_ci#define RT5514_POW_PLL1_LDO			(0x1 << 16)
858c2ecf20Sopenharmony_ci#define RT5514_POW_PLL1_LDO_BIT			16
868c2ecf20Sopenharmony_ci#define RT5514_POW_BG_MBIAS			(0x1 << 15)
878c2ecf20Sopenharmony_ci#define RT5514_POW_BG_MBIAS_BIT			15
888c2ecf20Sopenharmony_ci#define RT5514_POW_MBIAS			(0x1 << 14)
898c2ecf20Sopenharmony_ci#define RT5514_POW_MBIAS_BIT			14
908c2ecf20Sopenharmony_ci#define RT5514_POW_VREF2			(0x1 << 13)
918c2ecf20Sopenharmony_ci#define RT5514_POW_VREF2_BIT			13
928c2ecf20Sopenharmony_ci#define RT5514_POW_VREF1			(0x1 << 12)
938c2ecf20Sopenharmony_ci#define RT5514_POW_VREF1_BIT			12
948c2ecf20Sopenharmony_ci#define RT5514_POWR_LDO16			(0x1 << 11)
958c2ecf20Sopenharmony_ci#define RT5514_POWR_LDO16_BIT			11
968c2ecf20Sopenharmony_ci#define RT5514_POWL_LDO16			(0x1 << 10)
978c2ecf20Sopenharmony_ci#define RT5514_POWL_LDO16_BIT			10
988c2ecf20Sopenharmony_ci#define RT5514_POW_ADC2				(0x1 << 9)
998c2ecf20Sopenharmony_ci#define RT5514_POW_ADC2_BIT			9
1008c2ecf20Sopenharmony_ci#define RT5514_POW_INPUT_BUF			(0x1 << 8)
1018c2ecf20Sopenharmony_ci#define RT5514_POW_INPUT_BUF_BIT		8
1028c2ecf20Sopenharmony_ci#define RT5514_POW_ADC1_R			(0x1 << 7)
1038c2ecf20Sopenharmony_ci#define RT5514_POW_ADC1_R_BIT			7
1048c2ecf20Sopenharmony_ci#define RT5514_POW_ADC1_L			(0x1 << 6)
1058c2ecf20Sopenharmony_ci#define RT5514_POW_ADC1_L_BIT			6
1068c2ecf20Sopenharmony_ci#define RT5514_POW2_BSTR			(0x1 << 5)
1078c2ecf20Sopenharmony_ci#define RT5514_POW2_BSTR_BIT			5
1088c2ecf20Sopenharmony_ci#define RT5514_POW2_BSTL			(0x1 << 4)
1098c2ecf20Sopenharmony_ci#define RT5514_POW2_BSTL_BIT			4
1108c2ecf20Sopenharmony_ci#define RT5514_POW_BSTR				(0x1 << 3)
1118c2ecf20Sopenharmony_ci#define RT5514_POW_BSTR_BIT			3
1128c2ecf20Sopenharmony_ci#define RT5514_POW_BSTL				(0x1 << 2)
1138c2ecf20Sopenharmony_ci#define RT5514_POW_BSTL_BIT			2
1148c2ecf20Sopenharmony_ci#define RT5514_POW_ADCFEDR			(0x1 << 1)
1158c2ecf20Sopenharmony_ci#define RT5514_POW_ADCFEDR_BIT			1
1168c2ecf20Sopenharmony_ci#define RT5514_POW_ADCFEDL			(0x1 << 0)
1178c2ecf20Sopenharmony_ci#define RT5514_POW_ADCFEDL_BIT			0
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci/* RT5514_I2S_CTRL1 (0x2010) */
1208c2ecf20Sopenharmony_ci#define RT5514_TDM_MODE2			(0x1 << 30)
1218c2ecf20Sopenharmony_ci#define RT5514_TDM_MODE2_SFT			30
1228c2ecf20Sopenharmony_ci#define RT5514_TDM_MODE				(0x1 << 28)
1238c2ecf20Sopenharmony_ci#define RT5514_TDM_MODE_SFT			28
1248c2ecf20Sopenharmony_ci#define RT5514_I2S_LR_MASK			(0x1 << 26)
1258c2ecf20Sopenharmony_ci#define RT5514_I2S_LR_SFT			26
1268c2ecf20Sopenharmony_ci#define RT5514_I2S_LR_NOR			(0x0 << 26)
1278c2ecf20Sopenharmony_ci#define RT5514_I2S_LR_INV			(0x1 << 26)
1288c2ecf20Sopenharmony_ci#define RT5514_I2S_BP_MASK			(0x1 << 25)
1298c2ecf20Sopenharmony_ci#define RT5514_I2S_BP_SFT			25
1308c2ecf20Sopenharmony_ci#define RT5514_I2S_BP_NOR			(0x0 << 25)
1318c2ecf20Sopenharmony_ci#define RT5514_I2S_BP_INV			(0x1 << 25)
1328c2ecf20Sopenharmony_ci#define RT5514_I2S_DF_MASK			(0x7 << 16)
1338c2ecf20Sopenharmony_ci#define RT5514_I2S_DF_SFT			16
1348c2ecf20Sopenharmony_ci#define RT5514_I2S_DF_I2S			(0x0 << 16)
1358c2ecf20Sopenharmony_ci#define RT5514_I2S_DF_LEFT			(0x1 << 16)
1368c2ecf20Sopenharmony_ci#define RT5514_I2S_DF_PCM_A			(0x2 << 16)
1378c2ecf20Sopenharmony_ci#define RT5514_I2S_DF_PCM_B			(0x3 << 16)
1388c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_RX_MASK		(0x3 << 10)
1398c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_RX_SFT		10
1408c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_RX_4CH		(0x1 << 10)
1418c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_RX_6CH		(0x2 << 10)
1428c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_RX_8CH		(0x3 << 10)
1438c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_RX_MASK			(0x3 << 8)
1448c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_RX_SFT			8
1458c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_RX_16			(0x0 << 8)
1468c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_RX_20			(0x1 << 8)
1478c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_RX_24			(0x2 << 8)
1488c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_RX_32			(0x3 << 8)
1498c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_TX_MASK		(0x3 << 6)
1508c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_TX_SFT		6
1518c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_TX_4CH		(0x1 << 6)
1528c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_TX_6CH		(0x2 << 6)
1538c2ecf20Sopenharmony_ci#define RT5514_TDMSLOT_SEL_TX_8CH		(0x3 << 6)
1548c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_TX_MASK			(0x3 << 4)
1558c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_TX_SFT			4
1568c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_TX_16			(0x0 << 4)
1578c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_TX_20			(0x1 << 4)
1588c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_TX_24			(0x2 << 4)
1598c2ecf20Sopenharmony_ci#define RT5514_CH_LEN_TX_32			(0x3 << 4)
1608c2ecf20Sopenharmony_ci#define RT5514_I2S_DL_MASK			(0x3 << 0)
1618c2ecf20Sopenharmony_ci#define RT5514_I2S_DL_SFT			0
1628c2ecf20Sopenharmony_ci#define RT5514_I2S_DL_16			(0x0 << 0)
1638c2ecf20Sopenharmony_ci#define RT5514_I2S_DL_20			(0x1 << 0)
1648c2ecf20Sopenharmony_ci#define RT5514_I2S_DL_24			(0x2 << 0)
1658c2ecf20Sopenharmony_ci#define RT5514_I2S_DL_8				(0x3 << 0)
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci/* RT5514_I2S_CTRL2 (0x2014) */
1688c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_MODE			(0x1 << 31)
1698c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_MODE_SFT		31
1708c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_VALID_CH_MASK	(0x1 << 29)
1718c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_VALID_CH_SFT		29
1728c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_VALID_CH2		(0x0 << 29)
1738c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_VALID_CH4		(0x1 << 29)
1748c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_START_MASK		(0x1 << 28)
1758c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_START_SFT		28
1768c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_START_SLOT0		(0x0 << 28)
1778c2ecf20Sopenharmony_ci#define RT5514_TDM_DOCKING_START_SLOT4		(0x1 << 28)
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci/* RT5514_DIG_SOURCE_CTRL (0x20a4) */
1808c2ecf20Sopenharmony_ci#define RT5514_AD1_DMIC_INPUT_SEL		(0x1 << 1)
1818c2ecf20Sopenharmony_ci#define RT5514_AD1_DMIC_INPUT_SEL_SFT		1
1828c2ecf20Sopenharmony_ci#define RT5514_AD0_DMIC_INPUT_SEL		(0x1 << 0)
1838c2ecf20Sopenharmony_ci#define RT5514_AD0_DMIC_INPUT_SEL_SFT		0
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* RT5514_PLL_SOURCE_CTRL (0x2100) */
1868c2ecf20Sopenharmony_ci#define RT5514_PLL_1_SEL_MASK			(0x7 << 12)
1878c2ecf20Sopenharmony_ci#define RT5514_PLL_1_SEL_SFT			12
1888c2ecf20Sopenharmony_ci#define RT5514_PLL_1_SEL_SCLK			(0x3 << 12)
1898c2ecf20Sopenharmony_ci#define RT5514_PLL_1_SEL_MCLK			(0x4 << 12)
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci/* RT5514_CLK_CTRL1 (0x2104) */
1928c2ecf20Sopenharmony_ci#define RT5514_CLK_AD_ANA1_EN			(0x1 << 31)
1938c2ecf20Sopenharmony_ci#define RT5514_CLK_AD_ANA1_EN_BIT		31
1948c2ecf20Sopenharmony_ci#define RT5514_CLK_AD1_EN			(0x1 << 24)
1958c2ecf20Sopenharmony_ci#define RT5514_CLK_AD1_EN_BIT			24
1968c2ecf20Sopenharmony_ci#define RT5514_CLK_AD0_EN			(0x1 << 23)
1978c2ecf20Sopenharmony_ci#define RT5514_CLK_AD0_EN_BIT			23
1988c2ecf20Sopenharmony_ci#define RT5514_CLK_DMIC_OUT_SEL_MASK		(0x7 << 8)
1998c2ecf20Sopenharmony_ci#define RT5514_CLK_DMIC_OUT_SEL_SFT		8
2008c2ecf20Sopenharmony_ci#define RT5514_CLK_AD_ANA1_SEL_MASK		(0xf << 0)
2018c2ecf20Sopenharmony_ci#define RT5514_CLK_AD_ANA1_SEL_SFT		0
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci/* RT5514_CLK_CTRL2 (0x2108) */
2048c2ecf20Sopenharmony_ci#define RT5514_CLK_AD1_ASRC_EN			(0x1 << 17)
2058c2ecf20Sopenharmony_ci#define RT5514_CLK_AD1_ASRC_EN_BIT		17
2068c2ecf20Sopenharmony_ci#define RT5514_CLK_AD0_ASRC_EN			(0x1 << 16)
2078c2ecf20Sopenharmony_ci#define RT5514_CLK_AD0_ASRC_EN_BIT		16
2088c2ecf20Sopenharmony_ci#define RT5514_CLK_SYS_DIV_OUT_MASK		(0x7 << 8)
2098c2ecf20Sopenharmony_ci#define RT5514_CLK_SYS_DIV_OUT_SFT		8
2108c2ecf20Sopenharmony_ci#define RT5514_SEL_ADC_OSR_MASK			(0x7 << 4)
2118c2ecf20Sopenharmony_ci#define RT5514_SEL_ADC_OSR_SFT			4
2128c2ecf20Sopenharmony_ci#define RT5514_CLK_SYS_PRE_SEL_MASK		(0x3 << 0)
2138c2ecf20Sopenharmony_ci#define RT5514_CLK_SYS_PRE_SEL_SFT		0
2148c2ecf20Sopenharmony_ci#define RT5514_CLK_SYS_PRE_SEL_MCLK		(0x2 << 0)
2158c2ecf20Sopenharmony_ci#define RT5514_CLK_SYS_PRE_SEL_PLL		(0x3 << 0)
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/*  RT5514_DOWNFILTER_CTRL (0x2190 0x2194 0x21a0 0x21a4) */
2188c2ecf20Sopenharmony_ci#define RT5514_AD_DMIC_MIX			(0x1 << 11)
2198c2ecf20Sopenharmony_ci#define RT5514_AD_DMIC_MIX_BIT			11
2208c2ecf20Sopenharmony_ci#define RT5514_AD_AD_MIX			(0x1 << 10)
2218c2ecf20Sopenharmony_ci#define RT5514_AD_AD_MIX_BIT			10
2228c2ecf20Sopenharmony_ci#define RT5514_AD_AD_MUTE			(0x1 << 7)
2238c2ecf20Sopenharmony_ci#define RT5514_AD_AD_MUTE_BIT			7
2248c2ecf20Sopenharmony_ci#define RT5514_AD_GAIN_MASK			(0x3f << 1)
2258c2ecf20Sopenharmony_ci#define RT5514_AD_GAIN_SFT			1
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci/*  RT5514_ANA_CTRL_MICBST (0x2220) */
2288c2ecf20Sopenharmony_ci#define RT5514_SEL_BSTL_MASK			(0xf << 4)
2298c2ecf20Sopenharmony_ci#define RT5514_SEL_BSTL_SFT			4
2308c2ecf20Sopenharmony_ci#define RT5514_SEL_BSTR_MASK			(0xf << 0)
2318c2ecf20Sopenharmony_ci#define RT5514_SEL_BSTR_SFT			0
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci/*  RT5514_ANA_CTRL_PLL1_1 (0x2260) */
2348c2ecf20Sopenharmony_ci#define RT5514_PLL_K_MAX			0x1f
2358c2ecf20Sopenharmony_ci#define RT5514_PLL_K_MASK			(RT5514_PLL_K_MAX << 16)
2368c2ecf20Sopenharmony_ci#define RT5514_PLL_K_SFT			16
2378c2ecf20Sopenharmony_ci#define RT5514_PLL_N_MAX			0x1ff
2388c2ecf20Sopenharmony_ci#define RT5514_PLL_N_MASK			(RT5514_PLL_N_MAX << 7)
2398c2ecf20Sopenharmony_ci#define RT5514_PLL_N_SFT			4
2408c2ecf20Sopenharmony_ci#define RT5514_PLL_M_MAX			0xf
2418c2ecf20Sopenharmony_ci#define RT5514_PLL_M_MASK			(RT5514_PLL_M_MAX << 0)
2428c2ecf20Sopenharmony_ci#define RT5514_PLL_M_SFT			0
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci/*  RT5514_ANA_CTRL_PLL1_2 (0x2264) */
2458c2ecf20Sopenharmony_ci#define RT5514_PLL_M_BP				(0x1 << 2)
2468c2ecf20Sopenharmony_ci#define RT5514_PLL_M_BP_SFT			2
2478c2ecf20Sopenharmony_ci#define RT5514_PLL_K_BP				(0x1 << 1)
2488c2ecf20Sopenharmony_ci#define RT5514_PLL_K_BP_SFT			1
2498c2ecf20Sopenharmony_ci#define RT5514_EN_LDO_PLL1			(0x1 << 0)
2508c2ecf20Sopenharmony_ci#define RT5514_EN_LDO_PLL1_BIT			0
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci#define RT5514_PLL_INP_MAX			40000000
2538c2ecf20Sopenharmony_ci#define RT5514_PLL_INP_MIN			256000
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci#define RT5514_FIRMWARE1	"rt5514_dsp_fw1.bin"
2568c2ecf20Sopenharmony_ci#define RT5514_FIRMWARE2	"rt5514_dsp_fw2.bin"
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci/* System Clock Source */
2598c2ecf20Sopenharmony_cienum {
2608c2ecf20Sopenharmony_ci	RT5514_SCLK_S_MCLK,
2618c2ecf20Sopenharmony_ci	RT5514_SCLK_S_PLL1,
2628c2ecf20Sopenharmony_ci};
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci/* PLL1 Source */
2658c2ecf20Sopenharmony_cienum {
2668c2ecf20Sopenharmony_ci	RT5514_PLL1_S_MCLK,
2678c2ecf20Sopenharmony_ci	RT5514_PLL1_S_BCLK,
2688c2ecf20Sopenharmony_ci};
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_cistruct rt5514_priv {
2718c2ecf20Sopenharmony_ci	struct rt5514_platform_data pdata;
2728c2ecf20Sopenharmony_ci	struct snd_soc_component *component;
2738c2ecf20Sopenharmony_ci	struct regmap *i2c_regmap, *regmap;
2748c2ecf20Sopenharmony_ci	struct clk *mclk, *dsp_calib_clk;
2758c2ecf20Sopenharmony_ci	int sysclk;
2768c2ecf20Sopenharmony_ci	int sysclk_src;
2778c2ecf20Sopenharmony_ci	int lrck;
2788c2ecf20Sopenharmony_ci	int bclk;
2798c2ecf20Sopenharmony_ci	int pll_src;
2808c2ecf20Sopenharmony_ci	int pll_in;
2818c2ecf20Sopenharmony_ci	int pll_out;
2828c2ecf20Sopenharmony_ci	int dsp_enabled;
2838c2ecf20Sopenharmony_ci	unsigned int pll3_cal_value;
2848c2ecf20Sopenharmony_ci};
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci#endif /* __RT5514_H__ */
287