Commit df694daa authored by Kailang Yang's avatar Kailang Yang Committed by Jaroslav Kysela

[ALSA] hda-codec - Add the support of ALC262,ALC883,ALC885,ALC861

Modules: HDA Codec driver,HDA generic driver

This patch adds the support of ALC262,ALC883,ALC885,ALC861 to driver
More models and improvements for ALC880, ALC260 and ALC882 codecs, too.
Signed-off-by: default avatarKailang Yang <kailang@realtek.com.tw>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 59acf76e
...@@ -1926,8 +1926,18 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_o ...@@ -1926,8 +1926,18 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_o
/* /*
* Helper for automatic ping configuration * Helper for automatic ping configuration
*/ */
static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list)
{
for (; *list; list++)
if (*list == nid)
return 1;
return 0;
}
/* parse all pin widgets and store the useful pin nids to cfg */ /* parse all pin widgets and store the useful pin nids to cfg */
int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg) int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg,
hda_nid_t *ignore_nids)
{ {
hda_nid_t nid, nid_start; hda_nid_t nid, nid_start;
int i, j, nodes; int i, j, nodes;
...@@ -1948,6 +1958,10 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c ...@@ -1948,6 +1958,10 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c
/* read all default configuration for pin complex */ /* read all default configuration for pin complex */
if (wid_type != AC_WID_PIN) if (wid_type != AC_WID_PIN)
continue; continue;
/* ignore the given nids (e.g. pc-beep returns error) */
if (ignore_nids && is_in_nid_list(nid, ignore_nids))
continue;
def_conf = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); def_conf = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0);
if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE)
continue; continue;
......
...@@ -213,7 +213,7 @@ enum { ...@@ -213,7 +213,7 @@ enum {
struct auto_pin_cfg { struct auto_pin_cfg {
int line_outs; int line_outs;
hda_nid_t line_out_pins[4]; /* sorted in the order of Front/Surr/CLFE/Side */ hda_nid_t line_out_pins[5]; /* sorted in the order of Front/Surr/CLFE/Side */
hda_nid_t speaker_pin; hda_nid_t speaker_pin;
hda_nid_t hp_pin; hda_nid_t hp_pin;
hda_nid_t input_pins[AUTO_PIN_LAST]; hda_nid_t input_pins[AUTO_PIN_LAST];
...@@ -227,7 +227,8 @@ struct auto_pin_cfg { ...@@ -227,7 +227,8 @@ struct auto_pin_cfg {
#define get_defcfg_sequence(cfg) (cfg & AC_DEFCFG_SEQUENCE) #define get_defcfg_sequence(cfg) (cfg & AC_DEFCFG_SEQUENCE)
#define get_defcfg_device(cfg) ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT) #define get_defcfg_device(cfg) ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT)
int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg); int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg,
hda_nid_t *ignore_nids);
/* amp values */ /* amp values */
#define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8)) #define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8))
......
...@@ -1968,7 +1968,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec) ...@@ -1968,7 +1968,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec)
struct ad198x_spec *spec = codec->spec; struct ad198x_spec *spec = codec->spec;
int err; int err;
if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg)) < 0) if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL)) < 0)
return err; return err;
if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0) if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0)
return err; return err;
......
...@@ -711,7 +711,7 @@ static int patch_cmi9880(struct hda_codec *codec) ...@@ -711,7 +711,7 @@ static int patch_cmi9880(struct hda_codec *codec)
spec->dig_in_nid = CMI_DIG_IN_NID; spec->dig_in_nid = CMI_DIG_IN_NID;
spec->multiout.max_channels = 8; spec->multiout.max_channels = 8;
} }
snd_hda_parse_pin_def_config(codec, &cfg); snd_hda_parse_pin_def_config(codec, &cfg, NULL);
if (cfg.line_outs) { if (cfg.line_outs) {
spec->multiout.max_channels = cfg.line_outs * 2; spec->multiout.max_channels = cfg.line_outs * 2;
cmi9880_fill_multi_dac_nids(codec, &cfg); cmi9880_fill_multi_dac_nids(codec, &cfg);
......
This diff is collapsed.
...@@ -761,7 +761,7 @@ static int stac922x_parse_auto_config(struct hda_codec *codec) ...@@ -761,7 +761,7 @@ static int stac922x_parse_auto_config(struct hda_codec *codec)
struct sigmatel_spec *spec = codec->spec; struct sigmatel_spec *spec = codec->spec;
int err; int err;
if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg)) < 0) if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL)) < 0)
return err; return err;
if ((err = stac92xx_add_dyn_out_pins(codec, &spec->autocfg)) < 0) if ((err = stac92xx_add_dyn_out_pins(codec, &spec->autocfg)) < 0)
return err; return err;
...@@ -801,7 +801,7 @@ static int stac9200_parse_auto_config(struct hda_codec *codec) ...@@ -801,7 +801,7 @@ static int stac9200_parse_auto_config(struct hda_codec *codec)
struct sigmatel_spec *spec = codec->spec; struct sigmatel_spec *spec = codec->spec;
int err; int err;
if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg)) < 0) if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL)) < 0)
return err; return err;
if ((err = stac92xx_auto_create_analog_input_ctls(codec, &spec->autocfg)) < 0) if ((err = stac92xx_auto_create_analog_input_ctls(codec, &spec->autocfg)) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment