aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 10:59:39 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:41 -0400
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 {
480}; 480};
481 481
482/* record for amp information cache */ 482/* record for amp information cache */
483struct hda_amp_info { 483struct hda_cache_head {
484 u32 key; /* hash key */ 484 u32 key; /* hash key */
485 u16 val; /* assigned value */
486 u16 next; /* next link; -1 = terminal */
487};
488
489struct hda_amp_info {
490 struct hda_cache_head head;
485 u32 amp_caps; /* amp capabilities */ 491 u32 amp_caps; /* amp capabilities */
486 u16 vol[2]; /* current volume & mute */ 492 u16 vol[2]; /* current volume & mute */
487 u16 status; /* update flag */ 493};
488 u16 next; /* next link */ 494
495struct hda_cache_rec {
496 u16 hash[64]; /* hash table for index */
497 unsigned int num_entries; /* number of assigned entries */
498 unsigned int size; /* allocated size */
499 unsigned int record_size; /* record size (including header) */
500 void *buffer; /* hash table entries */
489}; 501};
490 502
491/* PCM callbacks */ 503/* PCM callbacks */
@@ -557,11 +569,7 @@ struct hda_codec {
557 hda_nid_t start_nid; 569 hda_nid_t start_nid;
558 u32 *wcaps; 570 u32 *wcaps;
559 571
560 /* hash for amp access */ 572 struct hda_cache_rec amp_cache; /* cache for amp access */
561 u16 amp_hash[32];
562 int num_amp_entries;
563 int amp_info_size;
564 struct hda_amp_info *amp_info;
565 573
566 struct mutex spdif_mutex; 574 struct mutex spdif_mutex;
567 unsigned int spdif_status; /* IEC958 status bits */ 575 unsigned int spdif_status; /* IEC958 status bits */