summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 16:59:39 +0200
committerJaroslav Kysela <perex@perex.cz>2007-10-16 15:58:41 +0200
commit01751f54ff23b9d59e07f9c9ef189d4733525463 (patch)
treecdd37b09978123b87f673fbedf5102d34f68d459 /sound/pci/hda/hda_codec.h
parent45cffef1ff4679f5961146101ea1b8235bdd25b5 (diff)
[ALSA] hda-codec - rewrite amp cache more generic
Rewrite the code to handle amp cache and hash tables to be more generic. This routine will be used by the register caches in the next patch. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r--sound/pci/hda/hda_codec.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 1370e346bf34..1a69743160ce 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -480,12 +480,24 @@ struct hda_codec_ops {
};
/* record for amp information cache */
-struct hda_amp_info {
+struct hda_cache_head {
u32 key; /* hash key */
+ u16 val; /* assigned value */
+ u16 next; /* next link; -1 = terminal */
+};
+
+struct hda_amp_info {
+ struct hda_cache_head head;
u32 amp_caps; /* amp capabilities */
u16 vol[2]; /* current volume & mute */
- u16 status; /* update flag */
- u16 next; /* next link */
+};
+
+struct hda_cache_rec {
+ u16 hash[64]; /* hash table for index */
+ unsigned int num_entries; /* number of assigned entries */
+ unsigned int size; /* allocated size */
+ unsigned int record_size; /* record size (including header) */
+ void *buffer; /* hash table entries */
};
/* PCM callbacks */
@@ -557,11 +569,7 @@ struct hda_codec {
hda_nid_t start_nid;
u32 *wcaps;
- /* hash for amp access */
- u16 amp_hash[32];
- int num_amp_entries;
- int amp_info_size;
- struct hda_amp_info *amp_info;
+ struct hda_cache_rec amp_cache; /* cache for amp access */
struct mutex spdif_mutex;
unsigned int spdif_status; /* IEC958 status bits */