ALSA: hda - Disable static quirks for C-Media codecs

According to alsa-info.sh outputs, all three entries with static
quirks have the correct pin configs, so it's safe to remove static
quirks.  For now, turn the static quirks off via ifdef.  The dead
codes will be removed in later release.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2014-02-10 18:18:17 +01:00
parent 8a02c0cc4a
commit 998caa4dcc

View File

@ -32,6 +32,9 @@
#include "hda_jack.h" #include "hda_jack.h"
#include "hda_generic.h" #include "hda_generic.h"
#undef ENABLE_CMI_STATIC_QUIRKS
#ifdef ENABLE_CMI_STATIC_QUIRKS
#define NUM_PINS 11 #define NUM_PINS 11
@ -45,10 +48,12 @@ enum {
CMI_AUTO, /* let driver guess it */ CMI_AUTO, /* let driver guess it */
CMI_MODELS CMI_MODELS
}; };
#endif /* ENABLE_CMI_STATIC_QUIRKS */
struct cmi_spec { struct cmi_spec {
struct hda_gen_spec gen; struct hda_gen_spec gen;
#ifdef ENABLE_CMI_STATIC_QUIRKS
/* below are only for static models */ /* below are only for static models */
int board_config; int board_config;
@ -81,8 +86,10 @@ struct cmi_spec {
/* multichannel pins */ /* multichannel pins */
struct hda_verb multi_init[9]; /* 2 verbs for each pin + terminator */ struct hda_verb multi_init[9]; /* 2 verbs for each pin + terminator */
#endif /* ENABLE_CMI_STATIC_QUIRKS */
}; };
#ifdef ENABLE_CMI_STATIC_QUIRKS
/* /*
* input MUX * input MUX
*/ */
@ -566,6 +573,7 @@ static const struct hda_codec_ops cmi9880_patch_ops = {
.init = cmi9880_init, .init = cmi9880_init,
.free = cmi9880_free, .free = cmi9880_free,
}; };
#endif /* ENABLE_CMI_STATIC_QUIRKS */
/* /*
* stuff for auto-parser * stuff for auto-parser
@ -588,15 +596,20 @@ static int cmi_parse_auto_config(struct hda_codec *codec)
err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
if (err < 0) if (err < 0)
return err; goto error;
err = snd_hda_gen_parse_auto_config(codec, cfg); err = snd_hda_gen_parse_auto_config(codec, cfg);
if (err < 0) if (err < 0)
return err; goto error;
codec->patch_ops = cmi_auto_patch_ops; codec->patch_ops = cmi_auto_patch_ops;
return 0; return 0;
error:
snd_hda_gen_free(codec);
return err;
} }
static int patch_cmi9880(struct hda_codec *codec) static int patch_cmi9880(struct hda_codec *codec)
{ {
struct cmi_spec *spec; struct cmi_spec *spec;
@ -606,6 +619,7 @@ static int patch_cmi9880(struct hda_codec *codec)
return -ENOMEM; return -ENOMEM;
codec->spec = spec; codec->spec = spec;
#ifdef ENABLE_CMI_STATIC_QUIRKS
spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS, spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS,
cmi9880_models, cmi9880_models,
cmi9880_cfg_tbl); cmi9880_cfg_tbl);
@ -615,14 +629,8 @@ static int patch_cmi9880(struct hda_codec *codec)
spec->board_config = CMI_AUTO; /* try everything */ spec->board_config = CMI_AUTO; /* try everything */
} }
if (spec->board_config == CMI_AUTO) { if (spec->board_config == CMI_AUTO)
int err = cmi_parse_auto_config(codec); return cmi_parse_auto_config(codec);
if (err < 0) {
snd_hda_gen_free(codec);
return err;
}
return 0;
}
/* copy default DAC NIDs */ /* copy default DAC NIDs */
memcpy(spec->dac_nids, cmi9880_dac_nids, sizeof(spec->dac_nids)); memcpy(spec->dac_nids, cmi9880_dac_nids, sizeof(spec->dac_nids));
@ -669,6 +677,9 @@ static int patch_cmi9880(struct hda_codec *codec)
codec->patch_ops = cmi9880_patch_ops; codec->patch_ops = cmi9880_patch_ops;
return 0; return 0;
#else
return cmi_parse_auto_config(codec);
#endif
} }
/* /*