Commit c9e272f9 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda: Let LED cdev handling suspend/resume

Set LED_CORE_SUSPENDRESUME to LED cdev flags, so that the LED core
would store and restore the LED status at suspend/resume.

In theory, the codec driver should be responsible for all LED bits,
but this might be safer and cover the overlooked cases.
Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200618110842.27238-14-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 766538ac
...@@ -3908,6 +3908,7 @@ static int create_mute_led_cdev(struct hda_codec *codec, ...@@ -3908,6 +3908,7 @@ static int create_mute_led_cdev(struct hda_codec *codec,
cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute"; cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute";
cdev->brightness_set_blocking = callback; cdev->brightness_set_blocking = callback;
cdev->brightness = ledtrig_audio_get(micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE); cdev->brightness = ledtrig_audio_get(micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE);
cdev->flags = LED_CORE_SUSPENDRESUME;
return devm_led_classdev_register(&codec->core.dev, cdev); return devm_led_classdev_register(&codec->core.dev, cdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment