}
EXPORT_SYMBOL_HDA(snd_hda_get_pin_label);
-int snd_hda_gen_add_verbs(struct hda_gen_spec *spec,
- const struct hda_verb *list)
+int snd_hda_add_verbs(struct hda_codec *codec,
+ const struct hda_verb *list)
{
const struct hda_verb **v;
- v = snd_array_new(&spec->verbs);
+ v = snd_array_new(&codec->verbs);
if (!v)
return -ENOMEM;
*v = list;
return 0;
}
-EXPORT_SYMBOL_HDA(snd_hda_gen_add_verbs);
+EXPORT_SYMBOL_HDA(snd_hda_add_verbs);
-void snd_hda_gen_apply_verbs(struct hda_codec *codec)
+void snd_hda_apply_verbs(struct hda_codec *codec)
{
- struct hda_gen_spec *spec = codec->spec;
int i;
- for (i = 0; i < spec->verbs.used; i++) {
- struct hda_verb **v = snd_array_elem(&spec->verbs, i);
+ for (i = 0; i < codec->verbs.used; i++) {
+ struct hda_verb **v = snd_array_elem(&codec->verbs, i);
snd_hda_sequence_write(codec, *v);
}
}
-EXPORT_SYMBOL_HDA(snd_hda_gen_apply_verbs);
+EXPORT_SYMBOL_HDA(snd_hda_apply_verbs);
void snd_hda_apply_pincfgs(struct hda_codec *codec,
const struct hda_pintbl *cfg)
void snd_hda_apply_fixup(struct hda_codec *codec, int action)
{
- struct hda_gen_spec *spec = codec->spec;
- int id = spec->fixup_id;
+ int id = codec->fixup_id;
#ifdef CONFIG_SND_DEBUG_VERBOSE
- const char *modelname = spec->fixup_name;
+ const char *modelname = codec->fixup_name;
#endif
int depth = 0;
- if (!spec->fixup_list)
+ if (!codec->fixup_list)
return;
while (id >= 0) {
- const struct hda_fixup *fix = spec->fixup_list + id;
+ const struct hda_fixup *fix = codec->fixup_list + id;
switch (fix->type) {
case HDA_FIXUP_PINS:
snd_printdd(KERN_INFO SFX
"%s: Apply fix-verbs for %s\n",
codec->chip_name, modelname);
- snd_hda_gen_add_verbs(codec->spec, fix->v.verbs);
+ snd_hda_add_verbs(codec, fix->v.verbs);
break;
case HDA_FIXUP_FUNC:
if (!fix->v.func)
const struct snd_pci_quirk *quirk,
const struct hda_fixup *fixlist)
{
- struct hda_gen_spec *spec = codec->spec;
const struct snd_pci_quirk *q;
int id = -1;
const char *name = NULL;
/* when model=nofixup is given, don't pick up any fixups */
if (codec->modelname && !strcmp(codec->modelname, "nofixup")) {
- spec->fixup_list = NULL;
- spec->fixup_id = -1;
+ codec->fixup_list = NULL;
+ codec->fixup_id = -1;
return;
}
}
}
- spec->fixup_id = id;
+ codec->fixup_id = id;
if (id >= 0) {
- spec->fixup_list = fixlist;
- spec->fixup_name = name;
+ codec->fixup_list = fixlist;
+ codec->fixup_name = name;
}
}
EXPORT_SYMBOL_HDA(snd_hda_pick_fixup);
#define snd_hda_parse_pin_def_config(codec, cfg, ignore) \
snd_hda_parse_pin_defcfg(codec, cfg, ignore, 0)
-/*
- */
-
-struct hda_gen_spec {
- /* fix-up list */
- int fixup_id;
- const struct hda_fixup *fixup_list;
- const char *fixup_name;
-
- /* additional init verbs */
- struct snd_array verbs;
-};
-
-
-/*
- * Fix-up pin default configurations and add default verbs
- */
-
-struct hda_pintbl {
- hda_nid_t nid;
- u32 val;
-};
-
-struct hda_model_fixup {
- const int id;
- const char *name;
-};
-
-struct hda_fixup {
- int type;
- bool chained;
- int chain_id;
- union {
- const struct hda_pintbl *pins;
- const struct hda_verb *verbs;
- void (*func)(struct hda_codec *codec,
- const struct hda_fixup *fix,
- int action);
- } v;
-};
-
-/* fixup types */
-enum {
- HDA_FIXUP_INVALID,
- HDA_FIXUP_PINS,
- HDA_FIXUP_VERBS,
- HDA_FIXUP_FUNC,
-};
-
-/* fixup action definitions */
-enum {
- HDA_FIXUP_ACT_PRE_PROBE,
- HDA_FIXUP_ACT_PROBE,
- HDA_FIXUP_ACT_INIT,
- HDA_FIXUP_ACT_BUILD,
-};
-
-int snd_hda_gen_add_verbs(struct hda_gen_spec *spec,
- const struct hda_verb *list);
-void snd_hda_gen_apply_verbs(struct hda_codec *codec);
-void snd_hda_apply_pincfgs(struct hda_codec *codec,
- const struct hda_pintbl *cfg);
-void snd_hda_apply_fixup(struct hda_codec *codec, int action);
-void snd_hda_pick_fixup(struct hda_codec *codec,
- const struct hda_model_fixup *models,
- const struct snd_pci_quirk *quirk,
- const struct hda_fixup *fixlist);
-
-static inline void snd_hda_gen_init(struct hda_gen_spec *spec)
-{
- snd_array_init(&spec->verbs, sizeof(struct hda_verb *), 8);
-}
-
-static inline void snd_hda_gen_free(struct hda_gen_spec *spec)
-{
- snd_array_free(&spec->verbs);
-}
-
#endif /* __SOUND_HDA_AUTO_PARSER_H */
snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64);
snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16);
+ snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8);
INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
#ifdef CONFIG_PM
snd_array_free(&codec->driver_pins);
snd_array_free(&codec->cvt_setups);
snd_array_free(&codec->spdif_out);
+ snd_array_free(&codec->verbs);
codec->num_pcms = 0;
codec->pcm_info = NULL;
codec->preset = NULL;
/* jack detection */
struct snd_array jacks;
#endif
+
+ /* fix-up list */
+ int fixup_id;
+ const struct hda_fixup *fixup_list;
+ const char *fixup_name;
+
+ /* additional init verbs */
+ struct snd_array verbs;
};
/* direction */
int snd_hda_add_new_ctls(struct hda_codec *codec,
const struct snd_kcontrol_new *knew);
+/*
+ * Fix-up pin default configurations and add default verbs
+ */
+
+struct hda_pintbl {
+ hda_nid_t nid;
+ u32 val;
+};
+
+struct hda_model_fixup {
+ const int id;
+ const char *name;
+};
+
+struct hda_fixup {
+ int type;
+ bool chained;
+ int chain_id;
+ union {
+ const struct hda_pintbl *pins;
+ const struct hda_verb *verbs;
+ void (*func)(struct hda_codec *codec,
+ const struct hda_fixup *fix,
+ int action);
+ } v;
+};
+
+/* fixup types */
+enum {
+ HDA_FIXUP_INVALID,
+ HDA_FIXUP_PINS,
+ HDA_FIXUP_VERBS,
+ HDA_FIXUP_FUNC,
+};
+
+/* fixup action definitions */
+enum {
+ HDA_FIXUP_ACT_PRE_PROBE,
+ HDA_FIXUP_ACT_PROBE,
+ HDA_FIXUP_ACT_INIT,
+ HDA_FIXUP_ACT_BUILD,
+};
+
+int snd_hda_add_verbs(struct hda_codec *codec, const struct hda_verb *list);
+void snd_hda_apply_verbs(struct hda_codec *codec);
+void snd_hda_apply_pincfgs(struct hda_codec *codec,
+ const struct hda_pintbl *cfg);
+void snd_hda_apply_fixup(struct hda_codec *codec, int action);
+void snd_hda_pick_fixup(struct hda_codec *codec,
+ const struct hda_model_fixup *models,
+ const struct snd_pci_quirk *quirk,
+ const struct hda_fixup *fixlist);
+
/*
* unsolicited event handler
*/
*/
struct cs_spec {
- struct hda_gen_spec gen;
-
struct auto_pin_cfg autocfg;
struct hda_multi_out multiout;
struct snd_kcontrol *vmaster_sw;
snd_hda_sequence_write(codec, cs_coef_init_verbs);
- snd_hda_gen_apply_verbs(codec);
+ snd_hda_apply_verbs(codec);
if (spec->gpio_mask) {
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK,
struct cs_spec *spec = codec->spec;
kfree(spec->capture_bind[0]);
kfree(spec->capture_bind[1]);
- snd_hda_gen_free(&spec->gen);
kfree(codec->spec);
}
if (!spec)
return -ENOMEM;
codec->spec = spec;
- snd_hda_gen_init(&spec->gen);
spec->vendor_nid = CS420X_VENDOR_NID;
if (!spec)
return -ENOMEM;
codec->spec = spec;
- snd_hda_gen_init(&spec->gen);
spec->vendor_nid = CS4210_VENDOR_NID;
if (!spec)
return -ENOMEM;
codec->spec = spec;
- snd_hda_gen_init(&spec->gen);
spec->vendor_nid = CS4213_VENDOR_NID;
};
struct conexant_spec {
- struct hda_gen_spec gen;
-
const struct snd_kcontrol_new *mixers[5];
int num_mixers;
hda_nid_t vmaster_nid;
static void conexant_free(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
- snd_hda_gen_free(&spec->gen);
snd_hda_detach_beep_device(codec);
kfree(spec);
}
static int cx_auto_init(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
- snd_hda_gen_apply_verbs(codec);
+ snd_hda_apply_verbs(codec);
cx_auto_init_output(codec);
cx_auto_init_input(codec);
cx_auto_init_digital(codec);
if (!spec)
return -ENOMEM;
codec->spec = spec;
- snd_hda_gen_init(&spec->gen);
switch (codec->vendor_id) {
case 0x14f15045:
};
struct alc_spec {
- struct hda_gen_spec gen;
-
/* codec parameterization */
const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
unsigned int num_mixers;
alc_fix_pll(codec);
alc_auto_init_amp(codec, spec->init_amp);
- snd_hda_gen_apply_verbs(codec);
+ snd_hda_apply_verbs(codec);
alc_auto_init_std(codec);
if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook)
alc_free_kctls(codec);
alc_free_bind_ctls(codec);
snd_array_free(&spec->paths);
- snd_hda_gen_free(&spec->gen);
kfree(spec);
snd_hda_detach_beep_device(codec);
}
codec->spec = spec;
codec->single_adc_amp = 1;
spec->mixer_nid = mixer_nid;
- snd_hda_gen_init(&spec->gen);
snd_array_init(&spec->kctls, sizeof(struct snd_kcontrol_new), 32);
snd_array_init(&spec->bind_ctls, sizeof(struct hda_bind_ctls *), 8);
snd_array_init(&spec->paths, sizeof(struct nid_path), 8);
spec->autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
snd_hda_jack_detect_enable_callback(codec, 0x0f, ALC_HP_EVENT,
alc_hp_automute);
- snd_hda_gen_add_verbs(&spec->gen, alc_gpio1_init_verbs);
+ snd_hda_add_verbs(codec, alc_gpio1_init_verbs);
}
}
if (err > 0) {
if (!spec->no_analog && spec->autocfg.speaker_pins[0] != 0x1d) {
add_mixer(spec, alc268_beep_mixer);
- snd_hda_gen_add_verbs(&spec->gen, alc268_beep_init_verbs);
+ snd_hda_add_verbs(codec, alc268_beep_init_verbs);
}
}
return err;
};
struct via_spec {
- struct hda_gen_spec gen;
-
/* codec parameterization */
const struct snd_kcontrol_new *mixers[6];
unsigned int num_mixers;
/* VT1708BCE & VT1708S are almost same */
if (spec->codec_type == VT1708BCE)
spec->codec_type = VT1708S;
- snd_hda_gen_init(&spec->gen);
return spec;
}
vt1708_stop_hp_work(spec);
kfree(spec->bind_cap_vol);
kfree(spec->bind_cap_sw);
- snd_hda_gen_free(&spec->gen);
kfree(spec);
}