summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-04 10:17:28 (GMT)
committerTakashi Iwai <tiwai@suse.de>2015-04-04 10:22:52 (GMT)
commitd545a57c5f84c01b50187177921e232a450858c7 (patch)
treed4f756b072131bef0c4b04b67e00aaa872fa371b /include
parent664bc5c55923712a8aabd2a390ed7477325e32df (diff)
downloadlinux-d545a57c5f84c01b50187177921e232a450858c7.tar.xz
ALSA: hda - Sync node attributes at resume from widget power saving
So far we assumed that the node attributes like amp values remain during the power state transition of the node itself. While this is true for IDT/STAC codecs I've tested, but some other codecs don't seem behaving in that way. This patch implements a partial sync mechanism specific to the given widget node. Now we've merged the regmap support, and it can be easily written with regcache_sync_region(). Tested-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/sound/hda_regmap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sound/hda_regmap.h b/include/sound/hda_regmap.h
index 76648cc..53a18b3 100644
--- a/include/sound/hda_regmap.h
+++ b/include/sound/hda_regmap.h
@@ -202,4 +202,16 @@ snd_hdac_regmap_update_amp_stereo(struct hdac_device *codec, hda_nid_t nid,
return snd_hdac_regmap_update_raw(codec, cmd, mask, val);
}
+/**
+ * snd_hdac_regmap_sync_node - sync the widget node attributes
+ * @codec: HD-audio codec
+ * @nid: NID to sync
+ */
+static inline void
+snd_hdac_regmap_sync_node(struct hdac_device *codec, hda_nid_t nid)
+{
+ regcache_mark_dirty(codec->regmap);
+ regcache_sync_region(codec->regmap, nid << 20, ((nid + 1) << 20) - 1);
+}
+
#endif /* __SOUND_HDA_REGMAP_H */