static int patch_cs420x(struct hda_codec *codec) { struct cs_spec *spec; int err; spec = cs_alloc_spec(codec, CS420X_VENDOR_NID); if (!spec) return -ENOMEM; codec->patch_ops = cs_patch_ops; spec->gen.automute_hook = cs_automute; codec->single_adc_amp = 1; snd_hda_pick_fixup(codec, cs420x_models, cs420x_fixup_tbl, cs420x_fixups); snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); err = cs_parse_auto_config(codec); if (err < 0) goto error; snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); return 0; error: cs_free(codec); return err; }
static int patch_cs4210(struct hda_codec *codec) { struct cs_spec *spec; int err; spec = cs_alloc_spec(codec, CS4210_VENDOR_NID); if (!spec) return -ENOMEM; codec->patch_ops = cs421x_patch_ops; spec->gen.automute_hook = cs_automute; snd_hda_pick_fixup(codec, cs421x_models, cs421x_fixup_tbl, cs421x_fixups); snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); /* Update the GPIO/DMIC/SENSE_B pinmux before the configuration is auto-parsed. If GPIO or SENSE_B is forced, DMIC input is disabled. */ cs4210_pinmux_init(codec); err = cs421x_parse_auto_config(codec); if (err < 0) goto error; snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); return 0; error: cs_free(codec); return err; }
static int patch_cs4213(struct hda_codec *codec) { struct cs_spec *spec; int err; spec = cs_alloc_spec(codec, CS4213_VENDOR_NID); if (!spec) return -ENOMEM; err = cs421x_parse_auto_config(codec); if (err < 0) goto error; codec->patch_ops = cs421x_patch_ops; return 0; error: cs_free(codec); return err; }
static int patch_cs4208(struct hda_codec *codec) { struct cs_spec *spec; int err; spec = cs_alloc_spec(codec, CS4208_VENDOR_NID); if (!spec) return -ENOMEM; spec->gen.automute_hook = cs_automute; /* exclude NID 0x10 (HP) from output volumes due to different steps */ spec->gen.out_vol_mask = 1ULL << 0x10; snd_hda_pick_fixup(codec, cs4208_models, cs4208_fixup_tbl, cs4208_fixups); snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); snd_hda_override_wcaps(codec, 0x18, get_wcaps(codec, 0x18) | AC_WCAP_STEREO); cs4208_fix_amp_caps(codec, 0x18); cs4208_fix_amp_caps(codec, 0x1b); cs4208_fix_amp_caps(codec, 0x1c); err = cs_parse_auto_config(codec); if (err < 0) goto error; codec->patch_ops = cs_patch_ops; snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); return 0; error: cs_free(codec); return err; }