diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-02-25 15:18:50 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-03-23 13:19:39 +0100 |
commit | eeecd9d10d3da0b9efd6f58fad55c4355dcc246a (patch) | |
tree | 8a664234ab300d8275d9d1acc604f52b5c7d0270 /sound/pci/hda/hda_local.h | |
parent | ALSA: hda - Implement uncached version of parameter reads (diff) | |
download | linux-eeecd9d10d3da0b9efd6f58fad55c4355dcc246a.tar.xz linux-eeecd9d10d3da0b9efd6f58fad55c4355dcc246a.zip |
ALSA: hda - Use regmap for amp accesses
This patch converts the amp access functions to the regmap helpers.
The amp values were formerly cached in the own hash table. Now it's
dropped by the regmap's cache.
The only tricky conversion is snd_hda_codec_amp_init(). This function
shouldn't do anything if the amp was already initialized. For
achieving this behavior, a value is read once at first temporarily in
the cache-only mode. Only if it returns an error, i.e. the item
still doesn't exist in the cache, it proceeds to the update.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r-- | sound/pci/hda/hda_local.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 8a83775e0e27..7023eeee8b9d 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -127,18 +127,16 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); #endif /* lowlevel accessor with caching; use carefully */ -int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, - int direction, int index); -int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, - int direction, int idx, int mask, int val); +#define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ + snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx) +#define snd_hda_codec_amp_update(codec, nid, ch, dir, idx, mask, val) \ + snd_hdac_regmap_update_amp(&(codec)->core, nid, ch, dir, idx, mask, val) int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, int dir, int idx, int mask, int val); int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch, int direction, int idx, int mask, int val); int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid, int dir, int idx, int mask, int val); -void snd_hda_codec_resume_amp(struct hda_codec *codec); - void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, unsigned int *tlv); struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, |