diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-02-26 02:54:56 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-03-23 08:19:40 -0400 |
commit | faa75f8a2edf005a5caf43be4875ffeeb9bcb498 (patch) | |
tree | 5158cb6255a448080b16c376b1006e8e29f946aa /sound/pci/hda/hda_local.h | |
parent | eeecd9d10d3da0b9efd6f58fad55c4355dcc246a (diff) |
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/pci/hda/hda_local.h')
-rw-r--r-- | sound/pci/hda/hda_local.h | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 7023eeee8b9d..3b567f42296b 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -557,9 +557,41 @@ static inline void snd_hda_override_wcaps(struct hda_codec *codec, | |||
557 | u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); | 557 | u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); |
558 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, | 558 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, |
559 | unsigned int caps); | 559 | unsigned int caps); |
560 | u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); | 560 | /** |
561 | int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, | 561 | * snd_hda_query_pin_caps - Query PIN capabilities |
562 | unsigned int caps); | 562 | * @codec: the HD-auio codec |
563 | * @nid: the NID to query | ||
564 | * | ||
565 | * Query PIN capabilities for the given widget. | ||
566 | * Returns the obtained capability bits. | ||
567 | * | ||
568 | * When cap bits have been already read, this doesn't read again but | ||
569 | * returns the cached value. | ||
570 | */ | ||
571 | static inline u32 | ||
572 | snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid) | ||
573 | { | ||
574 | return snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); | ||
575 | |||
576 | } | ||
577 | |||
578 | /** | ||
579 | * snd_hda_override_pin_caps - Override the pin capabilities | ||
580 | * @codec: the CODEC | ||
581 | * @nid: the NID to override | ||
582 | * @caps: the capability bits to set | ||
583 | * | ||
584 | * Override the cached PIN capabilitiy bits value by the given one. | ||
585 | * | ||
586 | * Returns zero if successful or a negative error code. | ||
587 | */ | ||
588 | static inline int | ||
589 | snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, | ||
590 | unsigned int caps) | ||
591 | { | ||
592 | return snd_hdac_override_parm(&codec->core, nid, AC_PAR_PIN_CAP, caps); | ||
593 | } | ||
594 | |||
563 | bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, | 595 | bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, |
564 | int dir, unsigned int bits); | 596 | int dir, unsigned int bits); |
565 | 597 | ||