summaryrefslogtreecommitdiffstats
path: root/sound/hda/hdac_regmap.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-26 08:54:56 +0100
committerTakashi Iwai <tiwai@suse.de>2015-03-23 13:19:40 +0100
commitfaa75f8a2edf005a5caf43be4875ffeeb9bcb498 (patch)
tree5158cb6255a448080b16c376b1006e8e29f946aa /sound/hda/hdac_regmap.c
parenteeecd9d10d3da0b9efd6f58fad55c4355dcc246a (diff)
downloadblackbird-obmc-linux-faa75f8a2edf005a5caf43be4875ffeeb9bcb498.tar.gz
blackbird-obmc-linux-faa75f8a2edf005a5caf43be4875ffeeb9bcb498.zip
ALSA: hda - Use regmap for parameter caches, too
The amp hash table was used for recording the cached reads of some capability values like pin caps or amp caps. Now all these are moved to regmap as well. One addition to the regmap helper is codec->caps_overwriting flag. This is set in snd_hdac_override_parm(), and the regmap helper accepts any register while this flag is set, so that it can overwrite even the read-only verb like AC_VERB_PARAMETERS. The flag is cleared immediately in snd_hdac_override_parm(), as it's a once-off flag. Along with these changes, the no longer needed amp hash and relevant fields are removed from hda_codec struct now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda/hdac_regmap.c')
-rw-r--r--sound/hda/hdac_regmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c
index db03d60d9c99..933907b16457 100644
--- a/sound/hda/hdac_regmap.c
+++ b/sound/hda/hdac_regmap.c
@@ -58,8 +58,12 @@ static bool hda_volatile_reg(struct device *dev, unsigned int reg)
static bool hda_writeable_reg(struct device *dev, unsigned int reg)
{
+ struct hdac_device *codec = dev_to_hdac_dev(dev);
unsigned int verb = get_verb(reg);
+ if (codec->caps_overwriting)
+ return true;
+
switch (verb & 0xf00) {
case AC_VERB_GET_STREAM_FORMAT:
case AC_VERB_GET_AMP_GAIN_MUTE:
@@ -97,8 +101,12 @@ static bool hda_writeable_reg(struct device *dev, unsigned int reg)
static bool hda_readable_reg(struct device *dev, unsigned int reg)
{
+ struct hdac_device *codec = dev_to_hdac_dev(dev);
unsigned int verb = get_verb(reg);
+ if (codec->caps_overwriting)
+ return true;
+
switch (verb) {
case AC_VERB_PARAMETERS:
case AC_VERB_GET_CONNECT_LIST:
OpenPOWER on IntegriCloud