Linux Audio

Check our new training course

Real-Time Linux with PREEMPT_RT training

Feb 18-20, 2025
Register
Loading...
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0-only */
  2/*
  3 * rt274.h  --  RT274 ALSA SoC audio driver
  4 *
  5 * Copyright 2016 Realtek Microelectronics
  6 * Author: Bard Liao <bardliao@realtek.com>
 
 
 
 
  7 */
  8
  9#ifndef __RT274_H__
 10#define __RT274_H__
 11
 12#define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D)
 13
 14#define RT274_AUDIO_FUNCTION_GROUP			0x01
 15#define RT274_DAC_OUT0					0x02
 16#define RT274_DAC_OUT1					0x03
 17#define RT274_ADC_IN2					0x08
 18#define RT274_ADC_IN1					0x09
 19#define RT274_DIG_CVT					0x0a
 20#define RT274_DMIC1					0x12
 21#define RT274_DMIC2					0x13
 22#define RT274_MIC					0x19
 23#define RT274_LINE1					0x1a
 24#define RT274_LINE2					0x1b
 25#define RT274_LINE3					0x16
 26#define RT274_SPDIF					0x1e
 27#define RT274_VENDOR_REGISTERS				0x20
 28#define RT274_HP_OUT					0x21
 29#define RT274_MIXER_IN1					0x22
 30#define RT274_MIXER_IN2					0x23
 31#define RT274_INLINE_CMD				0x55
 32
 33#define RT274_SET_PIN_SFT				6
 34#define RT274_SET_PIN_ENABLE				0x40
 35#define RT274_SET_PIN_DISABLE				0
 36#define RT274_SET_EAPD_HIGH				0x2
 37#define RT274_SET_EAPD_LOW				0
 38
 39#define RT274_MUTE_SFT					7
 40
 41/* Verb commands */
 42#define RT274_RESET\
 43	VERB_CMD(AC_VERB_SET_CODEC_RESET, RT274_AUDIO_FUNCTION_GROUP, 0)
 44#define RT274_GET_PARAM(NID, PARAM) VERB_CMD(AC_VERB_PARAMETERS, NID, PARAM)
 45#define RT274_SET_POWER(NID) VERB_CMD(AC_VERB_SET_POWER_STATE, NID, 0)
 46#define RT274_SET_AUDIO_POWER RT274_SET_POWER(RT274_AUDIO_FUNCTION_GROUP)
 47#define RT274_SET_HPO_POWER RT274_SET_POWER(RT274_HP_OUT)
 48#define RT274_SET_DMIC1_POWER RT274_SET_POWER(RT274_DMIC1)
 49#define RT274_LOUT_MUX\
 50	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_LINE3, 0)
 51#define RT274_HPO_MUX\
 52	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_HP_OUT, 0)
 53#define RT274_ADC0_MUX\
 54	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_MIXER_IN1, 0)
 55#define RT274_ADC1_MUX\
 56	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_MIXER_IN2, 0)
 57#define RT274_SET_MIC\
 58	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_MIC, 0)
 59#define RT274_SET_PIN_LOUT3\
 60	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_LINE3, 0)
 61#define RT274_SET_PIN_HPO\
 62	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_HP_OUT, 0)
 63#define RT274_SET_PIN_DMIC1\
 64	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_DMIC1, 0)
 65#define RT274_SET_PIN_SPDIF\
 66	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_SPDIF, 0)
 67#define RT274_SET_PIN_DIG_CVT\
 68	VERB_CMD(AC_VERB_SET_DIGI_CONVERT_1, RT274_DIG_CVT, 0)
 69#define RT274_SET_AMP_GAIN_HPO\
 70	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_HP_OUT, 0)
 71#define RT274_SET_AMP_GAIN_ADC_IN1\
 72	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN1, 0)
 73#define RT274_SET_AMP_GAIN_ADC_IN2\
 74	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN2, 0)
 75#define RT274_GET_HP_SENSE\
 76	VERB_CMD(AC_VERB_GET_PIN_SENSE, RT274_HP_OUT, 0)
 77#define RT274_GET_MIC_SENSE\
 78	VERB_CMD(AC_VERB_GET_PIN_SENSE, RT274_MIC, 0)
 79#define RT274_SET_DMIC2_DEFAULT\
 80	VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT274_DMIC2, 0)
 81#define RT274_SET_SPDIF_DEFAULT\
 82	VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT274_SPDIF, 0)
 83#define RT274_DAC0L_GAIN\
 84	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT0, 0xa000)
 85#define RT274_DAC0R_GAIN\
 86	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT0, 0x9000)
 87#define RT274_DAC1L_GAIN\
 88	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT1, 0xa000)
 89#define RT274_DAC1R_GAIN\
 90	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT1, 0x9000)
 91#define RT274_ADCL_GAIN\
 92	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN1, 0x6000)
 93#define RT274_ADCR_GAIN\
 94	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN1, 0x5000)
 95#define RT274_MIC_GAIN\
 96	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_MIC, 0x7000)
 97#define RT274_LOUTL_GAIN\
 98	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_LINE3, 0xa000)
 99#define RT274_LOUTR_GAIN\
100	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_LINE3, 0x9000)
101#define RT274_HPOL_GAIN\
102	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_HP_OUT, 0xa000)
103#define RT274_HPOR_GAIN\
104	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_HP_OUT, 0x9000)
105#define RT274_DAC_FORMAT\
106	VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT274_DAC_OUT0, 0)
107#define RT274_ADC_FORMAT\
108	VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT274_ADC_IN1, 0)
109#define RT274_COEF_INDEX\
110	VERB_CMD(AC_VERB_SET_COEF_INDEX, RT274_VENDOR_REGISTERS, 0)
111#define RT274_PROC_COEF\
112	VERB_CMD(AC_VERB_SET_PROC_COEF, RT274_VENDOR_REGISTERS, 0)
113#define RT274_UNSOLICITED_INLINE_CMD\
114	VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT274_INLINE_CMD, 0)
115#define RT274_UNSOLICITED_HP_OUT\
116	VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT274_HP_OUT, 0)
117#define RT274_UNSOLICITED_MIC\
118	VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT274_MIC, 0)
119#define RT274_COEF58_INDEX\
120	VERB_CMD(AC_VERB_SET_COEF_INDEX, 0x58, 0)
121#define RT274_COEF58_COEF\
122	VERB_CMD(AC_VERB_SET_PROC_COEF, 0x58, 0)
123#define RT274_COEF5b_INDEX\
124	VERB_CMD(AC_VERB_SET_COEF_INDEX, 0x5b, 0)
125#define RT274_COEF5b_COEF\
126	VERB_CMD(AC_VERB_SET_PROC_COEF, 0x5b, 0)
127#define RT274_SET_STREAMID_DAC0\
128	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_DAC_OUT0, 0)
129#define RT274_SET_STREAMID_DAC1\
130	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_DAC_OUT1, 0)
131#define RT274_SET_STREAMID_ADC1\
132	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_ADC_IN1, 0)
133#define RT274_SET_STREAMID_ADC2\
134	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_ADC_IN2, 0)
135
136/* Index registers */
137#define RT274_EAPD_GPIO_IRQ_CTRL	0x10
138#define RT274_PAD_CTRL12		0x35
139#define RT274_I2S_CTRL1			0x63
140#define RT274_I2S_CTRL2			0x64
141#define RT274_MCLK_CTRL			0x71
142#define RT274_CLK_CTRL			0x72
143#define RT274_PLL2_CTRL			0x7b
144
145
146/* EAPD GPIO IRQ control (Index 0x10) */
147#define RT274_IRQ_DIS		(0x0 << 13)
148#define RT274_IRQ_EN		(0x1 << 13)
149#define RT274_IRQ_CLR		(0x1 << 12)
150#define RT274_GPI2_SEL_MASK	(0x3 << 7)
151#define RT274_GPI2_SEL_GPIO2	(0x0 << 7)
152#define RT274_GPI2_SEL_I2S	(0x1 << 7)
153#define RT274_GPI2_SEL_DMIC_CLK	(0x2 << 7)
154#define RT274_GPI2_SEL_CBJ	(0x3 << 7)
155
156/* Front I2S_Interface control 1 (Index 0x63) */
157#define RT274_I2S_MODE_MASK	(0x1 << 11)
158#define RT274_I2S_MODE_S	(0x0 << 11)
159#define RT274_I2S_MODE_M	(0x1 << 11)
160#define RT274_TDM_DIS		(0x0 << 10)
161#define RT274_TDM_EN		(0x1 << 10)
162#define RT274_TDM_CH_NUM	(0x1 << 7)
163#define RT274_TDM_2CH		(0x0 << 7)
164#define RT274_TDM_4CH		(0x1 << 7)
165#define RT274_I2S_FMT_MASK	(0x3 << 8)
166#define RT274_I2S_FMT_I2S	(0x0 << 8)
167#define RT274_I2S_FMT_LJ	(0x1 << 8)
168#define RT274_I2S_FMT_PCMA	(0x2 << 8)
169#define RT274_I2S_FMT_PCMB	(0x3 << 8)
170
171/* MCLK clock domain control (Index 0x71) */
172#define RT274_MCLK_MODE_MASK	(0x1 << 14)
173#define RT274_MCLK_MODE_DIS	(0x0 << 14)
174#define RT274_MCLK_MODE_EN	(0x1 << 14)
175
176/* Clock control (Index 0x72) */
177#define RT274_CLK_SRC_MASK	(0x7 << 3)
178#define RT274_CLK_SRC_MCLK	(0x0 << 3)
179#define RT274_CLK_SRC_PLL2	(0x3 << 3)
180
181/* PLL2 control (Index 0x7b) */
182#define RT274_PLL2_SRC_MASK	(0x1 << 13)
183#define RT274_PLL2_SRC_MCLK	(0x0 << 13)
184#define RT274_PLL2_SRC_BCLK	(0x1 << 13)
185
186/* HP-OUT (0x21) */
187#define RT274_M_HP_MUX_SFT	14
188#define RT274_HP_SEL_MASK	0x1
189#define RT274_HP_SEL_SFT	0
190#define RT274_HP_SEL_F		0
191#define RT274_HP_SEL_S		1
192
193/* ADC (0x22) (0x23) */
194#define RT274_ADC_SEL_MASK	0x7
195#define RT274_ADC_SEL_SFT	0
196#define RT274_ADC_SEL_MIC	0
197#define RT274_ADC_SEL_LINE1	1
198#define RT274_ADC_SEL_LINE2	2
199#define RT274_ADC_SEL_DMIC	3
200
201#define RT274_SCLK_S_MCLK	0
202#define RT274_SCLK_S_PLL1	1
203#define RT274_SCLK_S_PLL2	2
204
205#define RT274_PLL2_S_MCLK	0
206#define RT274_PLL2_S_BCLK	1
207
208enum {
209	RT274_AIF1,
210	RT274_AIFS,
211};
212
213#endif /* __RT274_H__ */
214
v4.17
 
  1/*
  2 * rt274.h  --  RT274 ALSA SoC audio driver
  3 *
  4 * Copyright 2016 Realtek Microelectronics
  5 * Author: Bard Liao <bardliao@realtek.com>
  6 *
  7 * This program is free software; you can redistribute it and/or modify
  8 * it under the terms of the GNU General Public License version 2 as
  9 * published by the Free Software Foundation.
 10 */
 11
 12#ifndef __RT274_H__
 13#define __RT274_H__
 14
 15#define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D)
 16
 17#define RT274_AUDIO_FUNCTION_GROUP			0x01
 18#define RT274_DAC_OUT0					0x02
 19#define RT274_DAC_OUT1					0x03
 20#define RT274_ADC_IN2					0x08
 21#define RT274_ADC_IN1					0x09
 22#define RT274_DIG_CVT					0x0a
 23#define RT274_DMIC1					0x12
 24#define RT274_DMIC2					0x13
 25#define RT274_MIC					0x19
 26#define RT274_LINE1					0x1a
 27#define RT274_LINE2					0x1b
 28#define RT274_LINE3					0x16
 29#define RT274_SPDIF					0x1e
 30#define RT274_VENDOR_REGISTERS				0x20
 31#define RT274_HP_OUT					0x21
 32#define RT274_MIXER_IN1					0x22
 33#define RT274_MIXER_IN2					0x23
 34#define RT274_INLINE_CMD				0x55
 35
 36#define RT274_SET_PIN_SFT				6
 37#define RT274_SET_PIN_ENABLE				0x40
 38#define RT274_SET_PIN_DISABLE				0
 39#define RT274_SET_EAPD_HIGH				0x2
 40#define RT274_SET_EAPD_LOW				0
 41
 42#define RT274_MUTE_SFT					7
 43
 44/* Verb commands */
 45#define RT274_RESET\
 46	VERB_CMD(AC_VERB_SET_CODEC_RESET, RT274_AUDIO_FUNCTION_GROUP, 0)
 47#define RT274_GET_PARAM(NID, PARAM) VERB_CMD(AC_VERB_PARAMETERS, NID, PARAM)
 48#define RT274_SET_POWER(NID) VERB_CMD(AC_VERB_SET_POWER_STATE, NID, 0)
 49#define RT274_SET_AUDIO_POWER RT274_SET_POWER(RT274_AUDIO_FUNCTION_GROUP)
 50#define RT274_SET_HPO_POWER RT274_SET_POWER(RT274_HP_OUT)
 51#define RT274_SET_DMIC1_POWER RT274_SET_POWER(RT274_DMIC1)
 52#define RT274_LOUT_MUX\
 53	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_LINE3, 0)
 54#define RT274_HPO_MUX\
 55	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_HP_OUT, 0)
 56#define RT274_ADC0_MUX\
 57	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_MIXER_IN1, 0)
 58#define RT274_ADC1_MUX\
 59	VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT274_MIXER_IN2, 0)
 60#define RT274_SET_MIC\
 61	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_MIC, 0)
 62#define RT274_SET_PIN_LOUT3\
 63	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_LINE3, 0)
 64#define RT274_SET_PIN_HPO\
 65	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_HP_OUT, 0)
 66#define RT274_SET_PIN_DMIC1\
 67	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_DMIC1, 0)
 68#define RT274_SET_PIN_SPDIF\
 69	VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT274_SPDIF, 0)
 70#define RT274_SET_PIN_DIG_CVT\
 71	VERB_CMD(AC_VERB_SET_DIGI_CONVERT_1, RT274_DIG_CVT, 0)
 72#define RT274_SET_AMP_GAIN_HPO\
 73	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_HP_OUT, 0)
 74#define RT274_SET_AMP_GAIN_ADC_IN1\
 75	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN1, 0)
 76#define RT274_SET_AMP_GAIN_ADC_IN2\
 77	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN2, 0)
 78#define RT274_GET_HP_SENSE\
 79	VERB_CMD(AC_VERB_GET_PIN_SENSE, RT274_HP_OUT, 0)
 80#define RT274_GET_MIC_SENSE\
 81	VERB_CMD(AC_VERB_GET_PIN_SENSE, RT274_MIC, 0)
 82#define RT274_SET_DMIC2_DEFAULT\
 83	VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT274_DMIC2, 0)
 84#define RT274_SET_SPDIF_DEFAULT\
 85	VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT274_SPDIF, 0)
 86#define RT274_DAC0L_GAIN\
 87	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT0, 0xa000)
 88#define RT274_DAC0R_GAIN\
 89	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT0, 0x9000)
 90#define RT274_DAC1L_GAIN\
 91	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT1, 0xa000)
 92#define RT274_DAC1R_GAIN\
 93	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_DAC_OUT1, 0x9000)
 94#define RT274_ADCL_GAIN\
 95	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN1, 0x6000)
 96#define RT274_ADCR_GAIN\
 97	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_ADC_IN1, 0x5000)
 98#define RT274_MIC_GAIN\
 99	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_MIC, 0x7000)
100#define RT274_LOUTL_GAIN\
101	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_LINE3, 0xa000)
102#define RT274_LOUTR_GAIN\
103	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_LINE3, 0x9000)
104#define RT274_HPOL_GAIN\
105	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_HP_OUT, 0xa000)
106#define RT274_HPOR_GAIN\
107	VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT274_HP_OUT, 0x9000)
108#define RT274_DAC_FORMAT\
109	VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT274_DAC_OUT0, 0)
110#define RT274_ADC_FORMAT\
111	VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT274_ADC_IN1, 0)
112#define RT274_COEF_INDEX\
113	VERB_CMD(AC_VERB_SET_COEF_INDEX, RT274_VENDOR_REGISTERS, 0)
114#define RT274_PROC_COEF\
115	VERB_CMD(AC_VERB_SET_PROC_COEF, RT274_VENDOR_REGISTERS, 0)
116#define RT274_UNSOLICITED_INLINE_CMD\
117	VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT274_INLINE_CMD, 0)
118#define RT274_UNSOLICITED_HP_OUT\
119	VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT274_HP_OUT, 0)
120#define RT274_UNSOLICITED_MIC\
121	VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT274_MIC, 0)
122#define RT274_COEF58_INDEX\
123	VERB_CMD(AC_VERB_SET_COEF_INDEX, 0x58, 0)
124#define RT274_COEF58_COEF\
125	VERB_CMD(AC_VERB_SET_PROC_COEF, 0x58, 0)
126#define RT274_COEF5b_INDEX\
127	VERB_CMD(AC_VERB_SET_COEF_INDEX, 0x5b, 0)
128#define RT274_COEF5b_COEF\
129	VERB_CMD(AC_VERB_SET_PROC_COEF, 0x5b, 0)
130#define RT274_SET_STREAMID_DAC0\
131	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_DAC_OUT0, 0)
132#define RT274_SET_STREAMID_DAC1\
133	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_DAC_OUT1, 0)
134#define RT274_SET_STREAMID_ADC1\
135	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_ADC_IN1, 0)
136#define RT274_SET_STREAMID_ADC2\
137	VERB_CMD(AC_VERB_SET_CHANNEL_STREAMID, RT274_ADC_IN2, 0)
138
139/* Index registers */
140#define RT274_EAPD_GPIO_IRQ_CTRL	0x10
141#define RT274_PAD_CTRL12		0x35
142#define RT274_I2S_CTRL1			0x63
143#define RT274_I2S_CTRL2			0x64
144#define RT274_MCLK_CTRL			0x71
145#define RT274_CLK_CTRL			0x72
146#define RT274_PLL2_CTRL			0x7b
147
148
149/* EAPD GPIO IRQ control (Index 0x10) */
150#define RT274_IRQ_DIS		(0x0 << 13)
151#define RT274_IRQ_EN		(0x1 << 13)
152#define RT274_IRQ_CLR		(0x1 << 12)
153#define RT274_GPI2_SEL_MASK	(0x3 << 7)
154#define RT274_GPI2_SEL_GPIO2	(0x0 << 7)
155#define RT274_GPI2_SEL_I2S	(0x1 << 7)
156#define RT274_GPI2_SEL_DMIC_CLK	(0x2 << 7)
157#define RT274_GPI2_SEL_CBJ	(0x3 << 7)
158
159/* Front I2S_Interface control 1 (Index 0x63) */
160#define RT274_I2S_MODE_MASK	(0x1 << 11)
161#define RT274_I2S_MODE_S	(0x0 << 11)
162#define RT274_I2S_MODE_M	(0x1 << 11)
163#define RT274_TDM_DIS		(0x0 << 10)
164#define RT274_TDM_EN		(0x1 << 10)
165#define RT274_TDM_CH_NUM	(0x1 << 7)
166#define RT274_TDM_2CH		(0x0 << 7)
167#define RT274_TDM_4CH		(0x1 << 7)
168#define RT274_I2S_FMT_MASK	(0x3 << 8)
169#define RT274_I2S_FMT_I2S	(0x0 << 8)
170#define RT274_I2S_FMT_LJ	(0x1 << 8)
171#define RT274_I2S_FMT_PCMA	(0x2 << 8)
172#define RT274_I2S_FMT_PCMB	(0x3 << 8)
173
174/* MCLK clock domain control (Index 0x71) */
175#define RT274_MCLK_MODE_MASK	(0x1 << 14)
176#define RT274_MCLK_MODE_DIS	(0x0 << 14)
177#define RT274_MCLK_MODE_EN	(0x1 << 14)
178
179/* Clock control (Index 0x72) */
180#define RT274_CLK_SRC_MASK	(0x7 << 3)
181#define RT274_CLK_SRC_MCLK	(0x0 << 3)
182#define RT274_CLK_SRC_PLL2	(0x3 << 3)
183
184/* PLL2 control (Index 0x7b) */
185#define RT274_PLL2_SRC_MASK	(0x1 << 13)
186#define RT274_PLL2_SRC_MCLK	(0x0 << 13)
187#define RT274_PLL2_SRC_BCLK	(0x1 << 13)
188
189/* HP-OUT (0x21) */
190#define RT274_M_HP_MUX_SFT	14
191#define RT274_HP_SEL_MASK	0x1
192#define RT274_HP_SEL_SFT	0
193#define RT274_HP_SEL_F		0
194#define RT274_HP_SEL_S		1
195
196/* ADC (0x22) (0x23) */
197#define RT274_ADC_SEL_MASK	0x7
198#define RT274_ADC_SEL_SFT	0
199#define RT274_ADC_SEL_MIC	0
200#define RT274_ADC_SEL_LINE1	1
201#define RT274_ADC_SEL_LINE2	2
202#define RT274_ADC_SEL_DMIC	3
203
204#define RT274_SCLK_S_MCLK	0
205#define RT274_SCLK_S_PLL1	1
206#define RT274_SCLK_S_PLL2	2
207
208#define RT274_PLL2_S_MCLK	0
209#define RT274_PLL2_S_BCLK	1
210
211enum {
212	RT274_AIF1,
213	RT274_AIFS,
214};
215
216#endif /* __RT274_H__ */
217