/* * Fix max input level on mixer widget to 0dB * (originally it has 0x1e steps with 0 dB offset 0x17) */ static void cxt_fixup_cap_mix_amp_5047(struct hda_codec *codec, const struct hda_fixup *fix, int action) { snd_hda_override_amp_caps(codec, 0x10, HDA_INPUT, (0x17 << AC_AMPCAP_OFFSET_SHIFT) | (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | (1 << AC_AMPCAP_MUTE_SHIFT)); }
/* correct the 0dB offset of input pins */ static void cs4208_fix_amp_caps(struct hda_codec *codec, hda_nid_t adc) { unsigned int caps; caps = query_amp_caps(codec, adc, HDA_INPUT); caps &= ~(AC_AMPCAP_OFFSET); caps |= 0x02; snd_hda_override_amp_caps(codec, adc, HDA_INPUT, caps); }
/* set the upper-limit for mixer amp to 0dB for avoiding the possible * damage by overloading */ static void ad1981_fixup_amp_override(struct hda_codec *codec, const struct hda_fixup *fix, int action) { if (action == HDA_FIXUP_ACT_PRE_PROBE) snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT, (0x17 << AC_AMPCAP_OFFSET_SHIFT) | (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | (1 << AC_AMPCAP_MUTE_SHIFT)); }
static void fix_volume_caps(struct hda_codec *codec, hda_nid_t dac) { unsigned int caps; /* set the upper-limit for mixer amp to 0dB */ caps = query_amp_caps(codec, dac, HDA_OUTPUT); caps &= ~(0x7f << AC_AMPCAP_NUM_STEPS_SHIFT); caps |= ((caps >> AC_AMPCAP_OFFSET_SHIFT) & 0x7f) << AC_AMPCAP_NUM_STEPS_SHIFT; snd_hda_override_amp_caps(codec, dac, HDA_OUTPUT, caps); }
static void cxt5066_increase_mic_boost(struct hda_codec *codec, const struct hda_fixup *fix, int action) { if (action != HDA_FIXUP_ACT_PRE_PROBE) return; snd_hda_override_amp_caps(codec, 0x17, HDA_OUTPUT, (0x3 << AC_AMPCAP_OFFSET_SHIFT) | (0x4 << AC_AMPCAP_NUM_STEPS_SHIFT) | (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) | (0 << AC_AMPCAP_MUTE_SHIFT)); }
/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches * can be created (bko#42825) */ static void add_cx5051_fake_mutes(struct hda_codec *codec) { static hda_nid_t out_nids[] = { 0x10, 0x11, 0 }; hda_nid_t *p; for (p = out_nids; *p; p++) snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT, AC_AMPCAP_MIN_MUTE | query_amp_caps(codec, *p, HDA_OUTPUT)); }
/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches * can be created (bko#42825) */ static void add_cx5051_fake_mutes(struct hda_codec *codec) { struct conexant_spec *spec = codec->spec; static hda_nid_t out_nids[] = { 0x10, 0x11, 0 }; hda_nid_t *p; for (p = out_nids; *p; p++) snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT, AC_AMPCAP_MIN_MUTE | query_amp_caps(codec, *p, HDA_OUTPUT)); spec->gen.dac_min_mute = true; }