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 {
209209
210210 /* beep widgets */
211211 hda_nid_t anabeep_nid ;
212+ bool beep_power_on ;
212213
213214 /* SPDIF-out mux */
214215 const char * const * spdif_labels ;
@@ -4443,6 +4444,26 @@ static int stac_suspend(struct hda_codec *codec)
44434444
44444445 return 0 ;
44454446}
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+ }
44464467#else
44474468#define stac_suspend NULL
44484469#endif /* CONFIG_PM */
@@ -4455,6 +4476,7 @@ static const struct hda_codec_ops stac_patch_ops = {
44554476 .unsol_event = snd_hda_jack_unsol_event ,
44564477#ifdef CONFIG_PM
44574478 .suspend = stac_suspend ,
4479+ .check_power_status = stac_check_power_status ,
44584480#endif
44594481};
44604482
You can’t perform that action at this time.
0 commit comments