@@ -967,13 +967,12 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
967
967
rt5682_enable_push_button_irq (component , false);
968
968
snd_soc_component_update_bits (component , RT5682_CBJ_CTRL_1 ,
969
969
RT5682_TRIG_JD_MASK , RT5682_TRIG_JD_LOW );
970
- if (snd_soc_dapm_get_pin_status (dapm , "MICBIAS" ))
970
+ if (! snd_soc_dapm_get_pin_status (dapm , "MICBIAS" ))
971
971
snd_soc_component_update_bits (component ,
972
- RT5682_PWR_ANLG_1 , RT5682_PWR_VREF2 , 0 );
973
- else
972
+ RT5682_PWR_ANLG_1 , RT5682_PWR_MB , 0 );
973
+ if (! snd_soc_dapm_get_pin_status ( dapm , "Vref2" ))
974
974
snd_soc_component_update_bits (component ,
975
- RT5682_PWR_ANLG_1 ,
976
- RT5682_PWR_VREF2 | RT5682_PWR_MB , 0 );
975
+ RT5682_PWR_ANLG_1 , RT5682_PWR_VREF2 , 0 );
977
976
snd_soc_component_update_bits (component , RT5682_PWR_ANLG_3 ,
978
977
RT5682_PWR_CBJ , 0 );
979
978
@@ -1609,8 +1608,7 @@ static const struct snd_soc_dapm_widget rt5682_dapm_widgets[] = {
1609
1608
0 , set_filter_clk , SND_SOC_DAPM_PRE_PMU ),
1610
1609
SND_SOC_DAPM_SUPPLY ("Vref1" , RT5682_PWR_ANLG_1 , RT5682_PWR_VREF1_BIT , 0 ,
1611
1610
rt5682_set_verf , SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU ),
1612
- SND_SOC_DAPM_SUPPLY ("Vref2" , RT5682_PWR_ANLG_1 , RT5682_PWR_VREF2_BIT , 0 ,
1613
- NULL , 0 ),
1611
+ SND_SOC_DAPM_SUPPLY ("Vref2" , SND_SOC_NOPM , 0 , 0 , NULL , 0 ),
1614
1612
SND_SOC_DAPM_SUPPLY ("MICBIAS" , SND_SOC_NOPM , 0 , 0 , NULL , 0 ),
1615
1613
1616
1614
/* ASRC */
@@ -2493,6 +2491,15 @@ static int rt5682_wclk_prepare(struct clk_hw *hw)
2493
2491
snd_soc_dapm_force_enable_pin_unlocked (dapm , "MICBIAS" );
2494
2492
snd_soc_component_update_bits (component , RT5682_PWR_ANLG_1 ,
2495
2493
RT5682_PWR_MB , RT5682_PWR_MB );
2494
+
2495
+ snd_soc_dapm_force_enable_pin_unlocked (dapm , "Vref2" );
2496
+ snd_soc_component_update_bits (component , RT5682_PWR_ANLG_1 ,
2497
+ RT5682_PWR_VREF2 | RT5682_PWR_FV2 ,
2498
+ RT5682_PWR_VREF2 );
2499
+ usleep_range (55000 , 60000 );
2500
+ snd_soc_component_update_bits (component , RT5682_PWR_ANLG_1 ,
2501
+ RT5682_PWR_FV2 , RT5682_PWR_FV2 );
2502
+
2496
2503
snd_soc_dapm_force_enable_pin_unlocked (dapm , "I2S1" );
2497
2504
snd_soc_dapm_force_enable_pin_unlocked (dapm , "PLL2F" );
2498
2505
snd_soc_dapm_force_enable_pin_unlocked (dapm , "PLL2B" );
@@ -2518,9 +2525,12 @@ static void rt5682_wclk_unprepare(struct clk_hw *hw)
2518
2525
snd_soc_dapm_mutex_lock (dapm );
2519
2526
2520
2527
snd_soc_dapm_disable_pin_unlocked (dapm , "MICBIAS" );
2528
+ snd_soc_dapm_disable_pin_unlocked (dapm , "Vref2" );
2521
2529
if (!rt5682 -> jack_type )
2522
2530
snd_soc_component_update_bits (component , RT5682_PWR_ANLG_1 ,
2531
+ RT5682_PWR_VREF2 | RT5682_PWR_FV2 |
2523
2532
RT5682_PWR_MB , 0 );
2533
+
2524
2534
snd_soc_dapm_disable_pin_unlocked (dapm , "I2S1" );
2525
2535
snd_soc_dapm_disable_pin_unlocked (dapm , "PLL2F" );
2526
2536
snd_soc_dapm_disable_pin_unlocked (dapm , "PLL2B" );
0 commit comments