aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h38
1 files changed, 34 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 6f2fe0f9fdd8..83349013b4df 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -26,8 +26,10 @@
26/* 26/*
27 * for mixer controls 27 * for mixer controls
28 */ 28 */
29#define HDA_COMPOSE_AMP_VAL_OFS(nid,chs,idx,dir,ofs) \
30 ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19) | ((ofs)<<23))
29#define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \ 31#define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \
30 ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19)) 32 HDA_COMPOSE_AMP_VAL_OFS(nid, chs, idx, dir, 0)
31/* mono volume with index (index=0,1,...) (channel=1,2) */ 33/* mono volume with index (index=0,1,...) (channel=1,2) */
32#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 34#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
33 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 35 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
@@ -96,7 +98,7 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
96 const char *name); 98 const char *name);
97int snd_hda_add_vmaster(struct hda_codec *codec, char *name, 99int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
98 unsigned int *tlv, const char **slaves); 100 unsigned int *tlv, const char **slaves);
99void snd_hda_codec_reset(struct hda_codec *codec); 101int snd_hda_codec_reset(struct hda_codec *codec);
100int snd_hda_codec_configure(struct hda_codec *codec); 102int snd_hda_codec_configure(struct hda_codec *codec);
101 103
102/* amp value bits */ 104/* amp value bits */
@@ -134,7 +136,7 @@ extern struct hda_ctl_ops snd_hda_bind_sw; /* for bind-switch */
134 136
135struct hda_bind_ctls { 137struct hda_bind_ctls {
136 struct hda_ctl_ops *ops; 138 struct hda_ctl_ops *ops;
137 long values[]; 139 unsigned long values[];
138}; 140};
139 141
140int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, 142int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol,
@@ -227,6 +229,7 @@ struct hda_multi_out {
227 hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ 229 hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */
228 hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ 230 hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */
229 hda_nid_t dig_out_nid; /* digital out audio widget */ 231 hda_nid_t dig_out_nid; /* digital out audio widget */
232 hda_nid_t *slave_dig_outs;
230 int max_channels; /* currently supported analog channels */ 233 int max_channels; /* currently supported analog channels */
231 int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ 234 int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */
232 int no_share_stream; /* don't share a stream with multiple pins */ 235 int no_share_stream; /* don't share a stream with multiple pins */
@@ -251,6 +254,8 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
251 unsigned int stream_tag, 254 unsigned int stream_tag,
252 unsigned int format, 255 unsigned int format,
253 struct snd_pcm_substream *substream); 256 struct snd_pcm_substream *substream);
257int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
258 struct hda_multi_out *mout);
254int snd_hda_multi_out_analog_open(struct hda_codec *codec, 259int snd_hda_multi_out_analog_open(struct hda_codec *codec,
255 struct hda_multi_out *mout, 260 struct hda_multi_out *mout,
256 struct snd_pcm_substream *substream, 261 struct snd_pcm_substream *substream,
@@ -296,6 +301,9 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen);
296int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, 301int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
297 const char **modelnames, 302 const char **modelnames,
298 const struct snd_pci_quirk *pci_list); 303 const struct snd_pci_quirk *pci_list);
304int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
305 int num_configs, const char **models,
306 const struct snd_pci_quirk *tbl);
299int snd_hda_add_new_ctls(struct hda_codec *codec, 307int snd_hda_add_new_ctls(struct hda_codec *codec,
300 struct snd_kcontrol_new *knew); 308 struct snd_kcontrol_new *knew);
301 309
@@ -349,9 +357,12 @@ struct auto_pin_cfg {
349 int line_out_type; /* AUTO_PIN_XXX_OUT */ 357 int line_out_type; /* AUTO_PIN_XXX_OUT */
350 hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; 358 hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS];
351 hda_nid_t input_pins[AUTO_PIN_LAST]; 359 hda_nid_t input_pins[AUTO_PIN_LAST];
352 hda_nid_t dig_out_pin; 360 int dig_outs;
361 hda_nid_t dig_out_pins[2];
353 hda_nid_t dig_in_pin; 362 hda_nid_t dig_in_pin;
354 hda_nid_t mono_out_pin; 363 hda_nid_t mono_out_pin;
364 int dig_out_type[2]; /* HDA_PCM_TYPE_XXX */
365 int dig_in_type; /* HDA_PCM_TYPE_XXX */
355}; 366};
356 367
357#define get_defcfg_connect(cfg) \ 368#define get_defcfg_connect(cfg) \
@@ -400,6 +411,7 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid)
400u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); 411u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction);
401int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, 412int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
402 unsigned int caps); 413 unsigned int caps);
414u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid);
403 415
404int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl); 416int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl);
405void snd_hda_ctls_clear(struct hda_codec *codec); 417void snd_hda_ctls_clear(struct hda_codec *codec);
@@ -422,6 +434,23 @@ static inline int snd_hda_hwdep_add_sysfs(struct hda_codec *codec)
422} 434}
423#endif 435#endif
424 436
437#ifdef CONFIG_SND_HDA_RECONFIG
438const char *snd_hda_get_hint(struct hda_codec *codec, const char *key);
439int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key);
440#else
441static inline
442const char *snd_hda_get_hint(struct hda_codec *codec, const char *key)
443{
444 return NULL;
445}
446
447static inline
448int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key)
449{
450 return -ENOENT;
451}
452#endif
453
425/* 454/*
426 * power-management 455 * power-management
427 */ 456 */
@@ -453,6 +482,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec,
453#define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3) 482#define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3)
454#define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1) 483#define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1)
455#define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf) 484#define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf)
485#define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f)
456 486
457/* 487/*
458 * CEA Short Audio Descriptor data 488 * CEA Short Audio Descriptor data