[PATCH 13/13] ALSA: hda: Let LED cdev handling suspend/resume

Takashi Iwai tiwai at suse.de
Thu Jun 18 13:08:42 CEST 2020


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: Kai-Heng Feng <kai.heng.feng at canonical.com>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/hda/hda_generic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index c74519d7096b..9074265d934a 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -3908,6 +3908,7 @@ static int create_mute_led_cdev(struct hda_codec *codec,
 	cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute";
 	cdev->brightness_set_blocking = callback;
 	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);
 }
-- 
2.16.4



More information about the Alsa-devel mailing list