xref: /linux/sound/pci/hda/patch_cs8409-tables.c (revision 7c761166399bedfc89c928bef8015546d85a9099)
19e7647b5SLucas Tanure // SPDX-License-Identifier: GPL-2.0-only
29e7647b5SLucas Tanure /*
39e7647b5SLucas Tanure  * patch_cs8409-tables.c  --  HD audio interface patch for Cirrus Logic CS8409 HDA bridge chip
49e7647b5SLucas Tanure  *
59e7647b5SLucas Tanure  * Copyright (C) 2021 Cirrus Logic, Inc. and
69e7647b5SLucas Tanure  *                    Cirrus Logic International Semiconductor Ltd.
79e7647b5SLucas Tanure  *
89e7647b5SLucas Tanure  * Author: Lucas Tanure <tanureal@opensource.cirrus.com>
99e7647b5SLucas Tanure  */
109e7647b5SLucas Tanure 
119e7647b5SLucas Tanure #include "patch_cs8409.h"
129e7647b5SLucas Tanure 
13b2a88774SLucas Tanure /******************************************************************************
14b2a88774SLucas Tanure  *                          CS42L42 Specific Data
15b2a88774SLucas Tanure  *
16b2a88774SLucas Tanure  ******************************************************************************/
17b2a88774SLucas Tanure 
18636eb9d2SLucas Tanure static const DECLARE_TLV_DB_SCALE(cs42l42_dac_db_scale, CS42L42_HP_VOL_REAL_MIN * 100, 100, 1);
19b2a88774SLucas Tanure 
20636eb9d2SLucas Tanure static const DECLARE_TLV_DB_SCALE(cs42l42_adc_db_scale, CS42L42_AMIC_VOL_REAL_MIN * 100, 100, 1);
21b2a88774SLucas Tanure 
22b2a88774SLucas Tanure const struct snd_kcontrol_new cs42l42_dac_volume_mixer = {
23b2a88774SLucas Tanure 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
24b2a88774SLucas Tanure 	.index = 0,
25b2a88774SLucas Tanure 	.subdevice = (HDA_SUBDEV_AMP_FLAG | HDA_SUBDEV_NID_FLAG),
26b2a88774SLucas Tanure 	.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ),
27636eb9d2SLucas Tanure 	.info = cs42l42_volume_info,
28636eb9d2SLucas Tanure 	.get = cs42l42_volume_get,
29636eb9d2SLucas Tanure 	.put = cs42l42_volume_put,
30b2a88774SLucas Tanure 	.tlv = { .p = cs42l42_dac_db_scale },
3124f7ac3dSLucas Tanure 	.private_value = HDA_COMPOSE_AMP_VAL_OFS(CS8409_PIN_ASP1_TRANSMITTER_A, 3, CS8409_CODEC0,
32b2a88774SLucas Tanure 			 HDA_OUTPUT, CS42L42_VOL_DAC) | HDA_AMP_VAL_MIN_MUTE
33b2a88774SLucas Tanure };
34b2a88774SLucas Tanure 
35b2a88774SLucas Tanure const struct snd_kcontrol_new cs42l42_adc_volume_mixer = {
36b2a88774SLucas Tanure 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
37b2a88774SLucas Tanure 	.index = 0,
38b2a88774SLucas Tanure 	.subdevice = (HDA_SUBDEV_AMP_FLAG | HDA_SUBDEV_NID_FLAG),
39b2a88774SLucas Tanure 	.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ),
40636eb9d2SLucas Tanure 	.info = cs42l42_volume_info,
41636eb9d2SLucas Tanure 	.get = cs42l42_volume_get,
42636eb9d2SLucas Tanure 	.put = cs42l42_volume_put,
43b2a88774SLucas Tanure 	.tlv = { .p = cs42l42_adc_db_scale },
4424f7ac3dSLucas Tanure 	.private_value = HDA_COMPOSE_AMP_VAL_OFS(CS8409_PIN_ASP1_RECEIVER_A, 1, CS8409_CODEC0,
45b2a88774SLucas Tanure 			 HDA_INPUT, CS42L42_VOL_ADC) | HDA_AMP_VAL_MIN_MUTE
46b2a88774SLucas Tanure };
47b2a88774SLucas Tanure 
48fed0aacaSStefan Binding const struct hda_pcm_stream cs42l42_48k_pcm_analog_playback = {
49fed0aacaSStefan Binding 	.rates = SNDRV_PCM_RATE_48000, /* fixed rate */
50fed0aacaSStefan Binding };
51fed0aacaSStefan Binding 
52fed0aacaSStefan Binding const struct hda_pcm_stream cs42l42_48k_pcm_analog_capture = {
53fed0aacaSStefan Binding 	.rates = SNDRV_PCM_RATE_48000, /* fixed rate */
54fed0aacaSStefan Binding };
55fed0aacaSStefan Binding 
5624f7ac3dSLucas Tanure /******************************************************************************
5724f7ac3dSLucas Tanure  *                   BULLSEYE / WARLOCK / CYBORG Specific Arrays
5824f7ac3dSLucas Tanure  *                               CS8409/CS42L42
5924f7ac3dSLucas Tanure  ******************************************************************************/
609e7647b5SLucas Tanure 
619e7647b5SLucas Tanure const struct hda_verb cs8409_cs42l42_init_verbs[] = {
62ccff0064SStefan Binding 	{ CS8409_PIN_AFG, AC_VERB_SET_GPIO_WAKE_MASK, 0x0018 },		/* WAKE from GPIO 3,4 */
63ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_PROC_STATE, 0x0001 },	/* Enable VPW processing */
64ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_COEF_INDEX, 0x0002 },	/* Configure GPIO 6,7 */
65ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_PROC_COEF,  0x0080 },	/* I2C mode */
66ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_COEF_INDEX, 0x005b },	/* Set I2C bus speed */
67ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_PROC_COEF,  0x0200 },	/* 100kHz I2C_STO = 2 */
689e7647b5SLucas Tanure 	{} /* terminator */
699e7647b5SLucas Tanure };
709e7647b5SLucas Tanure 
7165123b89STom Rix static const struct hda_pintbl cs8409_cs42l42_pincfgs[] = {
72ccff0064SStefan Binding 	{ CS8409_PIN_ASP1_TRANSMITTER_A, 0x042120f0 },	/* ASP-1-TX */
73ccff0064SStefan Binding 	{ CS8409_PIN_ASP1_RECEIVER_A, 0x04a12050 },	/* ASP-1-RX */
74ccff0064SStefan Binding 	{ CS8409_PIN_ASP2_TRANSMITTER_A, 0x901000f0 },	/* ASP-2-TX */
75ccff0064SStefan Binding 	{ CS8409_PIN_DMIC1_IN, 0x90a00090 },		/* DMIC-1 */
769e7647b5SLucas Tanure 	{} /* terminator */
779e7647b5SLucas Tanure };
789e7647b5SLucas Tanure 
7965123b89STom Rix static const struct hda_pintbl cs8409_cs42l42_pincfgs_no_dmic[] = {
8022bb8226SStefan Binding 	{ CS8409_PIN_ASP1_TRANSMITTER_A, 0x042120f0 },	/* ASP-1-TX */
8122bb8226SStefan Binding 	{ CS8409_PIN_ASP1_RECEIVER_A, 0x04a12050 },	/* ASP-1-RX */
8222bb8226SStefan Binding 	{ CS8409_PIN_ASP2_TRANSMITTER_A, 0x901000f0 },	/* ASP-2-TX */
8322bb8226SStefan Binding 	{} /* terminator */
8422bb8226SStefan Binding };
8522bb8226SStefan Binding 
869e7647b5SLucas Tanure /* Vendor specific HW configuration for CS42L42 */
8724f7ac3dSLucas Tanure static const struct cs8409_i2c_param cs42l42_init_reg_seq[] = {
889cd82738SStefan Binding 	{ CS42L42_I2C_TIMEOUT, 0xB0 },
899cd82738SStefan Binding 	{ CS42L42_ADC_CTL, 0x00 },
909e7647b5SLucas Tanure 	{ 0x1D02, 0x06 },
919cd82738SStefan Binding 	{ CS42L42_ADC_VOLUME, 0x9F },
929cd82738SStefan Binding 	{ CS42L42_OSC_SWITCH, 0x01 },
939cd82738SStefan Binding 	{ CS42L42_MCLK_CTL, 0x02 },
949cd82738SStefan Binding 	{ CS42L42_SRC_CTL, 0x03 },
959cd82738SStefan Binding 	{ CS42L42_MCLK_SRC_SEL, 0x00 },
969cd82738SStefan Binding 	{ CS42L42_ASP_FRM_CFG, 0x13 },
979cd82738SStefan Binding 	{ CS42L42_FSYNC_P_LOWER, 0xFF },
989cd82738SStefan Binding 	{ CS42L42_FSYNC_P_UPPER, 0x00 },
999cd82738SStefan Binding 	{ CS42L42_ASP_CLK_CFG, 0x20 },
1009cd82738SStefan Binding 	{ CS42L42_SPDIF_CLK_CFG, 0x0D },
1019cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_AP_RES, 0x02 },
1029cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_BIT_MSB, 0x00 },
1039cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_BIT_LSB, 0x00 },
1049cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_AP_RES, 0x02 },
1059cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_BIT_MSB, 0x00 },
1069cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_BIT_LSB, 0x20 },
1079cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH3_AP_RES, 0x02 },
1089cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH3_BIT_MSB, 0x00 },
1099cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH3_BIT_LSB, 0x80 },
1109cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH4_AP_RES, 0x02 },
1119cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH4_BIT_MSB, 0x00 },
1129cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH4_BIT_LSB, 0xA0 },
1139cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_EN, 0x0C },
1149cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH_EN, 0x01 },
1159cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH_AP_RES, 0x02 },
1169cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH1_BIT_MSB, 0x00 },
1179cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH1_BIT_LSB, 0x00 },
1189cd82738SStefan Binding 	{ CS42L42_ASP_TX_SZ_EN, 0x01 },
1199cd82738SStefan Binding 	{ CS42L42_PWR_CTL1, 0x0A },
1209cd82738SStefan Binding 	{ CS42L42_PWR_CTL2, 0x84 },
1219cd82738SStefan Binding 	{ CS42L42_MIXER_CHA_VOL, 0x3F },
1229cd82738SStefan Binding 	{ CS42L42_MIXER_CHB_VOL, 0x3F },
1239cd82738SStefan Binding 	{ CS42L42_MIXER_ADC_VOL, 0x3f },
1249cd82738SStefan Binding 	{ CS42L42_HP_CTL, 0x03 },
1259cd82738SStefan Binding 	{ CS42L42_MIC_DET_CTL1, 0xB6 },
1269cd82738SStefan Binding 	{ CS42L42_TIPSENSE_CTL, 0xC2 },
1279cd82738SStefan Binding 	{ CS42L42_HS_CLAMP_DISABLE, 0x01 },
1289cd82738SStefan Binding 	{ CS42L42_HS_SWITCH_CTL, 0xF3 },
1299cd82738SStefan Binding 	{ CS42L42_PWR_CTL3, 0x20 },
1309cd82738SStefan Binding 	{ CS42L42_RSENSE_CTL2, 0x00 },
1319cd82738SStefan Binding 	{ CS42L42_RSENSE_CTL3, 0x00 },
1329cd82738SStefan Binding 	{ CS42L42_TSENSE_CTL, 0x80 },
1339cd82738SStefan Binding 	{ CS42L42_HS_BIAS_CTL, 0xC0 },
1349cd82738SStefan Binding 	{ CS42L42_PWR_CTL1, 0x02 },
1359cd82738SStefan Binding 	{ CS42L42_ADC_OVFL_INT_MASK, 0xff },
1369cd82738SStefan Binding 	{ CS42L42_MIXER_INT_MASK, 0xff },
1379cd82738SStefan Binding 	{ CS42L42_SRC_INT_MASK, 0xff },
1389cd82738SStefan Binding 	{ CS42L42_ASP_RX_INT_MASK, 0xff },
1399cd82738SStefan Binding 	{ CS42L42_ASP_TX_INT_MASK, 0xff },
1409cd82738SStefan Binding 	{ CS42L42_CODEC_INT_MASK, 0xff },
1419cd82738SStefan Binding 	{ CS42L42_SRCPL_INT_MASK, 0xff },
1429cd82738SStefan Binding 	{ CS42L42_VPMON_INT_MASK, 0xff },
1439cd82738SStefan Binding 	{ CS42L42_PLL_LOCK_INT_MASK, 0xff },
1449cd82738SStefan Binding 	{ CS42L42_TSRS_PLUG_INT_MASK, 0xff },
1459cd82738SStefan Binding 	{ CS42L42_DET_INT1_MASK, 0xff },
1469cd82738SStefan Binding 	{ CS42L42_DET_INT2_MASK, 0xff },
1479e7647b5SLucas Tanure };
1489e7647b5SLucas Tanure 
1499e7647b5SLucas Tanure /* Vendor specific hw configuration for CS8409 */
1509e7647b5SLucas Tanure const struct cs8409_cir_param cs8409_cs42l42_hw_cfg[] = {
151ccff0064SStefan Binding 	/* +PLL1/2_EN, +I2C_EN */
152ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG1, 0xb008 },
153ccff0064SStefan Binding 	/* ASP1/2_EN=0, ASP1_STP=1 */
154ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG2, 0x0002 },
155ccff0064SStefan Binding 	/* ASP1/2_BUS_IDLE=10, +GPIO_I2C */
156ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG3, 0x0a80 },
157ccff0064SStefan Binding 	/* ASP1.A: TX.LAP=0, TX.LSZ=24 bits, TX.LCS=0 */
158ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_TX_CTRL1, 0x0800 },
159ccff0064SStefan Binding 	/* ASP1.A: TX.RAP=0, TX.RSZ=24 bits, TX.RCS=32 */
160ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_TX_CTRL2, 0x0820 },
161ccff0064SStefan Binding 	/* ASP2.A: TX.LAP=0, TX.LSZ=24 bits, TX.LCS=0 */
162ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, ASP2_A_TX_CTRL1, 0x0800 },
163ccff0064SStefan Binding 	/* ASP2.A: TX.RAP=1, TX.RSZ=24 bits, TX.RCS=0 */
164ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, ASP2_A_TX_CTRL2, 0x2800 },
165ccff0064SStefan Binding 	/* ASP1.A: RX.LAP=0, RX.LSZ=24 bits, RX.LCS=0 */
166ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_RX_CTRL1, 0x0800 },
167ccff0064SStefan Binding 	/* ASP1.A: RX.RAP=0, RX.RSZ=24 bits, RX.RCS=0 */
168ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_RX_CTRL2, 0x0800 },
169ccff0064SStefan Binding 	/* ASP1: LCHI = 00h */
170ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP1_CLK_CTRL1, 0x8000 },
171ccff0064SStefan Binding 	/* ASP1: MC/SC_SRCSEL=PLL1, LCPR=FFh */
172ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP1_CLK_CTRL2, 0x28ff },
173ccff0064SStefan Binding 	/* ASP1: MCEN=0, FSD=011, SCPOL_IN/OUT=0, SCDIV=1:4 */
174ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP1_CLK_CTRL3, 0x0062 },
175ccff0064SStefan Binding 	/* ASP2: LCHI=1Fh */
176ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP2_CLK_CTRL1, 0x801f },
177ccff0064SStefan Binding 	/* ASP2: MC/SC_SRCSEL=PLL1, LCPR=3Fh */
178ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP2_CLK_CTRL2, 0x283f },
179ccff0064SStefan Binding 	/* ASP2: 5050=1, MCEN=0, FSD=010, SCPOL_IN/OUT=1, SCDIV=1:16 */
180ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP2_CLK_CTRL3, 0x805c },
181ccff0064SStefan Binding 	/* DMIC1_MO=10b, DMIC1/2_SR=1 */
182ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DMIC_CFG, 0x0023 },
183ccff0064SStefan Binding 	/* ASP1/2_BEEP=0 */
184ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_BEEP_CFG, 0x0000 },
185ccff0064SStefan Binding 	/* ASP1/2_EN=1, ASP1_STP=1 */
186ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG2, 0x0062 },
187ccff0064SStefan Binding 	/* -PLL2_EN */
188ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG1, 0x9008 },
189ccff0064SStefan Binding 	/* TX2.A: pre-scale att.=0 dB */
190ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PRE_SCALE_ATTN2, 0x0000 },
191ccff0064SStefan Binding 	/* ASP1/2_xxx_EN=1, ASP1/2_MCLK_EN=0, DMIC1_SCL_EN=1 */
192ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PAD_CFG_SLW_RATE_CTRL, 0xfc03 },
193ccff0064SStefan Binding 	/* test mode on */
194ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, 0xc0, 0x9999 },
195ccff0064SStefan Binding 	/* GPIO hysteresis = 30 us */
196ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, 0xc5, 0x0000 },
197ccff0064SStefan Binding 	/* test mode off */
198ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, 0xc0, 0x0000 },
1999e7647b5SLucas Tanure 	{} /* Terminator */
2009e7647b5SLucas Tanure };
2019e7647b5SLucas Tanure 
2029e7647b5SLucas Tanure const struct cs8409_cir_param cs8409_cs42l42_bullseye_atn[] = {
203ccff0064SStefan Binding 	/* EQ_SEL=1, EQ1/2_EN=0 */
204ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_CTRL1, 0x4000 },
205ccff0064SStefan Binding 	/* +EQ_ACC */
206ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0x4000 },
207ccff0064SStefan Binding 	/* +EQ2_EN */
208ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_CTRL1, 0x4010 },
209ccff0064SStefan Binding 	/* EQ_DATA_HI=0x0647 */
210ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0x0647 },
211ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=0, EQ_DATA_LO=0x67 */
212ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc0c7 },
213ccff0064SStefan Binding 	/* EQ_DATA_HI=0x0647 */
214ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0x0647 },
215ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=1, EQ_DATA_LO=0x67 */
216ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc1c7 },
217ccff0064SStefan Binding 	/* EQ_DATA_HI=0xf370 */
218ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0xf370 },
219ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=2, EQ_DATA_LO=0x71 */
220ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc271 },
221ccff0064SStefan Binding 	/* EQ_DATA_HI=0x1ef8 */
222ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0x1ef8 },
223ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=3, EQ_DATA_LO=0x48 */
224ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc348 },
225ccff0064SStefan Binding 	/* EQ_DATA_HI=0xc110 */
226ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0xc110 },
227ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=4, EQ_DATA_LO=0x5a */
228ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc45a },
229ccff0064SStefan Binding 	/* EQ_DATA_HI=0x1f29 */
230ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0x1f29 },
231ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=5, EQ_DATA_LO=0x74 */
232ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc574 },
233ccff0064SStefan Binding 	/* EQ_DATA_HI=0x1d7a */
234ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0x1d7a },
235ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=6, EQ_DATA_LO=0x53 */
236ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc653 },
237ccff0064SStefan Binding 	/* EQ_DATA_HI=0xc38c */
238ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0xc38c },
239ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=7, EQ_DATA_LO=0x14 */
240ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc714 },
241ccff0064SStefan Binding 	/* EQ_DATA_HI=0x1ca3 */
242ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0x1ca3 },
243ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=8, EQ_DATA_LO=0xc7 */
244ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc8c7 },
245ccff0064SStefan Binding 	/* EQ_DATA_HI=0xc38c */
246ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W1, 0xc38c },
247ccff0064SStefan Binding 	/* +EQ_WRT, +EQ_ACC, EQ_ADR=9, EQ_DATA_LO=0x14 */
248ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0xc914 },
249ccff0064SStefan Binding 	/* -EQ_ACC, -EQ_WRT */
250ccff0064SStefan Binding 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PFE_COEF_W2, 0x0000 },
2519e7647b5SLucas Tanure 	{} /* Terminator */
2529e7647b5SLucas Tanure };
25324f7ac3dSLucas Tanure 
25424f7ac3dSLucas Tanure struct sub_codec cs8409_cs42l42_codec = {
25524f7ac3dSLucas Tanure 	.addr = CS42L42_I2C_ADDR,
25624f7ac3dSLucas Tanure 	.reset_gpio = CS8409_CS42L42_RESET,
25724f7ac3dSLucas Tanure 	.irq_mask = CS8409_CS42L42_INT,
25824f7ac3dSLucas Tanure 	.init_seq = cs42l42_init_reg_seq,
25924f7ac3dSLucas Tanure 	.init_seq_num = ARRAY_SIZE(cs42l42_init_reg_seq),
26024f7ac3dSLucas Tanure 	.hp_jack_in = 0,
26124f7ac3dSLucas Tanure 	.mic_jack_in = 0,
26224f7ac3dSLucas Tanure 	.paged = 1,
26324f7ac3dSLucas Tanure 	.suspended = 1,
264404e770aSStefan Binding 	.no_type_dect = 0,
26524f7ac3dSLucas Tanure };
26624f7ac3dSLucas Tanure 
26724f7ac3dSLucas Tanure /******************************************************************************
26820e50772SLucas Tanure  *                          Dolphin Specific Arrays
26920e50772SLucas Tanure  *                            CS8409/ 2 X CS42L42
27020e50772SLucas Tanure  ******************************************************************************/
27120e50772SLucas Tanure 
27220e50772SLucas Tanure const struct hda_verb dolphin_init_verbs[] = {
27320e50772SLucas Tanure 	{ 0x01, AC_VERB_SET_GPIO_WAKE_MASK, DOLPHIN_WAKE }, /* WAKE from GPIO 0,4 */
27420e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_PROC_STATE, 0x0001 }, /* Enable VPW processing  */
27520e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_COEF_INDEX, 0x0002 }, /* Configure GPIO 6,7 */
27620e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_PROC_COEF,  0x0080 }, /* I2C mode */
27720e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_COEF_INDEX, 0x005b }, /* Set I2C bus speed */
27820e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, AC_VERB_SET_PROC_COEF,  0x0200 }, /* 100kHz I2C_STO = 2 */
27920e50772SLucas Tanure 	{} /* terminator */
28020e50772SLucas Tanure };
28120e50772SLucas Tanure 
28265123b89STom Rix static const struct hda_pintbl dolphin_pincfgs[] = {
28320e50772SLucas Tanure 	{ 0x24, 0x022210f0 }, /* ASP-1-TX-A */
28420e50772SLucas Tanure 	{ 0x25, 0x010240f0 }, /* ASP-1-TX-B */
28520e50772SLucas Tanure 	{ 0x34, 0x02a21050 }, /* ASP-1-RX */
28620e50772SLucas Tanure 	{} /* terminator */
28720e50772SLucas Tanure };
28820e50772SLucas Tanure 
28920e50772SLucas Tanure /* Vendor specific HW configuration for CS42L42 */
29020e50772SLucas Tanure static const struct cs8409_i2c_param dolphin_c0_init_reg_seq[] = {
2919cd82738SStefan Binding 	{ CS42L42_I2C_TIMEOUT, 0xB0 },
2929cd82738SStefan Binding 	{ CS42L42_ADC_CTL, 0x00 },
29320e50772SLucas Tanure 	{ 0x1D02, 0x06 },
2949cd82738SStefan Binding 	{ CS42L42_ADC_VOLUME, 0x9F },
2959cd82738SStefan Binding 	{ CS42L42_OSC_SWITCH, 0x01 },
2969cd82738SStefan Binding 	{ CS42L42_MCLK_CTL, 0x02 },
2979cd82738SStefan Binding 	{ CS42L42_SRC_CTL, 0x03 },
2989cd82738SStefan Binding 	{ CS42L42_MCLK_SRC_SEL, 0x00 },
2999cd82738SStefan Binding 	{ CS42L42_ASP_FRM_CFG, 0x13 },
3009cd82738SStefan Binding 	{ CS42L42_FSYNC_P_LOWER, 0xFF },
3019cd82738SStefan Binding 	{ CS42L42_FSYNC_P_UPPER, 0x00 },
3029cd82738SStefan Binding 	{ CS42L42_ASP_CLK_CFG, 0x20 },
3039cd82738SStefan Binding 	{ CS42L42_SPDIF_CLK_CFG, 0x0D },
3049cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_AP_RES, 0x02 },
3059cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_BIT_MSB, 0x00 },
3069cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_BIT_LSB, 0x00 },
3079cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_AP_RES, 0x02 },
3089cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_BIT_MSB, 0x00 },
3099cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_BIT_LSB, 0x20 },
3109cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_EN, 0x0C },
3119cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH_EN, 0x01 },
3129cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH_AP_RES, 0x02 },
3139cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH1_BIT_MSB, 0x00 },
3149cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH1_BIT_LSB, 0x00 },
3159cd82738SStefan Binding 	{ CS42L42_ASP_TX_SZ_EN, 0x01 },
3169cd82738SStefan Binding 	{ CS42L42_PWR_CTL1, 0x0A },
3179cd82738SStefan Binding 	{ CS42L42_PWR_CTL2, 0x84 },
3189cd82738SStefan Binding 	{ CS42L42_HP_CTL, 0x03 },
3199cd82738SStefan Binding 	{ CS42L42_MIXER_CHA_VOL, 0x3F },
3209cd82738SStefan Binding 	{ CS42L42_MIXER_CHB_VOL, 0x3F },
3219cd82738SStefan Binding 	{ CS42L42_MIXER_ADC_VOL, 0x3f },
3229cd82738SStefan Binding 	{ CS42L42_MIC_DET_CTL1, 0xB6 },
3239cd82738SStefan Binding 	{ CS42L42_TIPSENSE_CTL, 0xC2 },
3249cd82738SStefan Binding 	{ CS42L42_HS_CLAMP_DISABLE, 0x01 },
3259cd82738SStefan Binding 	{ CS42L42_HS_SWITCH_CTL, 0xF3 },
3269cd82738SStefan Binding 	{ CS42L42_PWR_CTL3, 0x20 },
3279cd82738SStefan Binding 	{ CS42L42_RSENSE_CTL2, 0x00 },
3289cd82738SStefan Binding 	{ CS42L42_RSENSE_CTL3, 0x00 },
3299cd82738SStefan Binding 	{ CS42L42_TSENSE_CTL, 0x80 },
3309cd82738SStefan Binding 	{ CS42L42_HS_BIAS_CTL, 0xC0 },
3319cd82738SStefan Binding 	{ CS42L42_PWR_CTL1, 0x02 },
3329cd82738SStefan Binding 	{ CS42L42_ADC_OVFL_INT_MASK, 0xff },
3339cd82738SStefan Binding 	{ CS42L42_MIXER_INT_MASK, 0xff },
3349cd82738SStefan Binding 	{ CS42L42_SRC_INT_MASK, 0xff },
3359cd82738SStefan Binding 	{ CS42L42_ASP_RX_INT_MASK, 0xff },
3369cd82738SStefan Binding 	{ CS42L42_ASP_TX_INT_MASK, 0xff },
3379cd82738SStefan Binding 	{ CS42L42_CODEC_INT_MASK, 0xff },
3389cd82738SStefan Binding 	{ CS42L42_SRCPL_INT_MASK, 0xff },
3399cd82738SStefan Binding 	{ CS42L42_VPMON_INT_MASK, 0xff },
3409cd82738SStefan Binding 	{ CS42L42_PLL_LOCK_INT_MASK, 0xff },
3419cd82738SStefan Binding 	{ CS42L42_TSRS_PLUG_INT_MASK, 0xff },
3429cd82738SStefan Binding 	{ CS42L42_DET_INT1_MASK, 0xff },
3439cd82738SStefan Binding 	{ CS42L42_DET_INT2_MASK, 0xff }
34420e50772SLucas Tanure };
34520e50772SLucas Tanure 
34620e50772SLucas Tanure static const struct cs8409_i2c_param dolphin_c1_init_reg_seq[] = {
3479cd82738SStefan Binding 	{ CS42L42_I2C_TIMEOUT, 0xB0 },
3489cd82738SStefan Binding 	{ CS42L42_ADC_CTL, 0x00 },
34920e50772SLucas Tanure 	{ 0x1D02, 0x06 },
3509cd82738SStefan Binding 	{ CS42L42_ADC_VOLUME, 0x9F },
3519cd82738SStefan Binding 	{ CS42L42_OSC_SWITCH, 0x01 },
3529cd82738SStefan Binding 	{ CS42L42_MCLK_CTL, 0x02 },
3539cd82738SStefan Binding 	{ CS42L42_SRC_CTL, 0x03 },
3549cd82738SStefan Binding 	{ CS42L42_MCLK_SRC_SEL, 0x00 },
3559cd82738SStefan Binding 	{ CS42L42_ASP_FRM_CFG, 0x13 },
3569cd82738SStefan Binding 	{ CS42L42_FSYNC_P_LOWER, 0xFF },
3579cd82738SStefan Binding 	{ CS42L42_FSYNC_P_UPPER, 0x00 },
3589cd82738SStefan Binding 	{ CS42L42_ASP_CLK_CFG, 0x20 },
3599cd82738SStefan Binding 	{ CS42L42_SPDIF_CLK_CFG, 0x0D },
3609cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_AP_RES, 0x02 },
3619cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_BIT_MSB, 0x00 },
3629cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH1_BIT_LSB, 0x80 },
3639cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_AP_RES, 0x02 },
3649cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_BIT_MSB, 0x00 },
3659cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_CH2_BIT_LSB, 0xA0 },
3669cd82738SStefan Binding 	{ CS42L42_ASP_RX_DAI0_EN, 0x0C },
3679cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH_EN, 0x00 },
3689cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH_AP_RES, 0x02 },
3699cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH1_BIT_MSB, 0x00 },
3709cd82738SStefan Binding 	{ CS42L42_ASP_TX_CH1_BIT_LSB, 0x00 },
3719cd82738SStefan Binding 	{ CS42L42_ASP_TX_SZ_EN, 0x00 },
3729cd82738SStefan Binding 	{ CS42L42_PWR_CTL1, 0x0E },
3739cd82738SStefan Binding 	{ CS42L42_PWR_CTL2, 0x84 },
3749cd82738SStefan Binding 	{ CS42L42_HP_CTL, 0x01 },
3759cd82738SStefan Binding 	{ CS42L42_MIXER_CHA_VOL, 0x3F },
3769cd82738SStefan Binding 	{ CS42L42_MIXER_CHB_VOL, 0x3F },
3779cd82738SStefan Binding 	{ CS42L42_MIXER_ADC_VOL, 0x3f },
3789cd82738SStefan Binding 	{ CS42L42_MIC_DET_CTL1, 0xB6 },
3799cd82738SStefan Binding 	{ CS42L42_TIPSENSE_CTL, 0xC2 },
3809cd82738SStefan Binding 	{ CS42L42_HS_CLAMP_DISABLE, 0x01 },
3819cd82738SStefan Binding 	{ CS42L42_HS_SWITCH_CTL, 0xF3 },
3829cd82738SStefan Binding 	{ CS42L42_PWR_CTL3, 0x20 },
3839cd82738SStefan Binding 	{ CS42L42_RSENSE_CTL2, 0x00 },
3849cd82738SStefan Binding 	{ CS42L42_RSENSE_CTL3, 0x00 },
3859cd82738SStefan Binding 	{ CS42L42_TSENSE_CTL, 0x80 },
3869cd82738SStefan Binding 	{ CS42L42_HS_BIAS_CTL, 0xC0 },
3879cd82738SStefan Binding 	{ CS42L42_PWR_CTL1, 0x06 },
3889cd82738SStefan Binding 	{ CS42L42_ADC_OVFL_INT_MASK, 0xff },
3899cd82738SStefan Binding 	{ CS42L42_MIXER_INT_MASK, 0xff },
3909cd82738SStefan Binding 	{ CS42L42_SRC_INT_MASK, 0xff },
3919cd82738SStefan Binding 	{ CS42L42_ASP_RX_INT_MASK, 0xff },
3929cd82738SStefan Binding 	{ CS42L42_ASP_TX_INT_MASK, 0xff },
3939cd82738SStefan Binding 	{ CS42L42_CODEC_INT_MASK, 0xff },
3949cd82738SStefan Binding 	{ CS42L42_SRCPL_INT_MASK, 0xff },
3959cd82738SStefan Binding 	{ CS42L42_VPMON_INT_MASK, 0xff },
3969cd82738SStefan Binding 	{ CS42L42_PLL_LOCK_INT_MASK, 0xff },
3979cd82738SStefan Binding 	{ CS42L42_TSRS_PLUG_INT_MASK, 0xff },
3989cd82738SStefan Binding 	{ CS42L42_DET_INT1_MASK, 0xff },
3999cd82738SStefan Binding 	{ CS42L42_DET_INT2_MASK, 0xff }
40020e50772SLucas Tanure };
40120e50772SLucas Tanure 
40220e50772SLucas Tanure /* Vendor specific hw configuration for CS8409 */
40320e50772SLucas Tanure const struct cs8409_cir_param dolphin_hw_cfg[] = {
40420e50772SLucas Tanure 	/* +PLL1/2_EN, +I2C_EN */
40520e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG1, 0xb008 },
40620e50772SLucas Tanure 	/* ASP1_EN=0, ASP1_STP=1 */
40720e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG2, 0x0002 },
40820e50772SLucas Tanure 	/* ASP1/2_BUS_IDLE=10, +GPIO_I2C */
40920e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG3, 0x0a80 },
41020e50772SLucas Tanure 	/* ASP1.A: TX.LAP=0, TX.LSZ=24 bits, TX.LCS=0 */
41120e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_TX_CTRL1, 0x0800 },
41220e50772SLucas Tanure 	/* ASP1.A: TX.RAP=0, TX.RSZ=24 bits, TX.RCS=32 */
41320e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_TX_CTRL2, 0x0820 },
41420e50772SLucas Tanure 	/* ASP1.B: TX.LAP=0, TX.LSZ=24 bits, TX.LCS=128 */
41520e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_B_TX_CTRL1, 0x0880 },
41620e50772SLucas Tanure 	/* ASP1.B: TX.RAP=0, TX.RSZ=24 bits, TX.RCS=160 */
41720e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_B_TX_CTRL2, 0x08a0 },
41820e50772SLucas Tanure 	/* ASP1.A: RX.LAP=0, RX.LSZ=24 bits, RX.LCS=0 */
41920e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_RX_CTRL1, 0x0800 },
42020e50772SLucas Tanure 	/* ASP1.A: RX.RAP=0, RX.RSZ=24 bits, RX.RCS=0 */
42120e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, ASP1_A_RX_CTRL2, 0x0800 },
42220e50772SLucas Tanure 	/* ASP1: LCHI = 00h */
42320e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP1_CLK_CTRL1, 0x8000 },
42420e50772SLucas Tanure 	/* ASP1: MC/SC_SRCSEL=PLL1, LCPR=FFh */
42520e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP1_CLK_CTRL2, 0x28ff },
42620e50772SLucas Tanure 	/* ASP1: MCEN=0, FSD=011, SCPOL_IN/OUT=0, SCDIV=1:4 */
42720e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_ASP1_CLK_CTRL3, 0x0062 },
42820e50772SLucas Tanure 	/* ASP1/2_BEEP=0 */
42920e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_BEEP_CFG, 0x0000 },
43020e50772SLucas Tanure 	/* ASP1_EN=1, ASP1_STP=1 */
43120e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG2, 0x0022 },
43220e50772SLucas Tanure 	/* -PLL2_EN */
43320e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_DEV_CFG1, 0x9008 },
43420e50772SLucas Tanure 	/* ASP1_xxx_EN=1, ASP1_MCLK_EN=0 */
43520e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, CS8409_PAD_CFG_SLW_RATE_CTRL, 0x5400 },
43620e50772SLucas Tanure 	/* test mode on */
43720e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, 0xc0, 0x9999 },
43820e50772SLucas Tanure 	/* GPIO hysteresis = 30 us */
43920e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, 0xc5, 0x0000 },
44020e50772SLucas Tanure 	/* test mode off */
44120e50772SLucas Tanure 	{ CS8409_PIN_VENDOR_WIDGET, 0xc0, 0x0000 },
44220e50772SLucas Tanure 	{} /* Terminator */
44320e50772SLucas Tanure };
44420e50772SLucas Tanure 
44520e50772SLucas Tanure struct sub_codec dolphin_cs42l42_0 = {
44620e50772SLucas Tanure 	.addr = DOLPHIN_C0_I2C_ADDR,
44720e50772SLucas Tanure 	.reset_gpio = DOLPHIN_C0_RESET,
44820e50772SLucas Tanure 	.irq_mask = DOLPHIN_C0_INT,
44920e50772SLucas Tanure 	.init_seq = dolphin_c0_init_reg_seq,
45020e50772SLucas Tanure 	.init_seq_num = ARRAY_SIZE(dolphin_c0_init_reg_seq),
45120e50772SLucas Tanure 	.hp_jack_in = 0,
45220e50772SLucas Tanure 	.mic_jack_in = 0,
45320e50772SLucas Tanure 	.paged = 1,
45420e50772SLucas Tanure 	.suspended = 1,
45520e50772SLucas Tanure 	.no_type_dect = 0,
45620e50772SLucas Tanure };
45720e50772SLucas Tanure 
45820e50772SLucas Tanure struct sub_codec dolphin_cs42l42_1 = {
45920e50772SLucas Tanure 	.addr = DOLPHIN_C1_I2C_ADDR,
46020e50772SLucas Tanure 	.reset_gpio = DOLPHIN_C1_RESET,
46120e50772SLucas Tanure 	.irq_mask = DOLPHIN_C1_INT,
46220e50772SLucas Tanure 	.init_seq = dolphin_c1_init_reg_seq,
46320e50772SLucas Tanure 	.init_seq_num = ARRAY_SIZE(dolphin_c1_init_reg_seq),
46420e50772SLucas Tanure 	.hp_jack_in = 0,
46520e50772SLucas Tanure 	.mic_jack_in = 0,
46620e50772SLucas Tanure 	.paged = 1,
46720e50772SLucas Tanure 	.suspended = 1,
46820e50772SLucas Tanure 	.no_type_dect = 1,
46920e50772SLucas Tanure };
47020e50772SLucas Tanure 
47120e50772SLucas Tanure /******************************************************************************
47224f7ac3dSLucas Tanure  *                         CS8409 Patch Driver Structs
47324f7ac3dSLucas Tanure  *                    Arrays Used for all projects using CS8409
47424f7ac3dSLucas Tanure  ******************************************************************************/
47524f7ac3dSLucas Tanure 
47624f7ac3dSLucas Tanure const struct snd_pci_quirk cs8409_fixup_tbl[] = {
47724f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A11, "Bullseye", CS8409_BULLSEYE),
47824f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A12, "Bullseye", CS8409_BULLSEYE),
47924f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A23, "Bullseye", CS8409_BULLSEYE),
48024f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A24, "Bullseye", CS8409_BULLSEYE),
48124f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A25, "Bullseye", CS8409_BULLSEYE),
48224f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A29, "Bullseye", CS8409_BULLSEYE),
48324f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A2A, "Bullseye", CS8409_BULLSEYE),
48424f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A2B, "Bullseye", CS8409_BULLSEYE),
48524f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A77, "Cyborg", CS8409_CYBORG),
48624f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A78, "Cyborg", CS8409_CYBORG),
48724f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A79, "Cyborg", CS8409_CYBORG),
48824f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A7A, "Cyborg", CS8409_CYBORG),
48924f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A7D, "Cyborg", CS8409_CYBORG),
49024f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A7E, "Cyborg", CS8409_CYBORG),
49124f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A7F, "Cyborg", CS8409_CYBORG),
49224f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0A80, "Cyborg", CS8409_CYBORG),
493bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AB0, "Warlock", CS8409_WARLOCK),
494bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AB2, "Warlock", CS8409_WARLOCK),
495bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AB1, "Warlock", CS8409_WARLOCK),
496bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AB3, "Warlock", CS8409_WARLOCK),
497bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AB4, "Warlock", CS8409_WARLOCK),
498bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AB5, "Warlock", CS8409_WARLOCK),
499bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0ACF, "Dolphin", CS8409_DOLPHIN),
500bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AD0, "Dolphin", CS8409_DOLPHIN),
501bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AD1, "Dolphin", CS8409_DOLPHIN),
502bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AD2, "Dolphin", CS8409_DOLPHIN),
503bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AD3, "Dolphin", CS8409_DOLPHIN),
504bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AD9, "Warlock", CS8409_WARLOCK),
505bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0ADA, "Warlock", CS8409_WARLOCK),
506bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0ADB, "Warlock", CS8409_WARLOCK),
507bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0ADC, "Warlock", CS8409_WARLOCK),
50824f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0ADF, "Cyborg", CS8409_CYBORG),
50924f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AE0, "Cyborg", CS8409_CYBORG),
51024f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AE1, "Cyborg", CS8409_CYBORG),
51124f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AE2, "Cyborg", CS8409_CYBORG),
51224f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AE9, "Cyborg", CS8409_CYBORG),
51324f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AEA, "Cyborg", CS8409_CYBORG),
51424f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AEB, "Cyborg", CS8409_CYBORG),
51524f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AEC, "Cyborg", CS8409_CYBORG),
51624f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AED, "Cyborg", CS8409_CYBORG),
51724f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AEE, "Cyborg", CS8409_CYBORG),
51824f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AEF, "Cyborg", CS8409_CYBORG),
51924f7ac3dSLucas Tanure 	SND_PCI_QUIRK(0x1028, 0x0AF0, "Cyborg", CS8409_CYBORG),
520bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AF4, "Warlock", CS8409_WARLOCK),
521bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0AF5, "Warlock", CS8409_WARLOCK),
5226581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0B92, "Warlock MLK", CS8409_WARLOCK_MLK),
5236581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0B93, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_DUAL_MIC),
5246581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0B94, "Warlock MLK", CS8409_WARLOCK_MLK),
5256581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0B95, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_DUAL_MIC),
5266581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0B96, "Warlock MLK", CS8409_WARLOCK_MLK),
5276581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0B97, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_DUAL_MIC),
52822bb8226SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BA5, "Odin", CS8409_ODIN),
52922bb8226SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BA6, "Odin", CS8409_ODIN),
53022bb8226SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BA8, "Odin", CS8409_ODIN),
53122bb8226SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BAA, "Odin", CS8409_ODIN),
53222bb8226SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BAE, "Odin", CS8409_ODIN),
5336581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB2, "Warlock MLK", CS8409_WARLOCK_MLK),
5346581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB3, "Warlock MLK", CS8409_WARLOCK_MLK),
5356581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB4, "Warlock MLK", CS8409_WARLOCK_MLK),
536bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB5, "Warlock N3 15 TGL-U Nuvoton EC", CS8409_WARLOCK),
537bdc159dfSStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB6, "Warlock V3 15 TGL-U Nuvoton EC", CS8409_WARLOCK),
5386581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB8, "Warlock MLK", CS8409_WARLOCK_MLK),
5396581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BB9, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_DUAL_MIC),
5406581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BBA, "Warlock MLK", CS8409_WARLOCK_MLK),
5416581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BBB, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_DUAL_MIC),
5426581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BBC, "Warlock MLK", CS8409_WARLOCK_MLK),
5436581a045SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0BBD, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_DUAL_MIC),
5445e2baa04SVitaly Rodionov 	SND_PCI_QUIRK(0x1028, 0x0BD4, "Dolphin", CS8409_DOLPHIN),
5455e2baa04SVitaly Rodionov 	SND_PCI_QUIRK(0x1028, 0x0BD5, "Dolphin", CS8409_DOLPHIN),
5465e2baa04SVitaly Rodionov 	SND_PCI_QUIRK(0x1028, 0x0BD6, "Dolphin", CS8409_DOLPHIN),
5475e2baa04SVitaly Rodionov 	SND_PCI_QUIRK(0x1028, 0x0BD7, "Dolphin", CS8409_DOLPHIN),
5485e2baa04SVitaly Rodionov 	SND_PCI_QUIRK(0x1028, 0x0BD8, "Dolphin", CS8409_DOLPHIN),
5491ff954f9SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C43, "Dolphin", CS8409_DOLPHIN),
5501ff954f9SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C50, "Dolphin", CS8409_DOLPHIN),
5511ff954f9SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C51, "Dolphin", CS8409_DOLPHIN),
5521ff954f9SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C52, "Dolphin", CS8409_DOLPHIN),
553*7c761166SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C73, "Dolphin", CS8409_DOLPHIN),
554*7c761166SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C75, "Dolphin", CS8409_DOLPHIN),
555*7c761166SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C7D, "Dolphin", CS8409_DOLPHIN),
556*7c761166SStefan Binding 	SND_PCI_QUIRK(0x1028, 0x0C7F, "Dolphin", CS8409_DOLPHIN),
55724f7ac3dSLucas Tanure 	{} /* terminator */
55824f7ac3dSLucas Tanure };
55924f7ac3dSLucas Tanure 
56024f7ac3dSLucas Tanure /* Dell Inspiron models with cs8409/cs42l42 */
56124f7ac3dSLucas Tanure const struct hda_model_fixup cs8409_models[] = {
56224f7ac3dSLucas Tanure 	{ .id = CS8409_BULLSEYE, .name = "bullseye" },
56324f7ac3dSLucas Tanure 	{ .id = CS8409_WARLOCK, .name = "warlock" },
5646581a045SStefan Binding 	{ .id = CS8409_WARLOCK_MLK, .name = "warlock mlk" },
5656581a045SStefan Binding 	{ .id = CS8409_WARLOCK_MLK_DUAL_MIC, .name = "warlock mlk dual mic" },
56624f7ac3dSLucas Tanure 	{ .id = CS8409_CYBORG, .name = "cyborg" },
56720e50772SLucas Tanure 	{ .id = CS8409_DOLPHIN, .name = "dolphin" },
56822bb8226SStefan Binding 	{ .id = CS8409_ODIN, .name = "odin" },
56924f7ac3dSLucas Tanure 	{}
57024f7ac3dSLucas Tanure };
57124f7ac3dSLucas Tanure 
57224f7ac3dSLucas Tanure const struct hda_fixup cs8409_fixups[] = {
57324f7ac3dSLucas Tanure 	[CS8409_BULLSEYE] = {
57424f7ac3dSLucas Tanure 		.type = HDA_FIXUP_PINS,
57524f7ac3dSLucas Tanure 		.v.pins = cs8409_cs42l42_pincfgs,
57624f7ac3dSLucas Tanure 		.chained = true,
57724f7ac3dSLucas Tanure 		.chain_id = CS8409_FIXUPS,
57824f7ac3dSLucas Tanure 	},
57924f7ac3dSLucas Tanure 	[CS8409_WARLOCK] = {
58024f7ac3dSLucas Tanure 		.type = HDA_FIXUP_PINS,
58124f7ac3dSLucas Tanure 		.v.pins = cs8409_cs42l42_pincfgs,
58224f7ac3dSLucas Tanure 		.chained = true,
58324f7ac3dSLucas Tanure 		.chain_id = CS8409_FIXUPS,
58424f7ac3dSLucas Tanure 	},
5856581a045SStefan Binding 	[CS8409_WARLOCK_MLK] = {
5866581a045SStefan Binding 		.type = HDA_FIXUP_PINS,
5876581a045SStefan Binding 		.v.pins = cs8409_cs42l42_pincfgs,
5886581a045SStefan Binding 		.chained = true,
5896581a045SStefan Binding 		.chain_id = CS8409_FIXUPS,
5906581a045SStefan Binding 	},
5916581a045SStefan Binding 	[CS8409_WARLOCK_MLK_DUAL_MIC] = {
5926581a045SStefan Binding 		.type = HDA_FIXUP_PINS,
5936581a045SStefan Binding 		.v.pins = cs8409_cs42l42_pincfgs,
5946581a045SStefan Binding 		.chained = true,
5956581a045SStefan Binding 		.chain_id = CS8409_FIXUPS,
5966581a045SStefan Binding 	},
59724f7ac3dSLucas Tanure 	[CS8409_CYBORG] = {
59824f7ac3dSLucas Tanure 		.type = HDA_FIXUP_PINS,
59924f7ac3dSLucas Tanure 		.v.pins = cs8409_cs42l42_pincfgs,
60024f7ac3dSLucas Tanure 		.chained = true,
60124f7ac3dSLucas Tanure 		.chain_id = CS8409_FIXUPS,
60224f7ac3dSLucas Tanure 	},
60324f7ac3dSLucas Tanure 	[CS8409_FIXUPS] = {
60424f7ac3dSLucas Tanure 		.type = HDA_FIXUP_FUNC,
60524f7ac3dSLucas Tanure 		.v.func = cs8409_cs42l42_fixups,
60624f7ac3dSLucas Tanure 	},
60720e50772SLucas Tanure 	[CS8409_DOLPHIN] = {
60820e50772SLucas Tanure 		.type = HDA_FIXUP_PINS,
60920e50772SLucas Tanure 		.v.pins = dolphin_pincfgs,
61020e50772SLucas Tanure 		.chained = true,
61120e50772SLucas Tanure 		.chain_id = CS8409_DOLPHIN_FIXUPS,
61220e50772SLucas Tanure 	},
61320e50772SLucas Tanure 	[CS8409_DOLPHIN_FIXUPS] = {
61420e50772SLucas Tanure 		.type = HDA_FIXUP_FUNC,
61520e50772SLucas Tanure 		.v.func = dolphin_fixups,
61620e50772SLucas Tanure 	},
61722bb8226SStefan Binding 	[CS8409_ODIN] = {
61822bb8226SStefan Binding 		.type = HDA_FIXUP_PINS,
61922bb8226SStefan Binding 		.v.pins = cs8409_cs42l42_pincfgs_no_dmic,
62022bb8226SStefan Binding 		.chained = true,
62122bb8226SStefan Binding 		.chain_id = CS8409_FIXUPS,
62222bb8226SStefan Binding 	},
62324f7ac3dSLucas Tanure };
624