diff --git a/src/ec/lenovo/h8/acpi/thinkpad.asl b/src/ec/lenovo/h8/acpi/thinkpad.asl index de2fe68192..d0e4234ed9 100644 --- a/src/ec/lenovo/h8/acpi/thinkpad.asl +++ b/src/ec/lenovo/h8/acpi/thinkpad.asl @@ -18,6 +18,7 @@ Device (HKEY) { /* Generated by ssdt.c */ External (\HBDC, IntObj) + External (\HWAN, IntObj) Name (_HID, EisaId ("IBM0068")) @@ -190,4 +191,41 @@ Device (HKEY) /* FIXME: Store state at resume */ } } + + /* + * Returns the current state: + * Bit 0: WWAN HW present + * Bit 1: WWAN radio enabled + * Bit 2: WWAN state at resume + */ + Method (GWAN, 0) + { + If (HWAN) { + Store(One, Local0) + If(\_SB.PCI0.LPCB.EC.WWEB) + { + Or(Local0, 2, Local0) + } + /* FIXME: Implement state at resume, for now Enabled */ + Or(Local0, 4, Local0) + Return (Local0) + } Else { + Return (0) + } + } + + /* + * Set the current state: + * Bit 1: WWAN radio enabled + * Bit 2: WWAN state at resume + */ + Method (SWAN, 1) + { + If (HWAN) { + ShiftRight (And(Arg0, 2), 1, Local0) + Store (Local0, \_SB.PCI0.LPCB.EC.WWEB) + + /* FIXME: Store state at resume */ + } + } } diff --git a/src/ec/lenovo/h8/ssdt.c b/src/ec/lenovo/h8/ssdt.c index 35570b0b72..84a52f5f63 100644 --- a/src/ec/lenovo/h8/ssdt.c +++ b/src/ec/lenovo/h8/ssdt.c @@ -46,6 +46,7 @@ void h8_ssdt_generator(struct device *dev) /* Used by thinkpad_acpi */ acpigen_write_name_byte("HBDC", h8_has_bdc(dev) ? ONE_OP : ZERO_OP); + acpigen_write_name_byte("HWAN", h8_has_wwan(dev) ? ONE_OP : ZERO_OP); acpigen_pop_len(); /* Scope HKEY */ }