From faa75f8a2edf005a5caf43be4875ffeeb9bcb498 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 26 Feb 2015 08:54:56 +0100 Subject: 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 --- include/sound/hdaudio.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sound') diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h index 65ea6429f3a7..ce7d8d1f59c6 100644 --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h @@ -76,6 +76,7 @@ struct hdac_device { /* regmap */ struct regmap *regmap; bool lazy_cache:1; /* don't wake up for writes */ + bool caps_overwriting:1; /* caps overwrite being in process */ }; /* device/driver type used for matching */ @@ -109,6 +110,8 @@ int _snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, int parm, unsigned int *res); int snd_hdac_read_parm_uncached(struct hdac_device *codec, hda_nid_t nid, int parm); +int snd_hdac_override_parm(struct hdac_device *codec, hda_nid_t nid, + unsigned int parm, unsigned int val); int snd_hdac_get_connections(struct hdac_device *codec, hda_nid_t nid, hda_nid_t *conn_list, int max_conns); int snd_hdac_get_sub_nodes(struct hdac_device *codec, hda_nid_t nid, -- cgit v1.2.3