1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 /* 3 * rt1019.h -- RT1019 ALSA SoC audio amplifi 4 * 5 * Copyright(c) 2021 Realtek Semiconductor Cor 6 */ 7 8 #ifndef __RT1019_H__ 9 #define __RT1019_H__ 10 11 #define RT1019_DEVICE_ID_VAL 12 #define RT1019_DEVICE_ID_VAL2 13 14 #define RT1019_RESET 15 #define RT1019_IDS_CTRL 16 #define RT1019_ASEL_CTRL 17 #define RT1019_PWR_STRP_2 18 #define RT1019_BEEP_TONE 19 #define RT1019_VER_ID 20 #define RT1019_VEND_ID_1 21 #define RT1019_VEND_ID_2 22 #define RT1019_DEV_ID_1 23 #define RT1019_DEV_ID_2 24 #define RT1019_SDB_CTRL 25 #define RT1019_CLK_TREE_1 26 #define RT1019_CLK_TREE_2 27 #define RT1019_CLK_TREE_3 28 #define RT1019_PLL_1 29 #define RT1019_PLL_2 30 #define RT1019_PLL_3 31 #define RT1019_TDM_1 32 #define RT1019_TDM_2 33 #define RT1019_TDM_3 34 #define RT1019_DMIX_MONO_1 35 #define RT1019_DMIX_MONO_2 36 #define RT1019_BEEP_1 37 #define RT1019_BEEP_2 38 39 /* 0x0019 Power On Strap Control-2 */ 40 #define RT1019_AUTO_BITS_SEL_MASK 41 #define RT1019_AUTO_BITS_SEL_AUTO 42 #define RT1019_AUTO_BITS_SEL_MANU 43 #define RT1019_AUTO_CLK_SEL_MASK 44 #define RT1019_AUTO_CLK_SEL_AUTO 45 #define RT1019_AUTO_CLK_SEL_MANU 46 47 /* 0x0100 Clock Tree Control-1 */ 48 #define RT1019_CLK_SYS_PRE_SEL_MASK 49 #define RT1019_CLK_SYS_PRE_SEL_SFT 50 #define RT1019_CLK_SYS_PRE_SEL_BCLK 51 #define RT1019_CLK_SYS_PRE_SEL_PLL 52 #define RT1019_PLL_SRC_MASK 53 #define RT1019_PLL_SRC_SFT 54 #define RT1019_PLL_SRC_SEL_BCLK 55 #define RT1019_PLL_SRC_SEL_RC 56 #define RT1019_SEL_FIFO_MASK 57 #define RT1019_SEL_FIFO_DIV1 58 #define RT1019_SEL_FIFO_DIV2 59 #define RT1019_SEL_FIFO_DIV4 60 61 /* 0x0101 clock tree control-2 */ 62 #define RT1019_SYS_DIV_DA_FIL_MASK 63 #define RT1019_SYS_DIV_DA_FIL_DIV1 64 #define RT1019_SYS_DIV_DA_FIL_DIV2 65 #define RT1019_SYS_DIV_DA_FIL_DIV4 66 #define RT1019_SYS_DA_OSR_MASK 67 #define RT1019_SYS_DA_OSR_DIV1 68 #define RT1019_SYS_DA_OSR_DIV2 69 #define RT1019_SYS_DA_OSR_DIV4 70 #define RT1019_ASRC_256FS_MASK 71 #define RT1019_ASRC_256FS_DIV1 72 #define RT1019_ASRC_256FS_DIV2 73 #define RT1019_ASRC_256FS_DIV4 74 75 /* 0x0102 clock tree control-3 */ 76 #define RT1019_SEL_CLK_CAL_MASK 77 #define RT1019_SEL_CLK_CAL_DIV1 78 #define RT1019_SEL_CLK_CAL_DIV2 79 #define RT1019_SEL_CLK_CAL_DIV4 80 81 /* 0x0311 PLL-1 */ 82 #define RT1019_PLL_M_MASK 83 #define RT1019_PLL_M_SFT 84 #define RT1019_PLL_M_BP_MASK (0x1 < 85 #define RT1019_PLL_M_BP_SFT 86 #define RT1019_PLL_Q_8_8_MASK (0x1) 87 88 /* 0x0312 PLL-2 */ 89 #define RT1019_PLL_Q_7_0_MASK 0xff 90 91 /* 0x0313 PLL-3 */ 92 #define RT1019_PLL_K_MASK 0x1f 93 94 /* 0x0400 TDM Control-1 */ 95 #define RT1019_TDM_BCLK_MASK (0x1 < 96 #define RT1019_TDM_BCLK_NORM (0x0 < 97 #define RT1019_TDM_BCLK_INV 98 #define RT1019_TDM_CL_MASK 99 #define RT1019_TDM_CL_8 100 #define RT1019_TDM_CL_32 101 #define RT1019_TDM_CL_24 102 #define RT1019_TDM_CL_20 103 #define RT1019_TDM_CL_16 104 105 /* 0x0401 TDM Control-2 */ 106 #define RT1019_I2S_CH_TX_MASK (0x3 < 107 #define RT1019_I2S_CH_TX_SFT 6 108 #define RT1019_I2S_TX_2CH 109 #define RT1019_I2S_TX_4CH 110 #define RT1019_I2S_TX_6CH 111 #define RT1019_I2S_TX_8CH 112 #define RT1019_I2S_DF_MASK 113 #define RT1019_I2S_DF_SFT 114 #define RT1019_I2S_DF_I2S 115 #define RT1019_I2S_DF_LEFT 116 #define RT1019_I2S_DF_PCM_A_R (0x2 < 117 #define RT1019_I2S_DF_PCM_B_R (0x3 < 118 #define RT1019_I2S_DF_PCM_A_F (0x6 < 119 #define RT1019_I2S_DF_PCM_B_F (0x7 < 120 #define RT1019_I2S_DL_MASK 121 #define RT1019_I2S_DL_SFT 122 #define RT1019_I2S_DL_16 123 #define RT1019_I2S_DL_20 124 #define RT1019_I2S_DL_24 125 #define RT1019_I2S_DL_32 126 #define RT1019_I2S_DL_8 127 128 /* TDM1 Control-3 (0x0402) */ 129 #define RT1019_TDM_I2S_TX_L_DAC1_1_MASK 130 #define RT1019_TDM_I2S_TX_R_DAC1_1_MASK 131 #define RT1019_TDM_I2S_TX_L_DAC1_1_SFT 132 #define RT1019_TDM_I2S_TX_R_DAC1_1_SFT 133 134 /* System Clock Source */ 135 enum { 136 RT1019_SCLK_S_BCLK, 137 RT1019_SCLK_S_PLL, 138 }; 139 140 /* PLL1 Source */ 141 enum { 142 RT1019_PLL_S_BCLK, 143 RT1019_PLL_S_RC25M, 144 }; 145 146 enum { 147 RT1019_AIF1, 148 RT1019_AIFS 149 }; 150 151 struct rt1019_priv { 152 struct snd_soc_component *component; 153 struct regmap *regmap; 154 int sysclk; 155 int sysclk_src; 156 int lrck; 157 int bclk; 158 int pll_src; 159 int pll_in; 160 int pll_out; 161 unsigned int bclk_ratio; 162 }; 163 164 #endif /* __RT1019_H__ */ 165
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.