Skip to content

Commit 140e076

Browse files
Jack Yubroonie
authored andcommitted
ASoC: rt722-sdca: add headset microphone vrefo setting
Add vrefo settings to fix jd and headset mic recording issue. Signed-off-by: Jack Yu <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent cb99469 commit 140e076

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

sound/soc/codecs/rt722-sdca.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,9 +1439,12 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
14391439
int loop_check, chk_cnt = 100, ret;
14401440
unsigned int calib_status = 0;
14411441

1442-
/* Read eFuse */
1443-
rt722_sdca_index_write(rt722, RT722_VENDOR_SPK_EFUSE, RT722_DC_CALIB_CTRL,
1444-
0x4808);
1442+
/* Config analog bias */
1443+
rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_ANALOG_BIAS_CTL3,
1444+
0xa081);
1445+
/* GE related settings */
1446+
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_GE_RELATED_CTL2,
1447+
0xa009);
14451448
/* Button A, B, C, D bypass mode */
14461449
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_UMP_HID_CTL4,
14471450
0xcf00);
@@ -1475,9 +1478,6 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
14751478
if ((calib_status & 0x0040) == 0x0)
14761479
break;
14771480
}
1478-
/* Release HP-JD, EN_CBJ_TIE_GL/R open, en_osw gating auto done bit */
1479-
rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_DIGITAL_MISC_CTRL4,
1480-
0x0010);
14811481
/* Set ADC09 power entity floating control */
14821482
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ADC0A_08_PDE_FLOAT_CTL,
14831483
0x2a12);
@@ -1490,8 +1490,21 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
14901490
/* Set DAC03 and HP power entity floating control */
14911491
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_DAC03_HP_PDE_FLOAT_CTL,
14921492
0x4040);
1493+
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ENT_FLOAT_CTRL_1,
1494+
0x4141);
1495+
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_FLOAT_CTRL_1,
1496+
0x0101);
14931497
/* Fine tune PDE40 latency */
14941498
regmap_write(rt722->regmap, 0x2f58, 0x07);
1499+
regmap_write(rt722->regmap, 0x2f03, 0x06);
1500+
/* MIC VRefo */
1501+
rt722_sdca_index_update_bits(rt722, RT722_VENDOR_REG,
1502+
RT722_COMBO_JACK_AUTO_CTL1, 0x0200, 0x0200);
1503+
rt722_sdca_index_update_bits(rt722, RT722_VENDOR_REG,
1504+
RT722_VREFO_GAT, 0x4000, 0x4000);
1505+
/* Release HP-JD, EN_CBJ_TIE_GL/R open, en_osw gating auto done bit */
1506+
rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_DIGITAL_MISC_CTRL4,
1507+
0x0010);
14951508
}
14961509

14971510
int rt722_sdca_io_init(struct device *dev, struct sdw_slave *slave)

sound/soc/codecs/rt722-sdca.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct rt722_sdca_dmic_kctrl_priv {
6969
#define RT722_COMBO_JACK_AUTO_CTL2 0x46
7070
#define RT722_COMBO_JACK_AUTO_CTL3 0x47
7171
#define RT722_DIGITAL_MISC_CTRL4 0x4a
72+
#define RT722_VREFO_GAT 0x63
7273
#define RT722_FSM_CTL 0x67
7374
#define RT722_SDCA_INTR_REC 0x82
7475
#define RT722_SW_CONFIG1 0x8a
@@ -127,6 +128,8 @@ struct rt722_sdca_dmic_kctrl_priv {
127128
#define RT722_UMP_HID_CTL6 0x66
128129
#define RT722_UMP_HID_CTL7 0x67
129130
#define RT722_UMP_HID_CTL8 0x68
131+
#define RT722_FLOAT_CTRL_1 0x70
132+
#define RT722_ENT_FLOAT_CTRL_1 0x76
130133

131134
/* Parameter & Verb control 01 (0x1a)(NID:20h) */
132135
#define RT722_HIDDEN_REG_SW_RESET (0x1 << 14)

0 commit comments

Comments
 (0)