Contribute
Register

[Guide] Lenovo Ideapad battery threshold hotkeys - Battery Conservation mode

Joined
Sep 10, 2012
Messages
16
Motherboard
Asus Maximus Hero VIII
CPU
i7-6700k
Graphics
RX 570
Mac
iMac, MacBook Pro
Mobile Phone
iOS
I found a way to limit battery charging to 60% (the same way we have in Windows for Lenovo laptops). I find this mode useful when using the laptop a long time wired on my desk, so the battery does not wear.

This works perfectly for my device - Lenovo IdeaPad 720s-15IKB - but I'm sure it will work for other Lenovo laptops that have this feature in Lenovo Vantage.

The concept is simple, apply the following patch with Maciasl on your DSDT and reboot.
It binds FN+F7 to "Limited charge - 60%" and FN+F8 to "Restore 100% limit".

Code:
// patch to bind some fn keys to limit battery charge on Various IdeaPad models
// tested on Ideapad 720s-15ikb
// _Q28 is fn+f7 on my keyboard
into method label _Q28 replace_content
begin
// Limit to 60% battery charge\n
^VPC0.SBMC (0x03)\n
Notify (VPC0, 0x80) // Status Change
end;
// _Q2E is fn+f8 on my keyboard
into method label _Q2E replace_content
begin
// Reset limit to 100% battery charge\n
^VPC0.SBMC (0x05)\n
Notify (VPC0, 0x80) // Status Change
end;
The resulting code should look like this:

Code:
        Method (_Q28, 0, NotSerialized)
        {
            ^VPC0.SBMC (0x03)
            Notify (VPC0, 0x80) // Status Change
        }


        Method (_Q2E, 0, NotSerialized)
        {
            ^VPC0.SBMC (0x05)
            Notify (VPC0, 0x80) // Status Change
        }
To test, charge the device to 50-60%, press FN+F7. Once it reaches 60% it will stop and the battery LED will not blink. Press FN+F8 and the LED will start to blink again. The battery icon in MAC OS will update in 1-2 minutes usually.

Notes:
1. Keys can be changed for each individual keyboard layouts and can be detected with https://github.com/RehabMan/OS-X-ACPI-Debug .
For my device, _Q28 is FN+F7 and _Q2E is FN+F8

Steps to determine the keys for your device:
  1. Install the kext: https://github.com/RehabMan/OS-X-ACPI-Debug
  2. Open MaciASL and click on patch.(Add rehab man repo https://raw.githubusercontent.com/RehabMan/OS-X-ACPI-Debug/master/ )
  3. Apply "Add DSDT Debug Methods" and "Instrument EC Queries".
  4. Save the DSDT and restart
  5. Look in Syslog as you press the key corresponding to determine which _QXX methods handle the keys

2. How to make sure the values we set are correct? Look at the SBMC method (in _SB.PCI0.LPCB.EC0.VPC0) and see what variables are set for each value.
For my device:
\_SB.PCI0.LPCB.EC0.VPC0.SBMC(0x03) // sets SMBM=1 - 60% limit
\_SB.PCI0.LPCB.EC0.VPC0.SBMC(0x05) // sets SMBM=0 - reset limit
\_SB.PCI0.LPCB.EC0.VPC0.SBMC(0x07) // sets QKCM=1 Express charge mode
\_SB.PCI0.LPCB.EC0.VPC0.SBMC(0x08) // sets QKCM=0 Express charge mode off
Other variables I don't know what are for and I would not want to touch.

3. You can also bind some other keys to enable quick charge (0x07) see above.
4. I've binded two keys for this because there is no visual indicator for which state we are in(like volume control or brightness).
5. I'm still a noob at DSDT, suggestions and improvements are welcome :D

Inspired by:
 
Joined
Jun 4, 2017
Messages
148
Motherboard
ASUS GL504GW - OpenCore
CPU
i7-8750H
Graphics
UHD 630 + RTX2070, 1920x1080
Mobile Phone
iOS
Hey, how did you find what method controlled charging?
For my laptop the battery is BAT0, but the methods there don't seem to have any conditionals to determine if it's a correct method.
 
Joined
Sep 10, 2012
Messages
16
Motherboard
Asus Maximus Hero VIII
CPU
i7-6700k
Graphics
RX 570
Mac
iMac, MacBook Pro
Mobile Phone
iOS
Top