diff options
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r-- | sound/pci/hda/hda_local.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 44f189cb97ae..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); |
97 | int snd_hda_add_vmaster(struct hda_codec *codec, char *name, | 99 | int snd_hda_add_vmaster(struct hda_codec *codec, char *name, |
98 | unsigned int *tlv, const char **slaves); | 100 | unsigned int *tlv, const char **slaves); |
99 | void snd_hda_codec_reset(struct hda_codec *codec); | 101 | int snd_hda_codec_reset(struct hda_codec *codec); |
100 | int snd_hda_codec_configure(struct hda_codec *codec); | 102 | int 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 | ||
135 | struct hda_bind_ctls { | 137 | struct 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 | ||
140 | int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, | 142 | int 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 */ |
@@ -354,9 +357,12 @@ struct auto_pin_cfg { | |||
354 | int line_out_type; /* AUTO_PIN_XXX_OUT */ | 357 | int line_out_type; /* AUTO_PIN_XXX_OUT */ |
355 | hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; | 358 | hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; |
356 | hda_nid_t input_pins[AUTO_PIN_LAST]; | 359 | hda_nid_t input_pins[AUTO_PIN_LAST]; |
357 | hda_nid_t dig_out_pin; | 360 | int dig_outs; |
361 | hda_nid_t dig_out_pins[2]; | ||
358 | hda_nid_t dig_in_pin; | 362 | hda_nid_t dig_in_pin; |
359 | 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 */ | ||
360 | }; | 366 | }; |
361 | 367 | ||
362 | #define get_defcfg_connect(cfg) \ | 368 | #define get_defcfg_connect(cfg) \ |
@@ -405,6 +411,7 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) | |||
405 | u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); | 411 | u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); |
406 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, | 412 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, |
407 | unsigned int caps); | 413 | unsigned int caps); |
414 | u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); | ||
408 | 415 | ||
409 | int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl); | 416 | int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl); |
410 | void snd_hda_ctls_clear(struct hda_codec *codec); | 417 | void snd_hda_ctls_clear(struct hda_codec *codec); |
@@ -427,6 +434,23 @@ static inline int snd_hda_hwdep_add_sysfs(struct hda_codec *codec) | |||
427 | } | 434 | } |
428 | #endif | 435 | #endif |
429 | 436 | ||
437 | #ifdef CONFIG_SND_HDA_RECONFIG | ||
438 | const char *snd_hda_get_hint(struct hda_codec *codec, const char *key); | ||
439 | int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key); | ||
440 | #else | ||
441 | static inline | ||
442 | const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) | ||
443 | { | ||
444 | return NULL; | ||
445 | } | ||
446 | |||
447 | static inline | ||
448 | int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) | ||
449 | { | ||
450 | return -ENOENT; | ||
451 | } | ||
452 | #endif | ||
453 | |||
430 | /* | 454 | /* |
431 | * power-management | 455 | * power-management |
432 | */ | 456 | */ |
@@ -458,6 +482,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec, | |||
458 | #define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3) | 482 | #define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3) |
459 | #define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1) | 483 | #define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1) |
460 | #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) | ||
461 | 486 | ||
462 | /* | 487 | /* |
463 | * CEA Short Audio Descriptor data | 488 | * CEA Short Audio Descriptor data |