Skip to content

Commit

Permalink
[ALSA] hda-codec - Add the support of ALC262,ALC883,ALC885,ALC861
Browse files Browse the repository at this point in the history
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: Kailang Yang <kailang@realtek.com.tw>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Kailang Yang authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 59acf76 commit df694da
Show file tree
Hide file tree
Showing 6 changed files with 2,215 additions and 213 deletions.
16 changes: 15 additions & 1 deletion sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,18 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_o
/*
* 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 */
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;
int i, j, nodes;
Expand All @@ -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 */
if (wid_type != AC_WID_PIN)
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);
if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE)
continue;
Expand Down
5 changes: 3 additions & 2 deletions sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ enum {

struct auto_pin_cfg {
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 hp_pin;
hda_nid_t input_pins[AUTO_PIN_LAST];
Expand All @@ -227,7 +227,8 @@ struct auto_pin_cfg {
#define get_defcfg_sequence(cfg) (cfg & AC_DEFCFG_SEQUENCE)
#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 */
#define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8))
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec)
struct ad198x_spec *spec = codec->spec;
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;
if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0)
return err;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_cmedia.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ static int patch_cmi9880(struct hda_codec *codec)
spec->dig_in_nid = CMI_DIG_IN_NID;
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) {
spec->multiout.max_channels = cfg.line_outs * 2;
cmi9880_fill_multi_dac_nids(codec, &cfg);
Expand Down
Loading

0 comments on commit df694da

Please sign in to comment.