OSDN Git Service

ALSA: hda - Record the current power state before suspend/resume calls
authorTakashi Iwai <tiwai@suse.de>
Tue, 29 Jan 2019 13:03:33 +0000 (14:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:23:16 +0000 (06:23 +0200)
commit2569eed24d93ce94c34efd1a8eaf17d1d03eb66e
treeaf095c464245d713c27e1df72d00d29c02595d9d
parent4aada79c6793c59e484b69fd4ed591396e2d4b39
ALSA: hda - Record the current power state before suspend/resume calls

commit 98081ca62cbac31fb0f7efaf90b2e7384ce22257 upstream.

Currently we deal with single codec and suspend codec callbacks for
all S3, S4 and runtime PM handling.  But it turned out that we want
distinguish the call patterns sometimes, e.g. for applying some init
sequence only at probing and restoring from hibernate.

This patch slightly modifies the common PM callbacks for HD-audio
codec and stores the currently processed PM event in power_state of
the codec's device.power field, which is currently unused.  The codec
callback can take a look at this event value and judges which purpose
it's being called.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/hda_codec.c