OSDN Git Service

ALSA: hda - Move in_pm accessors to HDA core
authorTakashi Iwai <tiwai@suse.de>
Wed, 27 Jun 2018 07:03:51 +0000 (09:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 27 Jun 2018 22:02:59 +0000 (00:02 +0200)
commitfeb20faec73ba0b30f949d54c4153cf0ad3807c8
treea08d7c490354e90352bbec2fe863132e9fe002b2
parentc288248f5b26cd5563112fcdc077bf44964a942d
ALSA: hda - Move in_pm accessors to HDA core

The in_pm atomic in hdac_device is an important field used as a flag
as well as a refcount for PM.  The existing snd_hdac_power_up/down
helpers already refer to it in the HD-audio core code, while the code
to actually setting the value (atomic_inc() / _dec()) is open-coded in
HDA legacy side, which is hard to find.

This patch adds the helper functions to set/reset the in_pm counter to
HDA core and use them in HDA legacy side, for making it clearer who /
where the PM is managed.

There is no functional changes, just code refactoring.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hdaudio.h
sound/pci/hda/hda_codec.c
sound/pci/hda/patch_hdmi.c