2 * BIOS auto-parser helper functions for HD-audio
4 * Copyright (c) 2012 Takashi Iwai <tiwai@suse.de>
6 * This driver is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
12 #ifndef __SOUND_HDA_AUTO_PARSER_H
13 #define __SOUND_HDA_AUTO_PARSER_H
16 * Helper for automatic pin configuration
33 #define AUTO_CFG_MAX_OUTS HDA_MAX_OUTS
34 #define AUTO_CFG_MAX_INS 8
36 struct auto_pin_cfg_item {
39 unsigned int is_headset_mic:1;
43 const char *hda_get_autocfg_input_label(struct hda_codec *codec,
44 const struct auto_pin_cfg *cfg,
46 int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid,
47 const struct auto_pin_cfg *cfg,
48 char *label, int maxlen, int *indexp);
51 INPUT_PIN_ATTR_UNUSED, /* pin not connected */
52 INPUT_PIN_ATTR_INT, /* internal mic/line-in */
53 INPUT_PIN_ATTR_DOCK, /* docking mic/line-in */
54 INPUT_PIN_ATTR_NORMAL, /* mic/line-in jack */
55 INPUT_PIN_ATTR_REAR, /* mic/line-in jack in rear */
56 INPUT_PIN_ATTR_FRONT, /* mic/line-in jack in front */
57 INPUT_PIN_ATTR_LAST = INPUT_PIN_ATTR_FRONT,
60 int snd_hda_get_input_pin_attr(unsigned int def_conf);
64 /* sorted in the order of Front/Surr/CLFE/Side */
65 hda_nid_t line_out_pins[AUTO_CFG_MAX_OUTS];
67 hda_nid_t speaker_pins[AUTO_CFG_MAX_OUTS];
69 int line_out_type; /* AUTO_PIN_XXX_OUT */
70 hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS];
72 struct auto_pin_cfg_item inputs[AUTO_CFG_MAX_INS];
74 hda_nid_t dig_out_pins[2];
76 hda_nid_t mono_out_pin;
77 int dig_out_type[2]; /* HDA_PCM_TYPE_XXX */
78 int dig_in_type; /* HDA_PCM_TYPE_XXX */
81 /* bit-flags for snd_hda_parse_pin_def_config() behavior */
82 #define HDA_PINCFG_NO_HP_FIXUP (1 << 0) /* no HP-split */
83 #define HDA_PINCFG_NO_LO_FIXUP (1 << 1) /* don't take other outs as LO */
84 #define HDA_PINCFG_HEADSET_MIC (1 << 2) /* Take first mic as headset mic */
86 int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
87 struct auto_pin_cfg *cfg,
88 const hda_nid_t *ignore_nids,
89 unsigned int cond_flags);
92 #define snd_hda_parse_pin_def_config(codec, cfg, ignore) \
93 snd_hda_parse_pin_defcfg(codec, cfg, ignore, 0)
95 #endif /* __SOUND_HDA_AUTO_PARSER_H */