From: Mengdong Lin <mengdong.lin@intel.com>
Date: Tue, 14 Apr 2015 03:25:36 +0000 (+0800)
Subject: ALSA: hda - set GET bit when adding a vendor verb to the codec regmap
X-Git-Tag: v4.1-rc1~117^2
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d6eb9e3ec78c98324097bab8eea266c3bb0d0ac7;p=users%2Fdwmw2%2Flinux.git

ALSA: hda - set GET bit when adding a vendor verb to the codec regmap

Some HD-A codecs may add their own vendor 'set' verb to the regmap, thru func
snd_hdac_add_vendor_verb(). This patch sets the GET bit (bit 11)  when adding
the verb so that its peer vendor 'get' verb is actually added. This can avoid
I/O error when writing the 'set' verb thru remap, since HD-A regmap internally
looks up a writable vendor verb with GET bit set at first.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---

diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c
index 51f1b5c8a91cc..7371e0c3926f3 100644
--- a/sound/hda/hdac_regmap.c
+++ b/sound/hda/hdac_regmap.c
@@ -368,7 +368,7 @@ int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec,
 
 	if (!p)
 		return -ENOMEM;
-	*p = verb;
+	*p = verb | 0x800; /* set GET bit */
 	return 0;
 }
 EXPORT_SYMBOL_GPL(snd_hdac_regmap_add_vendor_verb);