diff options
author | David Henningsson <david.henningsson@canonical.com> | 2013-04-11 05:30:29 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-04-11 05:59:27 -0400 |
commit | 3cdbe11ae8d2eead564605b0d2193ac470d6b7e8 (patch) | |
tree | 88b3c79dedaa4ad3770496dbb44b40f117026fdb /sound/pci | |
parent | cb420b1186e0090f24137855e14e6f3bf7cb769d (diff) |
ALSA: hda - add some small convenience functions to auto parser
I never liked that we move our speaker and hp pins to line out
if there are not any line outs; but now that we do,
add some convenience functions to find hp and speaker pins even
if they have been moved.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_auto_parser.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h index fe2ba7fafe4d..e941f604f5e5 100644 --- a/sound/pci/hda/hda_auto_parser.h +++ b/sound/pci/hda/hda_auto_parser.h | |||
@@ -94,4 +94,25 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, | |||
94 | #define snd_hda_parse_pin_def_config(codec, cfg, ignore) \ | 94 | #define snd_hda_parse_pin_def_config(codec, cfg, ignore) \ |
95 | snd_hda_parse_pin_defcfg(codec, cfg, ignore, 0) | 95 | snd_hda_parse_pin_defcfg(codec, cfg, ignore, 0) |
96 | 96 | ||
97 | static inline int auto_cfg_hp_outs(const struct auto_pin_cfg *cfg) | ||
98 | { | ||
99 | return (cfg->line_out_type == AUTO_PIN_HP_OUT) ? | ||
100 | cfg->line_outs : cfg->hp_outs; | ||
101 | } | ||
102 | static inline const hda_nid_t *auto_cfg_hp_pins(const struct auto_pin_cfg *cfg) | ||
103 | { | ||
104 | return (cfg->line_out_type == AUTO_PIN_HP_OUT) ? | ||
105 | cfg->line_out_pins : cfg->hp_pins; | ||
106 | } | ||
107 | static inline int auto_cfg_speaker_outs(const struct auto_pin_cfg *cfg) | ||
108 | { | ||
109 | return (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) ? | ||
110 | cfg->line_outs : cfg->speaker_outs; | ||
111 | } | ||
112 | static inline const hda_nid_t *auto_cfg_speaker_pins(const struct auto_pin_cfg *cfg) | ||
113 | { | ||
114 | return (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) ? | ||
115 | cfg->line_out_pins : cfg->speaker_pins; | ||
116 | } | ||
117 | |||
97 | #endif /* __SOUND_HDA_AUTO_PARSER_H */ | 118 | #endif /* __SOUND_HDA_AUTO_PARSER_H */ |