[coreboot-gerrit] Patch set updated for coreboot: ec/lenovo/h8: Fix mute LEDs

Nicola Corna (nicola@corna.info) gerrit at coreboot.org
Sat Feb 11 17:24:00 CET 2017


Nicola Corna (nicola at corna.info) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18329

-gerrit

commit 5e32d0cd8ad4be8c28c35525458300fed73bc2d2
Author: Nicola Corna <nicola at corna.info>
Date:   Sat Feb 11 14:52:24 2017 +0100

    ec/lenovo/h8: Fix mute LEDs
    
    thinkpad_acpi expects a SSMS method to turn on/off the mute LED
    and a MMTS method to turn on/off the microphone mute LED.
    With these methods implemented the driver can correctly sync
    the LEDs with the corresponding statuses.
    
    There seems to be two different bits to mute the audio in the
    Lenovo H8 EC but one of them (AMUT) doesn't toggle the LED; to
    prevent unexpected behaviours on the untested platforms, the two
    bits are used.
    
    Tested on a X220T.
    
    Change-Id: I578f95f9619a53fd35f8a8bfe5564aeb6c789212
    Signed-off-by: Nicola Corna <nicola at corna.info>
---
 src/ec/lenovo/h8/acpi/ec.asl | 21 +++++++++++++++++++++
 src/ec/lenovo/h8/h8.c        |  8 ++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index 497dde4..e6aec0e 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -39,6 +39,9 @@ Device(EC)
 				DKR2, 1,	/* Dock register 2 */
 		Offset (0x2a),
 				EVNT, 8,	/* write will trigger EC event */
+		Offset (0x30),
+				    , 6,
+				ALMT, 1,	/* Audio Mute + LED */
 		Offset (0x3a),
 				AMUT, 1,	/* Audio Mute */
 				    , 3,
@@ -89,6 +92,7 @@ Device(EC)
 
 	Method (MUTE, 1, NotSerialized)
 	{
+		Store(Arg0, ALMT)
 		Store(Arg0, AMUT)
 	}
 
@@ -362,6 +366,23 @@ Device(EC)
 		{
 			Return (TBSW << 3)
 		}
+		/* Mute audio */
+		Method (SSMS, 1, NotSerialized)
+		{
+			MUTE(Arg0)
+		}
+		/* Control mute microphone LED */
+		Method (MMTS, 1, NotSerialized)
+		{
+			If (Arg0)
+			{
+				TLED(0x8E)
+			}
+			Else
+			{
+				TLED(0x0E)
+			}
+		}
 		/* Version */
 		Method (MHKV, 0, NotSerialized)
 		{
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index b085094..b8f1f5d 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -122,10 +122,14 @@ static void h8_log_ec_version(void)
 
 void h8_set_audio_mute(int mute)
 {
-	if (mute)
+	if (mute) {
+		ec_set_bit(H8_VOLUME_CONTROL, 6);
 		ec_set_bit(0x3a, 0);
-	else
+	}
+	else {
+		ec_clr_bit(H8_VOLUME_CONTROL, 6);
 		ec_clr_bit(0x3a, 0);
+	}
 }
 
 void h8_enable_event(int event)



More information about the coreboot-gerrit mailing list