Skip to content

Commit d3be95e

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - Fixed Speaker Mute LED for HP EliteBoard G1a platform
On the HP EliteBoard G1a platform (models without a headphone jack). the speaker mute LED failed to function. The Sysfs ctl-led info showed empty values because the standard LED registration couldn't correctly bind to the master switch. Adding this patch will fix and enable the speaker mute LED feature. Tested-by: Chris Chiu <[email protected]> Signed-off-by: Kailang Yang <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 50c8f83 commit d3be95e

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

sound/hda/codecs/realtek/alc269.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3725,22 +3725,42 @@ static void alc245_tas2781_spi_hp_fixup_muteled(struct hda_codec *codec,
37253725
alc_fixup_hp_gpio_led(codec, action, 0x04, 0x0);
37263726
alc285_fixup_hp_coef_micmute_led(codec, fix, action);
37273727
}
3728+
3729+
static void alc245_hp_spk_mute_led_update(void *private_data, int enabled)
3730+
{
3731+
struct hda_codec *codec = private_data;
3732+
unsigned int val;
3733+
3734+
val = enabled ? 0x08 : 0x04; /* 0x08 led on, 0x04 led off */
3735+
alc_update_coef_idx(codec, 0x0b, 0x0c, val);
3736+
}
3737+
37283738
/* JD2: mute led GPIO3: micmute led */
37293739
static void alc245_tas2781_i2c_hp_fixup_muteled(struct hda_codec *codec,
37303740
const struct hda_fixup *fix, int action)
37313741
{
37323742
struct alc_spec *spec = codec->spec;
3743+
hda_nid_t hp_pin = alc_get_hp_pin(spec);
37333744
static const hda_nid_t conn[] = { 0x02 };
37343745

37353746
switch (action) {
37363747
case HDA_FIXUP_ACT_PRE_PROBE:
3748+
if (!hp_pin) {
3749+
spec->gen.vmaster_mute.hook = alc245_hp_spk_mute_led_update;
3750+
spec->gen.vmaster_mute_led = 1;
3751+
}
37373752
spec->gen.auto_mute_via_amp = 1;
37383753
snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
37393754
break;
3755+
case HDA_FIXUP_ACT_INIT:
3756+
if (!hp_pin)
3757+
alc245_hp_spk_mute_led_update(codec, !spec->gen.master_mute);
3758+
break;
37403759
}
37413760

37423761
tas2781_fixup_txnw_i2c(codec, fix, action);
3743-
alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
3762+
if (hp_pin)
3763+
alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
37443764
alc285_fixup_hp_coef_micmute_led(codec, fix, action);
37453765
}
37463766
/*

0 commit comments

Comments
 (0)