@@ -82,6 +82,7 @@ struct wm8962_priv {
82
82
#endif
83
83
84
84
int irq ;
85
+ bool master_flag ;
85
86
};
86
87
87
88
/* We can't use the same notifier block for more than one supply and
@@ -2715,6 +2716,7 @@ static int wm8962_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
2715
2716
static int wm8962_set_dai_fmt (struct snd_soc_dai * dai , unsigned int fmt )
2716
2717
{
2717
2718
struct snd_soc_component * component = dai -> component ;
2719
+ struct wm8962_priv * wm8962 = snd_soc_component_get_drvdata (component );
2718
2720
int aif0 = 0 ;
2719
2721
2720
2722
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK ) {
@@ -2761,9 +2763,11 @@ static int wm8962_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
2761
2763
return - EINVAL ;
2762
2764
}
2763
2765
2766
+ wm8962 -> master_flag = false;
2764
2767
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK ) {
2765
2768
case SND_SOC_DAIFMT_CBP_CFP :
2766
2769
aif0 |= WM8962_MSTR ;
2770
+ wm8962 -> master_flag = true;
2767
2771
break ;
2768
2772
case SND_SOC_DAIFMT_CBC_CFC :
2769
2773
break ;
@@ -3903,6 +3907,9 @@ static int wm8962_runtime_resume(struct device *dev)
3903
3907
WM8962_BIAS_ENA | WM8962_VMID_SEL_MASK ,
3904
3908
WM8962_BIAS_ENA | 0x180 );
3905
3909
3910
+ if (wm8962 -> master_flag )
3911
+ regmap_update_bits (wm8962 -> regmap , WM8962_AUDIO_INTERFACE_0 ,
3912
+ WM8962_MSTR , WM8962_MSTR );
3906
3913
msleep (5 );
3907
3914
3908
3915
return 0 ;
@@ -3916,6 +3923,10 @@ static int wm8962_runtime_suspend(struct device *dev)
3916
3923
{
3917
3924
struct wm8962_priv * wm8962 = dev_get_drvdata (dev );
3918
3925
3926
+ if (wm8962 -> master_flag )
3927
+ regmap_update_bits (wm8962 -> regmap , WM8962_AUDIO_INTERFACE_0 ,
3928
+ WM8962_MSTR , 0 );
3929
+
3919
3930
regmap_update_bits (wm8962 -> regmap , WM8962_PWR_MGMT_1 ,
3920
3931
WM8962_VMID_SEL_MASK | WM8962_BIAS_ENA , 0 );
3921
3932
0 commit comments