Skip to content

Commit 414d38b

Browse files
committed
ALSA: hda/sigmatel: Keep power up while beep is enabled
It seems that the beep playback doesn't work well on IDT codec devices when the codec auto-pm is enabled. Keep the power on while the beep switch is enabled. Link: https://bugzilla.suse.com/show_bug.cgi?id=1200544 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 3e48940 commit 414d38b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

sound/pci/hda/patch_sigmatel.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)