Skip to contentSkip to conversation

ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520

PATCH In review Kai-Heng Feng 3 participants 6 messages Sep 14, 2020 – Sep 21, 2020 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520

On Lenovo P520, the front panel headset LED isn't lit up right now.

Realtek states that the LED needs to be enabled by ALC233's GPIO2, so let's do it accordingly to light the LED up.

---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index c521a1f17096..ba941bd0b792 100644
@@ -6017,6 +6017,7 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
 #include "hp_x360_helper.c"
 
 enum {
+	ALC269_FIXUP_GPIO2,
 	ALC269_FIXUP_SONY_VAIO,
 	ALC275_FIXUP_SONY_VAIO_GPIO2,
 	ALC269_FIXUP_DELL_M101Z,
@@ -6194,6 +6195,10 @@ enum {
 };
 
 static const struct hda_fixup alc269_fixups[] = {
+	[ALC269_FIXUP_GPIO2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_gpio2,
+	},
 	[ALC269_FIXUP_SONY_VAIO] = {
 		.type = HDA_FIXUP_PINCTLS,
 		.v.pins = (const struct hda_pintbl[]) {
@@ -7013,6 +7018,8 @@ static const struct hda_fixup alc269_fixups[] = {
 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_GPIO2
 	},
 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
 		.type = HDA_FIXUP_VERBS,
Signature · 1 line
2.17.1
#1 lore raw

Thanks Kaiheng, and we just had one P520 in the Beijing office and I also worked on this issue happenly. Does the led change according to jack plugging in or plugging out with your patch? I also prepared a patchset but my patchset has more code than yours, please take a look. :-)

Thanks.

Hui.

Quoted 42 lines · Kai-Heng Feng

On Lenovo P520, the front panel headset LED isn't lit up right now.

Realtek states that the LED needs to be enabled by ALC233's GPIO2, so let's do it accordingly to light the LED up.

---
  sound/pci/hda/patch_realtek.c | 7 +++++++
  1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index c521a1f17096..ba941bd0b792 100644
@@ -6017,6 +6017,7 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
  #include "hp_x360_helper.c"
 
  enum {
+	ALC269_FIXUP_GPIO2,
  	ALC269_FIXUP_SONY_VAIO,
  	ALC275_FIXUP_SONY_VAIO_GPIO2,
  	ALC269_FIXUP_DELL_M101Z,
@@ -6194,6 +6195,10 @@ enum {
  };
 
  static const struct hda_fixup alc269_fixups[] = {
+	[ALC269_FIXUP_GPIO2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_gpio2,
+	},
  	[ALC269_FIXUP_SONY_VAIO] = {
  		.type = HDA_FIXUP_PINCTLS,
  		.v.pins = (const struct hda_pintbl[]) {
@@ -7013,6 +7018,8 @@ static const struct hda_fixup alc269_fixups[] = {
  	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
  		.type = HDA_FIXUP_FUNC,
  		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_GPIO2
  	},
  	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
  		.type = HDA_FIXUP_VERBS,
#2 lore raw

Hi Hui,

Quoted 3 lines · Hui Wang

Thanks Kaiheng, and we just had one P520 in the Beijing office and I also worked on this issue happenly. Does the led change according to jack plugging in or plugging out with your patch?

No, the LED won't reflect the jack plugging status.

The LED is always on under Windows, so we are doing the same here.

Kai-Heng

Quoted 47 lines

I also prepared a patchset but my patchset has more code than yours, please take a look. :-)

Thanks.

Hui.

Quoted 40 lines · Kai-Heng Feng

On Lenovo P520, the front panel headset LED isn't lit up right now.

Realtek states that the LED needs to be enabled by ALC233's GPIO2, so let's do it accordingly to light the LED up.

---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index c521a1f17096..ba941bd0b792 100644
@@ -6017,6 +6017,7 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
 #include "hp_x360_helper.c"
   enum {
+	ALC269_FIXUP_GPIO2,
 	ALC269_FIXUP_SONY_VAIO,
 	ALC275_FIXUP_SONY_VAIO_GPIO2,
 	ALC269_FIXUP_DELL_M101Z,
@@ -6194,6 +6195,10 @@ enum {
 };
   static const struct hda_fixup alc269_fixups[] = {
+	[ALC269_FIXUP_GPIO2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_gpio2,
+	},
 	[ALC269_FIXUP_SONY_VAIO] = {
 		.type = HDA_FIXUP_PINCTLS,
 		.v.pins = (const struct hda_pintbl[]) {
@@ -7013,6 +7018,8 @@ static const struct hda_fixup alc269_fixups[] = {
 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_GPIO2
 	},
 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
 		.type = HDA_FIXUP_VERBS,
#3 lore raw
Quoted 8 lines · Kai-Heng Feng

Hi Hui,

Quoted 3 lines · Hui Wang

Thanks Kaiheng, and we just had one P520 in the Beijing office and I also worked on this issue happenly. Does the led change according to jack plugging in or plugging out with your patch?

No, the LED won't reflect the jack plugging status.

The LED is always on under Windows, so we are doing the same here.

Weird, the bug's title is "The backlight for a headset connector didn't light up after connecting a headset" and the QA in Beijing office also requires the led could change according to plugging or no plugging.

Quoted 50 lines

Kai-Heng

Quoted 47 lines

I also prepared a patchset but my patchset has more code than yours, please take a look. :-)

Thanks.

Hui.

Quoted 40 lines · Kai-Heng Feng

On Lenovo P520, the front panel headset LED isn't lit up right now.

Realtek states that the LED needs to be enabled by ALC233's GPIO2, so let's do it accordingly to light the LED up.

---
  sound/pci/hda/patch_realtek.c | 7 +++++++
  1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index c521a1f17096..ba941bd0b792 100644
@@ -6017,6 +6017,7 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
  #include "hp_x360_helper.c"
    enum {
+	ALC269_FIXUP_GPIO2,
  	ALC269_FIXUP_SONY_VAIO,
  	ALC275_FIXUP_SONY_VAIO_GPIO2,
  	ALC269_FIXUP_DELL_M101Z,
@@ -6194,6 +6195,10 @@ enum {
  };
    static const struct hda_fixup alc269_fixups[] = {
+	[ALC269_FIXUP_GPIO2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_gpio2,
+	},
  	[ALC269_FIXUP_SONY_VAIO] = {
  		.type = HDA_FIXUP_PINCTLS,
  		.v.pins = (const struct hda_pintbl[]) {
@@ -7013,6 +7018,8 @@ static const struct hda_fixup alc269_fixups[] = {
  	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
  		.type = HDA_FIXUP_FUNC,
  		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_GPIO2
  	},
  	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
  		.type = HDA_FIXUP_VERBS,
Acked-by
#4 lore raw
In reply to Kai-Heng Feng

OK,  then looks fine to me.

Quoted 58 lines · Kai-Heng Feng

Hi Hui,

Quoted 3 lines · Hui Wang

Thanks Kaiheng, and we just had one P520 in the Beijing office and I also worked on this issue happenly. Does the led change according to jack plugging in or plugging out with your patch?

No, the LED won't reflect the jack plugging status.

The LED is always on under Windows, so we are doing the same here.

Kai-Heng

Quoted 47 lines

I also prepared a patchset but my patchset has more code than yours, please take a look. :-)

Thanks.

Hui.

Quoted 40 lines · Kai-Heng Feng

On Lenovo P520, the front panel headset LED isn't lit up right now.

Realtek states that the LED needs to be enabled by ALC233's GPIO2, so let's do it accordingly to light the LED up.

---
  sound/pci/hda/patch_realtek.c | 7 +++++++
  1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index c521a1f17096..ba941bd0b792 100644
@@ -6017,6 +6017,7 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
  #include "hp_x360_helper.c"
    enum {
+	ALC269_FIXUP_GPIO2,
  	ALC269_FIXUP_SONY_VAIO,
  	ALC275_FIXUP_SONY_VAIO_GPIO2,
  	ALC269_FIXUP_DELL_M101Z,
@@ -6194,6 +6195,10 @@ enum {
  };
    static const struct hda_fixup alc269_fixups[] = {
+	[ALC269_FIXUP_GPIO2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_gpio2,
+	},
  	[ALC269_FIXUP_SONY_VAIO] = {
  		.type = HDA_FIXUP_PINCTLS,
  		.v.pins = (const struct hda_pintbl[]) {
@@ -7013,6 +7018,8 @@ static const struct hda_fixup alc269_fixups[] = {
  	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
  		.type = HDA_FIXUP_FUNC,
  		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_GPIO2
  	},
  	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
  		.type = HDA_FIXUP_VERBS,