mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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/20220904072750.26164-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
3e48940abe
commit
414d38ba87
1 changed files with 22 additions and 0 deletions
|
@ -209,6 +209,7 @@ struct sigmatel_spec {
|
||||||
|
|
||||||
/* beep widgets */
|
/* beep widgets */
|
||||||
hda_nid_t anabeep_nid;
|
hda_nid_t anabeep_nid;
|
||||||
|
bool beep_power_on;
|
||||||
|
|
||||||
/* SPDIF-out mux */
|
/* SPDIF-out mux */
|
||||||
const char * const *spdif_labels;
|
const char * const *spdif_labels;
|
||||||
|
@ -4443,6 +4444,26 @@ static int stac_suspend(struct hda_codec *codec)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int stac_check_power_status(struct hda_codec *codec, hda_nid_t nid)
|
||||||
|
{
|
||||||
|
struct sigmatel_spec *spec = codec->spec;
|
||||||
|
int ret = snd_hda_gen_check_power_status(codec, nid);
|
||||||
|
|
||||||
|
#ifdef CONFIG_SND_HDA_INPUT_BEEP
|
||||||
|
if (nid == spec->gen.beep_nid && codec->beep) {
|
||||||
|
if (codec->beep->enabled != spec->beep_power_on) {
|
||||||
|
spec->beep_power_on = codec->beep->enabled;
|
||||||
|
if (spec->beep_power_on)
|
||||||
|
snd_hda_power_up_pm(codec);
|
||||||
|
else
|
||||||
|
snd_hda_power_down_pm(codec);
|
||||||
|
}
|
||||||
|
ret |= spec->beep_power_on;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define stac_suspend NULL
|
#define stac_suspend NULL
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
@ -4455,6 +4476,7 @@ static const struct hda_codec_ops stac_patch_ops = {
|
||||||
.unsol_event = snd_hda_jack_unsol_event,
|
.unsol_event = snd_hda_jack_unsol_event,
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
.suspend = stac_suspend,
|
.suspend = stac_suspend,
|
||||||
|
.check_power_status = stac_check_power_status,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue