alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
@ 2020-09-14  7:02 Kai-Heng Feng
  2020-09-14  8:04 ` Hui Wang
  2020-09-21  8:27 ` Takashi Iwai
  0 siblings, 2 replies; 6+ messages in thread
From: Kai-Heng Feng @ 2020-09-14  7:02 UTC (permalink / raw)
  To: tiwai
  Cc: moderated list:SOUND, Kailang Yang, Thomas Hebb, open list,
	Hui Wang, Kai-Heng Feng, Huacai Chen, Jian-Hong Pan,
	Michał Mirosław

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.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c521a1f17096..ba941bd0b792 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -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.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
  2020-09-14  7:02 [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520 Kai-Heng Feng
@ 2020-09-14  8:04 ` Hui Wang
  2020-09-14  8:07   ` Kai-Heng Feng
  2020-09-21  8:27 ` Takashi Iwai
  1 sibling, 1 reply; 6+ messages in thread
From: Hui Wang @ 2020-09-14  8:04 UTC (permalink / raw)
  To: Kai-Heng Feng, tiwai
  Cc: moderated list:SOUND, Kailang Yang, open list,
	Michał Mirosław, Thomas Hebb, Jian-Hong Pan,
	Huacai Chen

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.

On 2020/9/14 下午3:02, Kai-Heng Feng wrote:
> 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.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>   sound/pci/hda/patch_realtek.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index c521a1f17096..ba941bd0b792 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -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,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
  2020-09-14  8:04 ` Hui Wang
@ 2020-09-14  8:07   ` Kai-Heng Feng
  2020-09-14  8:21     ` Hui Wang
  2020-09-15  0:33     ` Hui Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Kai-Heng Feng @ 2020-09-14  8:07 UTC (permalink / raw)
  To: Hui Wang
  Cc: moderated list:SOUND, Kailang Yang, tiwai, open list,
	Thomas Hebb, Jian-Hong Pan, Huacai Chen,
	Michał Mirosław

Hi Hui,

> On Sep 14, 2020, at 16:04, Hui Wang <hui.wang@canonical.com> wrote:
> 
> 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

> I also prepared a patchset but my patchset has more code than yours, please take a look. :-)
> 
> Thanks.
> 
> Hui.
> 
> On 2020/9/14 下午3:02, Kai-Heng Feng wrote:
>> 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.
>> 
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>>  sound/pci/hda/patch_realtek.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>> 
>> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
>> index c521a1f17096..ba941bd0b792 100644
>> --- a/sound/pci/hda/patch_realtek.c
>> +++ b/sound/pci/hda/patch_realtek.c
>> @@ -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,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
  2020-09-14  8:07   ` Kai-Heng Feng
@ 2020-09-14  8:21     ` Hui Wang
  2020-09-15  0:33     ` Hui Wang
  1 sibling, 0 replies; 6+ messages in thread
From: Hui Wang @ 2020-09-14  8:21 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: moderated list:SOUND, Kailang Yang, tiwai, open list,
	Thomas Hebb, Huacai Chen, Jian-Hong Pan,
	Michał Mirosław


On 2020/9/14 下午4:07, Kai-Heng Feng wrote:
> Hi Hui,
>
>> On Sep 14, 2020, at 16:04, Hui Wang <hui.wang@canonical.com> wrote:
>>
>> 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.

>
> Kai-Heng
>
>> I also prepared a patchset but my patchset has more code than yours, please take a look. :-)
>>
>> Thanks.
>>
>> Hui.
>>
>> On 2020/9/14 下午3:02, Kai-Heng Feng wrote:
>>> 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.
>>>
>>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>>> ---
>>>   sound/pci/hda/patch_realtek.c | 7 +++++++
>>>   1 file changed, 7 insertions(+)
>>>
>>> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
>>> index c521a1f17096..ba941bd0b792 100644
>>> --- a/sound/pci/hda/patch_realtek.c
>>> +++ b/sound/pci/hda/patch_realtek.c
>>> @@ -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,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
  2020-09-14  8:07   ` Kai-Heng Feng
  2020-09-14  8:21     ` Hui Wang
@ 2020-09-15  0:33     ` Hui Wang
  1 sibling, 0 replies; 6+ messages in thread
From: Hui Wang @ 2020-09-15  0:33 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: moderated list:SOUND, Kailang Yang, tiwai, open list,
	Thomas Hebb, Huacai Chen, Jian-Hong Pan,
	Michał Mirosław

OK,  then looks fine to me.

Acked-by:Hui Wang <hui.wang@canonical.com>

On 2020/9/14 下午4:07, Kai-Heng Feng wrote:
> Hi Hui,
>
>> On Sep 14, 2020, at 16:04, Hui Wang <hui.wang@canonical.com> wrote:
>>
>> 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
>
>> I also prepared a patchset but my patchset has more code than yours, please take a look. :-)
>>
>> Thanks.
>>
>> Hui.
>>
>> On 2020/9/14 下午3:02, Kai-Heng Feng wrote:
>>> 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.
>>>
>>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>>> ---
>>>   sound/pci/hda/patch_realtek.c | 7 +++++++
>>>   1 file changed, 7 insertions(+)
>>>
>>> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
>>> index c521a1f17096..ba941bd0b792 100644
>>> --- a/sound/pci/hda/patch_realtek.c
>>> +++ b/sound/pci/hda/patch_realtek.c
>>> @@ -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,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
  2020-09-14  7:02 [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520 Kai-Heng Feng
  2020-09-14  8:04 ` Hui Wang
@ 2020-09-21  8:27 ` Takashi Iwai
  1 sibling, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2020-09-21  8:27 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: moderated list:SOUND, Kailang Yang, open list, tiwai, Hui Wang,
	Thomas Hebb, Huacai Chen, Jian-Hong Pan,
	Michał Mirosław

On Mon, 14 Sep 2020 09:02:29 +0200,
Kai-Heng Feng wrote:
> 
> 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.
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Applied now with Cc to stable (and ack from Hui).


thanks,

Takashi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-21  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  7:02 [PATCH] ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520 Kai-Heng Feng
2020-09-14  8:04 ` Hui Wang
2020-09-14  8:07   ` Kai-Heng Feng
2020-09-14  8:21     ` Hui Wang
2020-09-15  0:33     ` Hui Wang
2020-09-21  8:27 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).