@@ -1437,6 +1437,28 @@ static const struct snd_kcontrol_new hpor_switch =
14371437 SOC_DAPM_SINGLE_AUTODISABLE ("Switch" , RT5682_HP_CTRL_1 ,
14381438 RT5682_R_MUTE_SFT , 1 , 1 );
14391439
1440+ static int rt5682_charge_pump_event (struct snd_soc_dapm_widget * w ,
1441+ struct snd_kcontrol * kcontrol , int event )
1442+ {
1443+ struct snd_soc_component * component =
1444+ snd_soc_dapm_to_component (w -> dapm );
1445+
1446+ switch (event ) {
1447+ case SND_SOC_DAPM_PRE_PMU :
1448+ snd_soc_component_update_bits (component ,
1449+ RT5682_HP_CHARGE_PUMP_1 , RT5682_PM_HP_MASK , RT5682_PM_HP_HV );
1450+ break ;
1451+ case SND_SOC_DAPM_POST_PMD :
1452+ snd_soc_component_update_bits (component ,
1453+ RT5682_HP_CHARGE_PUMP_1 , RT5682_PM_HP_MASK , RT5682_PM_HP_LV );
1454+ break ;
1455+ default :
1456+ return 0 ;
1457+ }
1458+
1459+ return 0 ;
1460+ }
1461+
14401462static int rt5682_hp_event (struct snd_soc_dapm_widget * w ,
14411463 struct snd_kcontrol * kcontrol , int event )
14421464{
@@ -1449,8 +1471,6 @@ static int rt5682_hp_event(struct snd_soc_dapm_widget *w,
14491471 RT5682_HP_LOGIC_CTRL_2 , 0x0012 );
14501472 snd_soc_component_write (component ,
14511473 RT5682_HP_CTRL_2 , 0x6000 );
1452- snd_soc_component_update_bits (component , RT5682_STO_NG2_CTRL_1 ,
1453- RT5682_NG2_EN_MASK , RT5682_NG2_EN );
14541474 snd_soc_component_update_bits (component ,
14551475 RT5682_DEPOP_1 , 0x60 , 0x60 );
14561476 break ;
@@ -1723,7 +1743,8 @@ static const struct snd_soc_dapm_widget rt5682_dapm_widgets[] = {
17231743 SND_SOC_DAPM_SUPPLY ("HP Amp R" , RT5682_PWR_ANLG_1 ,
17241744 RT5682_PWR_HA_R_BIT , 0 , NULL , 0 ),
17251745 SND_SOC_DAPM_SUPPLY_S ("Charge Pump" , 1 , RT5682_DEPOP_1 ,
1726- RT5682_PUMP_EN_SFT , 0 , NULL , 0 ),
1746+ RT5682_PUMP_EN_SFT , 0 , rt5682_charge_pump_event ,
1747+ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD ),
17271748 SND_SOC_DAPM_SUPPLY_S ("Capless" , 2 , RT5682_DEPOP_1 ,
17281749 RT5682_CAPLESS_EN_SFT , 0 , NULL , 0 ),
17291750
@@ -1884,6 +1905,7 @@ static const struct snd_soc_dapm_route rt5682_dapm_routes[] = {
18841905 {"HP Amp" , NULL , "Charge Pump" },
18851906 {"HP Amp" , NULL , "CLKDET SYS" },
18861907 {"HP Amp" , NULL , "CBJ Power" },
1908+ {"HP Amp" , NULL , "Vref1" },
18871909 {"HP Amp" , NULL , "Vref2" },
18881910 {"HPOL Playback" , "Switch" , "HP Amp" },
18891911 {"HPOR Playback" , "Switch" , "HP Amp" },
@@ -2607,6 +2629,10 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
26072629 RT5682_GP4_PIN_MASK | RT5682_GP5_PIN_MASK ,
26082630 RT5682_GP4_PIN_ADCDAT1 | RT5682_GP5_PIN_DACDAT1 );
26092631 regmap_write (rt5682 -> regmap , RT5682_TEST_MODE_CTRL_1 , 0x0000 );
2632+ regmap_update_bits (rt5682 -> regmap , RT5682_BIAS_CUR_CTRL_8 ,
2633+ RT5682_HPA_CP_BIAS_CTRL_MASK , RT5682_HPA_CP_BIAS_3UA );
2634+ regmap_update_bits (rt5682 -> regmap , RT5682_CHARGE_PUMP_1 ,
2635+ RT5682_CP_CLK_HP_MASK , RT5682_CP_CLK_HP_300KHZ );
26102636
26112637 INIT_DELAYED_WORK (& rt5682 -> jack_detect_work ,
26122638 rt5682_jack_detect_handler );
0 commit comments