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.h93
1 files changed, 89 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index efc682888b31..60468f562400 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -90,6 +90,14 @@ enum {
90#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c 90#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c
91/* f20: AFG/MFG */ 91/* f20: AFG/MFG */
92#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20 92#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20
93#define AC_VERB_GET_CVT_CHAN_COUNT 0x0f2d
94#define AC_VERB_GET_HDMI_DIP_SIZE 0x0f2e
95#define AC_VERB_GET_HDMI_ELDD 0x0f2f
96#define AC_VERB_GET_HDMI_DIP_INDEX 0x0f30
97#define AC_VERB_GET_HDMI_DIP_DATA 0x0f31
98#define AC_VERB_GET_HDMI_DIP_XMIT 0x0f32
99#define AC_VERB_GET_HDMI_CP_CTRL 0x0f33
100#define AC_VERB_GET_HDMI_CHAN_SLOT 0x0f34
93 101
94/* 102/*
95 * SET verbs 103 * SET verbs
@@ -121,7 +129,14 @@ enum {
121#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d 129#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d
122#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e 130#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e
123#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f 131#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f
132#define AC_VERB_SET_EAPD 0x788
124#define AC_VERB_SET_CODEC_RESET 0x7ff 133#define AC_VERB_SET_CODEC_RESET 0x7ff
134#define AC_VERB_SET_CVT_CHAN_COUNT 0x72d
135#define AC_VERB_SET_HDMI_DIP_INDEX 0x730
136#define AC_VERB_SET_HDMI_DIP_DATA 0x731
137#define AC_VERB_SET_HDMI_DIP_XMIT 0x732
138#define AC_VERB_SET_HDMI_CP_CTRL 0x733
139#define AC_VERB_SET_HDMI_CHAN_SLOT 0x734
125 140
126/* 141/*
127 * Parameter IDs 142 * Parameter IDs
@@ -143,6 +158,7 @@ enum {
143#define AC_PAR_GPIO_CAP 0x11 158#define AC_PAR_GPIO_CAP 0x11
144#define AC_PAR_AMP_OUT_CAP 0x12 159#define AC_PAR_AMP_OUT_CAP 0x12
145#define AC_PAR_VOL_KNB_CAP 0x13 160#define AC_PAR_VOL_KNB_CAP 0x13
161#define AC_PAR_HDMI_LPCM_CAP 0x20
146 162
147/* 163/*
148 * AC_VERB_PARAMETERS results (32bit) 164 * AC_VERB_PARAMETERS results (32bit)
@@ -171,6 +187,8 @@ enum {
171#define AC_WCAP_DIGITAL (1<<9) /* digital I/O */ 187#define AC_WCAP_DIGITAL (1<<9) /* digital I/O */
172#define AC_WCAP_POWER (1<<10) /* power control */ 188#define AC_WCAP_POWER (1<<10) /* power control */
173#define AC_WCAP_LR_SWAP (1<<11) /* L/R swap */ 189#define AC_WCAP_LR_SWAP (1<<11) /* L/R swap */
190#define AC_WCAP_CP_CAPS (1<<12) /* content protection */
191#define AC_WCAP_CHAN_CNT_EXT (7<<13) /* channel count ext */
174#define AC_WCAP_DELAY (0xf<<16) 192#define AC_WCAP_DELAY (0xf<<16)
175#define AC_WCAP_DELAY_SHIFT 16 193#define AC_WCAP_DELAY_SHIFT 16
176#define AC_WCAP_TYPE (0xf<<20) 194#define AC_WCAP_TYPE (0xf<<20)
@@ -206,9 +224,20 @@ enum {
206/* Input converter SDI select */ 224/* Input converter SDI select */
207#define AC_SDI_SELECT (0xf<<0) 225#define AC_SDI_SELECT (0xf<<0)
208 226
209/* Unsolicited response */ 227/* Unsolicited response control */
210#define AC_UNSOL_TAG (0x3f<<0) 228#define AC_UNSOL_TAG (0x3f<<0)
211#define AC_UNSOL_ENABLED (1<<7) 229#define AC_UNSOL_ENABLED (1<<7)
230#define AC_USRSP_EN AC_UNSOL_ENABLED
231
232/* Unsolicited responses */
233#define AC_UNSOL_RES_TAG (0x3f<<26)
234#define AC_UNSOL_RES_TAG_SHIFT 26
235#define AC_UNSOL_RES_SUBTAG (0x1f<<21)
236#define AC_UNSOL_RES_SUBTAG_SHIFT 21
237#define AC_UNSOL_RES_ELDV (1<<1) /* ELD Data valid (for HDMI) */
238#define AC_UNSOL_RES_PD (1<<0) /* pinsense detect */
239#define AC_UNSOL_RES_CP_STATE (1<<1) /* content protection */
240#define AC_UNSOL_RES_CP_READY (1<<0) /* content protection */
212 241
213/* Pin widget capabilies */ 242/* Pin widget capabilies */
214#define AC_PINCAP_IMP_SENSE (1<<0) /* impedance sense capable */ 243#define AC_PINCAP_IMP_SENSE (1<<0) /* impedance sense capable */
@@ -222,6 +251,10 @@ enum {
222 * but is marked reserved in the Intel HDA specification. 251 * but is marked reserved in the Intel HDA specification.
223 */ 252 */
224#define AC_PINCAP_LR_SWAP (1<<7) /* L/R swap */ 253#define AC_PINCAP_LR_SWAP (1<<7) /* L/R swap */
254/* Note: The same bit as LR_SWAP is newly defined as HDMI capability
255 * in HD-audio specification
256 */
257#define AC_PINCAP_HDMI (1<<7) /* HDMI pin */
225#define AC_PINCAP_VREF (0x37<<8) 258#define AC_PINCAP_VREF (0x37<<8)
226#define AC_PINCAP_VREF_SHIFT 8 259#define AC_PINCAP_VREF_SHIFT 8
227#define AC_PINCAP_EAPD (1<<16) /* EAPD capable */ 260#define AC_PINCAP_EAPD (1<<16) /* EAPD capable */
@@ -272,6 +305,22 @@ enum {
272#define AC_KNBCAP_NUM_STEPS (0x7f<<0) 305#define AC_KNBCAP_NUM_STEPS (0x7f<<0)
273#define AC_KNBCAP_DELTA (1<<7) 306#define AC_KNBCAP_DELTA (1<<7)
274 307
308/* HDMI LPCM capabilities */
309#define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */
310#define AC_LPCMCAP_48K_NO_CHNS (0x0f<<4) /* max channels w/o CP-on */
311#define AC_LPCMCAP_48K_20BIT (1<<8) /* 20b bitrate supported */
312#define AC_LPCMCAP_48K_24BIT (1<<9) /* 24b bitrate supported */
313#define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */
314#define AC_LPCMCAP_96K_NO_CHNS (0x0f<<14) /* max channels w/o CP-on */
315#define AC_LPCMCAP_96K_20BIT (1<<18) /* 20b bitrate supported */
316#define AC_LPCMCAP_96K_24BIT (1<<19) /* 24b bitrate supported */
317#define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */
318#define AC_LPCMCAP_192K_NO_CHNS (0x0f<<24) /* max channels w/o CP-on */
319#define AC_LPCMCAP_192K_20BIT (1<<28) /* 20b bitrate supported */
320#define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */
321#define AC_LPCMCAP_44K (1<<30) /* 44.1kHz support */
322#define AC_LPCMCAP_44K_MS (1<<31) /* 44.1kHz-multiplies support */
323
275/* 324/*
276 * Control Parameters 325 * Control Parameters
277 */ 326 */
@@ -317,18 +366,44 @@ enum {
317#define AC_PINCTL_OUT_EN (1<<6) 366#define AC_PINCTL_OUT_EN (1<<6)
318#define AC_PINCTL_HP_EN (1<<7) 367#define AC_PINCTL_HP_EN (1<<7)
319 368
320/* Unsolicited response - 8bit */
321#define AC_USRSP_EN (1<<7)
322
323/* Pin sense - 32bit */ 369/* Pin sense - 32bit */
324#define AC_PINSENSE_IMPEDANCE_MASK (0x7fffffff) 370#define AC_PINSENSE_IMPEDANCE_MASK (0x7fffffff)
325#define AC_PINSENSE_PRESENCE (1<<31) 371#define AC_PINSENSE_PRESENCE (1<<31)
372#define AC_PINSENSE_ELDV (1<<30) /* ELD valid (HDMI) */
326 373
327/* EAPD/BTL enable - 32bit */ 374/* EAPD/BTL enable - 32bit */
328#define AC_EAPDBTL_BALANCED (1<<0) 375#define AC_EAPDBTL_BALANCED (1<<0)
329#define AC_EAPDBTL_EAPD (1<<1) 376#define AC_EAPDBTL_EAPD (1<<1)
330#define AC_EAPDBTL_LR_SWAP (1<<2) 377#define AC_EAPDBTL_LR_SWAP (1<<2)
331 378
379/* HDMI ELD data */
380#define AC_ELDD_ELD_VALID (1<<31)
381#define AC_ELDD_ELD_DATA 0xff
382
383/* HDMI DIP size */
384#define AC_DIPSIZE_ELD_BUF (1<<3) /* ELD buf size of packet size */
385#define AC_DIPSIZE_PACK_IDX (0x07<<0) /* packet index */
386
387/* HDMI DIP index */
388#define AC_DIPIDX_PACK_IDX (0x07<<5) /* packet idnex */
389#define AC_DIPIDX_BYTE_IDX (0x1f<<0) /* byte index */
390
391/* HDMI DIP xmit (transmit) control */
392#define AC_DIPXMIT_MASK (0x3<<6)
393#define AC_DIPXMIT_DISABLE (0x0<<6) /* disable xmit */
394#define AC_DIPXMIT_ONCE (0x2<<6) /* xmit once then disable */
395#define AC_DIPXMIT_BEST (0x3<<6) /* best effort */
396
397/* HDMI content protection (CP) control */
398#define AC_CPCTRL_CES (1<<9) /* current encryption state */
399#define AC_CPCTRL_READY (1<<8) /* ready bit */
400#define AC_CPCTRL_SUBTAG (0x1f<<3) /* subtag for unsol-resp */
401#define AC_CPCTRL_STATE (3<<0) /* current CP request state */
402
403/* Converter channel <-> HDMI slot mapping */
404#define AC_CVTMAP_HDMI_SLOT (0xf<<0) /* HDMI slot number */
405#define AC_CVTMAP_CHAN (0xf<<4) /* converter channel number */
406
332/* configuration default - 32bit */ 407/* configuration default - 32bit */
333#define AC_DEFCFG_SEQUENCE (0xf<<0) 408#define AC_DEFCFG_SEQUENCE (0xf<<0)
334#define AC_DEFCFG_DEF_ASSOC (0xf<<4) 409#define AC_DEFCFG_DEF_ASSOC (0xf<<4)
@@ -449,6 +524,7 @@ enum {
449 */ 524 */
450 525
451struct hda_bus; 526struct hda_bus;
527struct hda_beep;
452struct hda_codec; 528struct hda_codec;
453struct hda_pcm; 529struct hda_pcm;
454struct hda_pcm_stream; 530struct hda_pcm_stream;
@@ -634,6 +710,9 @@ struct hda_codec {
634 /* codec specific info */ 710 /* codec specific info */
635 void *spec; 711 void *spec;
636 712
713 /* beep device */
714 struct hda_beep *beep;
715
637 /* widget capabilities cache */ 716 /* widget capabilities cache */
638 unsigned int num_nodes; 717 unsigned int num_nodes;
639 hda_nid_t start_nid; 718 hda_nid_t start_nid;
@@ -646,9 +725,15 @@ struct hda_codec {
646 unsigned int spdif_status; /* IEC958 status bits */ 725 unsigned int spdif_status; /* IEC958 status bits */
647 unsigned short spdif_ctls; /* SPDIF control bits */ 726 unsigned short spdif_ctls; /* SPDIF control bits */
648 unsigned int spdif_in_enable; /* SPDIF input enable? */ 727 unsigned int spdif_in_enable; /* SPDIF input enable? */
728 hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
649 729
650 struct snd_hwdep *hwdep; /* assigned hwdep device */ 730 struct snd_hwdep *hwdep; /* assigned hwdep device */
651 731
732 /* misc flags */
733 unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each
734 * status change
735 * (e.g. Realtek codecs)
736 */
652#ifdef CONFIG_SND_HDA_POWER_SAVE 737#ifdef CONFIG_SND_HDA_POWER_SAVE
653 unsigned int power_on :1; /* current (global) power-state */ 738 unsigned int power_on :1; /* current (global) power-state */
654 unsigned int power_transition :1; /* power-state in transition */ 739 unsigned int power_transition :1; /* power-state in transition */