ALSA: hda/realtek - Refactor alc269_fixup_hp_mute_led_mic*()

Just a code refactoring to use the common helper for the all three
functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2018-05-29 11:38:38 +02:00
parent 7f783bd5e2
commit 85c467dc03

View File

@ -3653,43 +3653,37 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
} }
} }
static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
const struct hda_fixup *fix, int action) const struct hda_fixup *fix,
int action, hda_nid_t pin)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PRE_PROBE) { if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->mute_led_polarity = 0; spec->mute_led_polarity = 0;
spec->mute_led_nid = 0x18; spec->mute_led_nid = pin;
spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
spec->gen.vmaster_mute_enum = 1; spec->gen.vmaster_mute_enum = 1;
codec->power_filter = led_power_filter; codec->power_filter = led_power_filter;
} }
} }
static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
}
static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
const struct hda_fixup *fix, int action) const struct hda_fixup *fix, int action)
{ {
struct alc_spec *spec = codec->spec; alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->mute_led_polarity = 0;
spec->mute_led_nid = 0x19;
spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
spec->gen.vmaster_mute_enum = 1;
codec->power_filter = led_power_filter;
}
} }
static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
const struct hda_fixup *fix, int action) const struct hda_fixup *fix, int action)
{ {
struct alc_spec *spec = codec->spec; alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->mute_led_polarity = 0;
spec->mute_led_nid = 0x1b;
spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
spec->gen.vmaster_mute_enum = 1;
codec->power_filter = led_power_filter;
}
} }
/* update LED status via GPIO */ /* update LED status via GPIO */