#include "hda_jack.h"
#include "hda_generic.h"
+#undef ENABLE_CMI_STATIC_QUIRKS
+
+#ifdef ENABLE_CMI_STATIC_QUIRKS
#define NUM_PINS 11
CMI_AUTO, /* let driver guess it */
CMI_MODELS
};
+#endif /* ENABLE_CMI_STATIC_QUIRKS */
struct cmi_spec {
struct hda_gen_spec gen;
+#ifdef ENABLE_CMI_STATIC_QUIRKS
/* below are only for static models */
int board_config;
/* multichannel pins */
struct hda_verb multi_init[9]; /* 2 verbs for each pin + terminator */
+#endif /* ENABLE_CMI_STATIC_QUIRKS */
};
+#ifdef ENABLE_CMI_STATIC_QUIRKS
/*
* input MUX
*/
.init = cmi9880_init,
.free = cmi9880_free,
};
+#endif /* ENABLE_CMI_STATIC_QUIRKS */
/*
* stuff for auto-parser
err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
if (err < 0)
- return err;
+ goto error;
err = snd_hda_gen_parse_auto_config(codec, cfg);
if (err < 0)
- return err;
+ goto error;
codec->patch_ops = cmi_auto_patch_ops;
return 0;
+
+ error:
+ snd_hda_gen_free(codec);
+ return err;
}
+
static int patch_cmi9880(struct hda_codec *codec)
{
struct cmi_spec *spec;
return -ENOMEM;
codec->spec = spec;
+#ifdef ENABLE_CMI_STATIC_QUIRKS
spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS,
cmi9880_models,
cmi9880_cfg_tbl);
spec->board_config = CMI_AUTO; /* try everything */
}
- if (spec->board_config == CMI_AUTO) {
- int err = cmi_parse_auto_config(codec);
- if (err < 0) {
- snd_hda_gen_free(codec);
- return err;
- }
- return 0;
- }
+ if (spec->board_config == CMI_AUTO)
+ return cmi_parse_auto_config(codec);
/* copy default DAC NIDs */
memcpy(spec->dac_nids, cmi9880_dac_nids, sizeof(spec->dac_nids));
codec->patch_ops = cmi9880_patch_ops;
return 0;
+#else
+ return cmi_parse_auto_config(codec);
+#endif
}
/*