- Joined
- Sep 10, 2012
- Messages
- 16
- Motherboard
- Asus Maximus Hero VIII
- CPU
- i7-6700k
- Graphics
- RX 570
- Mac
- Mobile Phone
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".
The resulting code should look like this:
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:
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
Inspired by:
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:
- Install the kext: https://github.com/RehabMan/OS-X-ACPI-Debug
- Open MaciASL and click on patch.(Add rehab man repo https://raw.githubusercontent.com/RehabMan/OS-X-ACPI-Debug/master/ )
- Apply "Add DSDT Debug Methods" and "Instrument EC Queries".
- Save the DSDT and restart
- 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
Inspired by:
GUIDE: How to Fix Brightness hotkeys in DSDT / SSDT-hotpatch
If you have a working Brightness Slider and you might be using Brightness slider or manual hotkeys to control brightness then this guide may help you to use your Native hotkeys of laptop. (All the Credits goes to @RehabMan For OS-X-ACPI-Debug Kext and DSDT Patches.) This step assumes that you are...
www.insanelymac.com