aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r--sound/pci/hda/hda_codec.h49
1 files changed, 46 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 5991d14e1ec0..4303353feda9 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -224,6 +224,27 @@ enum {
224/* Input converter SDI select */ 224/* Input converter SDI select */
225#define AC_SDI_SELECT (0xf<<0) 225#define AC_SDI_SELECT (0xf<<0)
226 226
227/* stream format id */
228#define AC_FMT_CHAN_SHIFT 0
229#define AC_FMT_CHAN_MASK (0x0f << 0)
230#define AC_FMT_BITS_SHIFT 4
231#define AC_FMT_BITS_MASK (7 << 4)
232#define AC_FMT_BITS_8 (0 << 4)
233#define AC_FMT_BITS_16 (1 << 4)
234#define AC_FMT_BITS_20 (2 << 4)
235#define AC_FMT_BITS_24 (3 << 4)
236#define AC_FMT_BITS_32 (4 << 4)
237#define AC_FMT_DIV_SHIFT 8
238#define AC_FMT_DIV_MASK (7 << 8)
239#define AC_FMT_MULT_SHIFT 11
240#define AC_FMT_MULT_MASK (7 << 11)
241#define AC_FMT_BASE_SHIFT 14
242#define AC_FMT_BASE_48K (0 << 14)
243#define AC_FMT_BASE_44K (1 << 14)
244#define AC_FMT_TYPE_SHIFT 15
245#define AC_FMT_TYPE_PCM (0 << 15)
246#define AC_FMT_TYPE_NON_PCM (1 << 15)
247
227/* Unsolicited response control */ 248/* Unsolicited response control */
228#define AC_UNSOL_TAG (0x3f<<0) 249#define AC_UNSOL_TAG (0x3f<<0)
229#define AC_UNSOL_ENABLED (1<<7) 250#define AC_UNSOL_ENABLED (1<<7)
@@ -364,6 +385,9 @@ enum {
364#define AC_DIG2_CC (0x7f<<0) 385#define AC_DIG2_CC (0x7f<<0)
365 386
366/* Pin widget control - 8bit */ 387/* Pin widget control - 8bit */
388#define AC_PINCTL_EPT (0x3<<0)
389#define AC_PINCTL_EPT_NATIVE 0
390#define AC_PINCTL_EPT_HBR 3
367#define AC_PINCTL_VREFEN (0x7<<0) 391#define AC_PINCTL_VREFEN (0x7<<0)
368#define AC_PINCTL_VREF_HIZ 0 /* Hi-Z */ 392#define AC_PINCTL_VREF_HIZ 0 /* Hi-Z */
369#define AC_PINCTL_VREF_50 1 /* 50% */ 393#define AC_PINCTL_VREF_50 1 /* 50% */
@@ -760,7 +784,10 @@ struct hda_codec {
760 hda_nid_t mfg; /* MFG node id */ 784 hda_nid_t mfg; /* MFG node id */
761 785
762 /* ids */ 786 /* ids */
763 u32 function_id; 787 u8 afg_function_id;
788 u8 mfg_function_id;
789 u8 afg_unsol;
790 u8 mfg_unsol;
764 u32 vendor_id; 791 u32 vendor_id;
765 u32 subsystem_id; 792 u32 subsystem_id;
766 u32 revision_id; 793 u32 revision_id;
@@ -799,12 +826,14 @@ struct hda_codec {
799 826
800 struct mutex spdif_mutex; 827 struct mutex spdif_mutex;
801 struct mutex control_mutex; 828 struct mutex control_mutex;
829 struct mutex prepare_mutex;
802 unsigned int spdif_status; /* IEC958 status bits */ 830 unsigned int spdif_status; /* IEC958 status bits */
803 unsigned short spdif_ctls; /* SPDIF control bits */ 831 unsigned short spdif_ctls; /* SPDIF control bits */
804 unsigned int spdif_in_enable; /* SPDIF input enable? */ 832 unsigned int spdif_in_enable; /* SPDIF input enable? */
805 hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */ 833 hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
806 struct snd_array init_pins; /* initial (BIOS) pin configurations */ 834 struct snd_array init_pins; /* initial (BIOS) pin configurations */
807 struct snd_array driver_pins; /* pin configs set by codec parser */ 835 struct snd_array driver_pins; /* pin configs set by codec parser */
836 struct snd_array cvt_setups; /* audio convert setups */
808 837
809#ifdef CONFIG_SND_HDA_HWDEP 838#ifdef CONFIG_SND_HDA_HWDEP
810 struct snd_hwdep *hwdep; /* assigned hwdep device */ 839 struct snd_hwdep *hwdep; /* assigned hwdep device */
@@ -921,14 +950,28 @@ int snd_hda_codec_build_controls(struct hda_codec *codec);
921 */ 950 */
922int snd_hda_build_pcms(struct hda_bus *bus); 951int snd_hda_build_pcms(struct hda_bus *bus);
923int snd_hda_codec_build_pcms(struct hda_codec *codec); 952int snd_hda_codec_build_pcms(struct hda_codec *codec);
953
954int snd_hda_codec_prepare(struct hda_codec *codec,
955 struct hda_pcm_stream *hinfo,
956 unsigned int stream,
957 unsigned int format,
958 struct snd_pcm_substream *substream);
959void snd_hda_codec_cleanup(struct hda_codec *codec,
960 struct hda_pcm_stream *hinfo,
961 struct snd_pcm_substream *substream);
962
924void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, 963void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
925 u32 stream_tag, 964 u32 stream_tag,
926 int channel_id, int format); 965 int channel_id, int format);
927void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid); 966void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
967 int do_now);
968#define snd_hda_codec_cleanup_stream(codec, nid) \
969 __snd_hda_codec_cleanup_stream(codec, nid, 0)
928unsigned int snd_hda_calc_stream_format(unsigned int rate, 970unsigned int snd_hda_calc_stream_format(unsigned int rate,
929 unsigned int channels, 971 unsigned int channels,
930 unsigned int format, 972 unsigned int format,
931 unsigned int maxbps); 973 unsigned int maxbps,
974 unsigned short spdif_ctls);
932int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, 975int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
933 unsigned int format); 976 unsigned int format);
934 977