diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r-- | sound/pci/hda/hda_codec.h | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 60468f562400..c5f91c918d19 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -520,6 +520,26 @@ enum { | |||
520 | #define HDA_MAX_CODEC_ADDRESS 0x0f | 520 | #define HDA_MAX_CODEC_ADDRESS 0x0f |
521 | 521 | ||
522 | /* | 522 | /* |
523 | * generic arrays | ||
524 | */ | ||
525 | struct snd_array { | ||
526 | unsigned int used; | ||
527 | unsigned int alloced; | ||
528 | unsigned int elem_size; | ||
529 | unsigned int alloc_align; | ||
530 | void *list; | ||
531 | }; | ||
532 | |||
533 | void *snd_array_new(struct snd_array *array); | ||
534 | void snd_array_free(struct snd_array *array); | ||
535 | static inline void snd_array_init(struct snd_array *array, unsigned int size, | ||
536 | unsigned int align) | ||
537 | { | ||
538 | array->elem_size = size; | ||
539 | array->alloc_align = align; | ||
540 | } | ||
541 | |||
542 | /* | ||
523 | * Structures | 543 | * Structures |
524 | */ | 544 | */ |
525 | 545 | ||
@@ -542,6 +562,8 @@ struct hda_bus_ops { | |||
542 | unsigned int (*get_response)(struct hda_codec *codec); | 562 | unsigned int (*get_response)(struct hda_codec *codec); |
543 | /* free the private data */ | 563 | /* free the private data */ |
544 | void (*private_free)(struct hda_bus *); | 564 | void (*private_free)(struct hda_bus *); |
565 | /* attach a PCM stream */ | ||
566 | int (*attach_pcm)(struct hda_codec *codec, struct hda_pcm *pcm); | ||
545 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 567 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
546 | /* notify power-up/down from codec to controller */ | 568 | /* notify power-up/down from codec to controller */ |
547 | void (*pm_notify)(struct hda_codec *codec); | 569 | void (*pm_notify)(struct hda_codec *codec); |
@@ -635,10 +657,7 @@ struct hda_amp_info { | |||
635 | 657 | ||
636 | struct hda_cache_rec { | 658 | struct hda_cache_rec { |
637 | u16 hash[64]; /* hash table for index */ | 659 | u16 hash[64]; /* hash table for index */ |
638 | unsigned int num_entries; /* number of assigned entries */ | 660 | struct snd_array buf; /* record entries */ |
639 | unsigned int size; /* allocated size */ | ||
640 | unsigned int record_size; /* record size (including header) */ | ||
641 | void *buffer; /* hash table entries */ | ||
642 | }; | 661 | }; |
643 | 662 | ||
644 | /* PCM callbacks */ | 663 | /* PCM callbacks */ |
@@ -680,7 +699,8 @@ struct hda_pcm { | |||
680 | char *name; | 699 | char *name; |
681 | struct hda_pcm_stream stream[2]; | 700 | struct hda_pcm_stream stream[2]; |
682 | unsigned int pcm_type; /* HDA_PCM_TYPE_XXX */ | 701 | unsigned int pcm_type; /* HDA_PCM_TYPE_XXX */ |
683 | int device; /* assigned device number */ | 702 | int device; /* device number to assign */ |
703 | struct snd_pcm *pcm; /* assigned PCM instance */ | ||
684 | }; | 704 | }; |
685 | 705 | ||
686 | /* codec information */ | 706 | /* codec information */ |
@@ -699,6 +719,8 @@ struct hda_codec { | |||
699 | 719 | ||
700 | /* detected preset */ | 720 | /* detected preset */ |
701 | const struct hda_codec_preset *preset; | 721 | const struct hda_codec_preset *preset; |
722 | const char *name; /* codec name */ | ||
723 | const char *modelname; /* model name for preset */ | ||
702 | 724 | ||
703 | /* set by patch */ | 725 | /* set by patch */ |
704 | struct hda_codec_ops patch_ops; | 726 | struct hda_codec_ops patch_ops; |
@@ -718,6 +740,8 @@ struct hda_codec { | |||
718 | hda_nid_t start_nid; | 740 | hda_nid_t start_nid; |
719 | u32 *wcaps; | 741 | u32 *wcaps; |
720 | 742 | ||
743 | struct snd_array mixers; /* list of assigned mixer elements */ | ||
744 | |||
721 | struct hda_cache_rec amp_cache; /* cache for amp access */ | 745 | struct hda_cache_rec amp_cache; /* cache for amp access */ |
722 | struct hda_cache_rec cmd_cache; /* cache for other commands */ | 746 | struct hda_cache_rec cmd_cache; /* cache for other commands */ |
723 | 747 | ||
@@ -727,7 +751,11 @@ struct hda_codec { | |||
727 | unsigned int spdif_in_enable; /* SPDIF input enable? */ | 751 | unsigned int spdif_in_enable; /* SPDIF input enable? */ |
728 | hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */ | 752 | hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */ |
729 | 753 | ||
754 | #ifdef CONFIG_SND_HDA_HWDEP | ||
730 | struct snd_hwdep *hwdep; /* assigned hwdep device */ | 755 | struct snd_hwdep *hwdep; /* assigned hwdep device */ |
756 | struct snd_array init_verbs; /* additional init verbs */ | ||
757 | struct snd_array hints; /* additional hints */ | ||
758 | #endif | ||
731 | 759 | ||
732 | /* misc flags */ | 760 | /* misc flags */ |
733 | unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each | 761 | unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each |
@@ -799,6 +827,7 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec); | |||
799 | * Mixer | 827 | * Mixer |
800 | */ | 828 | */ |
801 | int snd_hda_build_controls(struct hda_bus *bus); | 829 | int snd_hda_build_controls(struct hda_bus *bus); |
830 | int snd_hda_codec_build_controls(struct hda_codec *codec); | ||
802 | 831 | ||
803 | /* | 832 | /* |
804 | * PCM | 833 | * PCM |
@@ -831,6 +860,13 @@ int snd_hda_resume(struct hda_bus *bus); | |||
831 | #endif | 860 | #endif |
832 | 861 | ||
833 | /* | 862 | /* |
863 | * get widget information | ||
864 | */ | ||
865 | const char *snd_hda_get_jack_connectivity(u32 cfg); | ||
866 | const char *snd_hda_get_jack_type(u32 cfg); | ||
867 | const char *snd_hda_get_jack_location(u32 cfg); | ||
868 | |||
869 | /* | ||
834 | * power saving | 870 | * power saving |
835 | */ | 871 | */ |
836 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 872 | #ifdef CONFIG_SND_HDA_POWER_SAVE |