File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ struct sigmatel_spec {
209
209
210
210
/* beep widgets */
211
211
hda_nid_t anabeep_nid ;
212
+ bool beep_power_on ;
212
213
213
214
/* SPDIF-out mux */
214
215
const char * const * spdif_labels ;
@@ -4443,6 +4444,26 @@ static int stac_suspend(struct hda_codec *codec)
4443
4444
4444
4445
return 0 ;
4445
4446
}
4447
+
4448
+ static int stac_check_power_status (struct hda_codec * codec , hda_nid_t nid )
4449
+ {
4450
+ struct sigmatel_spec * spec = codec -> spec ;
4451
+ int ret = snd_hda_gen_check_power_status (codec , nid );
4452
+
4453
+ #ifdef CONFIG_SND_HDA_INPUT_BEEP
4454
+ if (nid == spec -> gen .beep_nid && codec -> beep ) {
4455
+ if (codec -> beep -> enabled != spec -> beep_power_on ) {
4456
+ spec -> beep_power_on = codec -> beep -> enabled ;
4457
+ if (spec -> beep_power_on )
4458
+ snd_hda_power_up_pm (codec );
4459
+ else
4460
+ snd_hda_power_down_pm (codec );
4461
+ }
4462
+ ret |= spec -> beep_power_on ;
4463
+ }
4464
+ #endif
4465
+ return ret ;
4466
+ }
4446
4467
#else
4447
4468
#define stac_suspend NULL
4448
4469
#endif /* CONFIG_PM */
@@ -4455,6 +4476,7 @@ static const struct hda_codec_ops stac_patch_ops = {
4455
4476
.unsol_event = snd_hda_jack_unsol_event ,
4456
4477
#ifdef CONFIG_PM
4457
4478
.suspend = stac_suspend ,
4479
+ .check_power_status = stac_check_power_status ,
4458
4480
#endif
4459
4481
};
4460
4482
You can’t perform that action at this time.
0 commit comments