YogaSMC
YogaSMC copied to clipboard
Thinkpad L390 Yoga: testing and feedback
Good evening and thanks for all your work. I switched from Thinkpad assistant with all the ACPI renames to this kext and it works almost out of the box so you did a great job.
I wanted to report some errors:
- If I rotate my screen in tablet mode trackpad and trackpoint aren't disabled. I use a personal keyboard remap for VoodooPS2Controller:
Name (_SB.PCI0.LPCB.KBD.RMCF, Package (0x02)
{
"Keyboard",
Package (0x02)
{
"Custom PS2 Map",
Package (0x04)
{
Package (0x00){},
"e037=64",
This avoids that clicking the Print key on the keyboard disables the trackpad. I don't know if it has something to do with this problem.
-
If I rotate my screen in tablet mode I see: event:0x60f0:0 . Can I remove it?
-
I see "fan reading error" on login. I installed all the SSDT files according to my EC path, but on this laptop it was impossible to read Fan also on windows or linux (I think it's impossible in any case). How can I remove that message? Do you want to give a look to my DSDT?
-
Temperature control is useless without fan control, I think. Can I remove that part?
-
What should the "Led control" section do? Switching the sliders doesn't change anything for me
Class: Think; REL 130-2020-11-11; EC Access: RW
Thanks in advance
- Tablet mode detection is not implemented for think variant.
- I'm not sure how rotate works on your laptop. But that event code should be
TP_HKEY_EV_THM_TRANSFM_CHANGED
and feel free to open a PR like #40. - Since the fan speed & control should all go through SMI interface, the only known approach is the
thinkpad-acpi
one. If you laptop have some kind of dust clean mode in Windows, there could be some workaround. - Maybe just hide the menu bar icon?
- They should be able to control all the LEDs. Maybe yours is also an exception.
- Tablet mode detection is not implemented for think variant.
ok, sorry for the question.
- I'm not sure how rotate works on your laptop. But that event code should be
TP_HKEY_EV_THM_TRANSFM_CHANGED
and feel free to open a PR like #40.
It doesn't seem difficult, I'll try. I'm not an expert unfortunately
- Since the fan speed & control should all go through SMI interface, the only known approach is the
thinkpad-acpi
one. If you laptop have some kind of dust clean mode in Windows, there could be some workaround.- Maybe just hide the menu bar icon?
I like the menu bar icon. Maybe the idea could be to hide the fan-control slider if there is a fan reading problem (and hide also the fan reading problem message on login). For the moment I'll hide the icon. Anyway I have never been able to control / run the fans on linux. I'll try with some software on windows and if it doesn't work it's surely an hardware/bios problem. Maybe I will report to Lenovo.
- They should be able to control all the LEDs. Maybe yours is also an exception.
I don't know how my LED work except for micmute led. If the method _SB.PCI0.LPCB.H_EC.HKEY.MMTS
is called with 0x02 arg it should light up. Anyway at the moment unfortunately that panel for me doesn't work at all. I don't know if others have the same problem
Thanks for the fast reply!
EDIT: I'm also offering for an Italian translation of the app. If you were planning to give the possibility to create language files I could help for Italian
Dust clean mode is usually provided with OEM software, i.e. Vantage.
i18n is also scheduled for next release. I have started separating those strings, but got busier recently.
No dust clean mode on vantage for this laptop. Speed Fan doesn't recognize any fan controller but only the temperature. I will report to Lenovo, but maybe SMI interface isn't available on this laptop.
Ok, let me know if I can help. Thanks for your work.
EDIT: Sorry, should this kext make the brightness keys work? Because for me they won't, so I re-enabled the renames and the SSDT for the two methods
No dust clean mode on vantage for this laptop. Speed Fan doesn't recognize any fan controller but only the temperature. I will report to Lenovo, but maybe SMI interface isn't available on this laptop.
What's the temperature?
EDIT: Sorry, should this kext make the brightness keys work? Because for me they won't, so I re-enabled the renames and the SSDT for the two methods
You will need https://github.com/acidanthera/BrightnessKeys for that and check the readme.
I have just implemented i18n and yoga mode support. And in DSDT, there's no method called LED
and BEEP
under EC. Instead, your _SI.SST
calls SYSC
to set LED and system states, which its not documented. So your model might not support separate LED control and you can refer to CSSI
method in SSDT-THINK.dsl
to sync them during sleep / wake.
I have just implemented i18n and yoga mode support. And in DSDT, there's no method called
LED
andBEEP
under EC. Instead, your_SI.SST
callsSYSC
to set LED and system states, which its not documented. So your model might not support separate LED control and you can refer toCSSI
method inSSDT-THINK.dsl
to sync them during sleep / wake.
Okay, good to know. I'll eventually have to figure out how CSSI Method works. At the moment there seems to be no problem with the synchronization of the LEDs
Another question: at the moment SSDT-RCSM
doesn't seem documented. It has something to do with clamshell mode, right?
Anyway, the question is: I don't have aVPC0
device in my DSDT. Is it possible to use the SSDT somehow?
Thanks as always
Just rename it to HKEY
.
Okay, good to know. I'll eventually have to figure out how CSSI Method works. At the moment there seems to be no problem with the synchronization of the LEDs
I forgot to comment on this. CSSI
is actually a proxy method to _SI._SST
since it's not exposed to the driver. You don't need to modify that part.
Edit: by the way, you won't need that remap once https://github.com/acidanthera/VoodooPS2/pull/33 is merged.
Please try whether ca8ed08 works for you.
Please try whether ca8ed08 works for you.
It works, thanks.
In Big Sur adding prefpane files often doesn't work. Even if I allow the execution of the prefpane from the "Security and Privacy" menu, it often shows a message "Unable to open YogaSMCPane.prefpane ...". The only way to fix the problem is:
- Add the prefpane for all users;
- Execute from terminal
sudo xattr -d com.apple.quarantine /Library/PreferencePanes/YogaSMCPane.prefPane
- Prefpane correctly opens
It could be useful for other users
@zhen-zen only if you have time, I would propose to customize the behavior of the "Star" Hotkey (F12). On screen I see the message "Custom Hotkey" but it is not that custom
I suppose it's possible press alt + click the app / prefpane for quarantine.
Actually current customization is only limited to AppleScript (although it can do a lot of things). After quitting the app, you can change its name and the script to execute (default one is open prefpane).
I suppose it's possible press alt + click the app / prefpane for quarantine. For prefpane this doesn't seem to work. You can add the prefpane while pressing alt, but then when you try to open it from preferences it asks for permission. If you allow the execution from Security and Privacy it says "Unable to open" (11.0.1). Maybe I'm the only one but I found that command useful.
What should Autosleep do? It has something to do with keyboard backlight?
I would propose, if possible, to add an option to activate keyboard backlight when typing and deactivating it after a custom interval. In the old linux days I used this script: https://github.com/saibotd/tp-auto-kbbl and it worked very well I don't honestly know if macOS allows key logging
For prefpane this doesn't seem to work. You can add the prefpane while pressing alt, but then when you try to open it from preferences it asks for permission. If you allow the execution from Security and Privacy it says "Unable to open" (11.0.1). Maybe I'm the only one but I found that command useful.
Do you have SIP on?
What should Autosleep do? It has something to do with keyboard backlight?
It will turn off the keyboard backlight when entering sleep state. Or is that handled by firmware on Think variant?
I would propose, if possible, to add an option to activate keyboard backlight when typing and deactivating it after a custom interval. In the old linux days I used this script: https://github.com/saibotd/tp-auto-kbbl and it worked very well I don't honestly know if macOS allows key logging
There could be kind of native emulation with virtual HID device or something like https://www.logcg.com/en/archives/2902.html. You can still open a new issue for that but recently I don't plan to implemented new user space features.
Do you have SIP on?
Yes.
It will turn off the keyboard backlight when entering sleep state. Or is that handled by firmware on Think variant?
I did some tests: If I deselect that checkbox the keyboard backlight turns off on sleep, but doesn't turn on on wake. If I select that checkbox the keyboard backlight turns off on sleep and then turns on on wake. So it definitely does something useful
There could be kind of native emulation with virtual HID device or something like https://www.logcg.com/en/archives/2902.html. You can still open a new issue for that but recently I don't plan to implemented new user space features.
Don't worry, just an idea. :)
Can you try it with SIP off? I have com.apple.quarantine
at ~/Library/PreferencePanes/YogaSMCPane.prefPane
or /Library/PreferencePanes/YogaSMCPane.prefPane
and they both work.
Just enabled SIP and com.apple.quarantine
is blocking now. However, in Security & Privacy
, there's an Open Anyway
button. Not sure when did this restriction began. There used to be a one-time prompt with Ctrl (Command) + Click.

I'm still investigating if SIP would break other functionalities.
Just enabled SIP and
com.apple.quarantine
is blocking now. However, inSecurity & Privacy
, there's anOpen Anyway
button. Not sure when did this restriction began. There used to be a one-time prompt with Ctrl (Command) + Click.![]()
I'm still investigating if SIP would break other functionalities.
Apparently no problems.
However if you click that “Open Anyway” for me often it doesn’t work. After allowing to open the prefpane it says “unable to load the prefpane” or something similar. The only way to fix it is to add the prefpane and then, without going to security and privacy, executing the command
@zhen-zen i noticed a problem in ACPI, from logs I see this:
2020-11-23 13:56:37.595746+0100 0xcc Default 0x0 0 0 kernel: (AppleACPIPlatform) ACPI Warning: \_SB.AMW0.WQAA:
2020-11-23 13:56:37.595747+0100 0xcc Default 0x0 0 0 kernel: (AppleACPIPlatform) ACPI Warning: \_SB.AMW0.WQAA:
2020-11-23 13:56:37.595754+0100 0xcc Default 0x0 0 0 kernel: (AppleACPIPlatform) Insufficient arguments - Caller passed 0, method requires 1
2020-11-23 13:56:37.595755+0100 0xcc Default 0x0 0 0 kernel: (AppleACPIPlatform) Insufficient arguments - Caller passed 0, method requires 1
2020-11-23 13:56:37.595757+0100 0xcc Default 0x0 0 0 kernel: (AppleACPIPlatform) (20160930/nsarguments-333)
2020-11-23 13:56:37.595758+0100 0xcc Default 0x0 0 0 kernel: (AppleACPIPlatform) (20160930/nsarguments-333)
From my DSDT WQAA
is defined as:
Method (WQAA, 1, NotSerialized)
{
Return (B1ED) /* \_SB_.AMW0.B1ED */
}
So it requires an argument. I am not sure if it's the kext that calls it or something else. In my DSDT the method is never called, and in my IOReg YogaWMI is linked to AMW0.
The driver will try to parse available WMI description, which is not critical since it's just human readable entires. However, there's no indication which guid contains that information. So it will try to evaluate entries with instance_count 0x1 and flags 0x0, which is usually a large blob buffer so no argument are required. You can ignore this warning since required type shouldn't take an argument. Current approach will only try the first matched guid. I just opened #78 which would stop after found matching ones.
Tried the build, the ACPI error disappeared so I think that it worked 👍 Thanks
Unfortunately on my Thinkpad setting battery charge threshold doesn't seem to work. It's a minor problem because my battery seems to have a default threshold of 95% (for MacOS it doesn't charge over this limit). Maybe a SSDT for BAT is needed, I haven't found any info on the readme though. Let me know how I can provide additional info if you eventually want to investigate the issue
Please try if it works under linux. https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/laptops/thinkpad-acpi.rst
And that ACPI warning should still present. Can you try the last commit there?
And that ACPI warning should still present. Can you try the last commit there?
2020-11-27 21:28:54.667411+0100 0xc7 Default 0x0 0 0 kernel: (AppleACPIPlatform) ACPI Warning: \_SB.AMW0.WQAA:
2020-11-27 21:28:54.667412+0100 0xc7 Default 0x0 0 0 kernel: (AppleACPIPlatform) ACPI Warning: \_SB.AMW0.WQAA:
2020-11-27 21:28:54.667414+0100 0xc7 Default 0x0 0 0 kernel: (AppleACPIPlatform) Insufficient arguments - Caller passed 0, method requires 1
2020-11-27 21:28:54.667415+0100 0xc7 Default 0x0 0 0 kernel: (AppleACPIPlatform) Insufficient arguments - Caller passed 0, method requires 1
2020-11-27 21:28:54.667417+0100 0xc7 Default 0x0 0 0 kernel: (AppleACPIPlatform) (20160930/nsarguments-333)
2020-11-27 21:28:54.667418+0100 0xc7 Default 0x0 0 0 kernel: (AppleACPIPlatform) (20160930/nsarguments-333)
The problem is here again with https://github.com/zhen-zen/YogaSMC/actions/runs/386348029 . With https://github.com/zhen-zen/YogaSMC/actions/runs/379956818 it was disappeared.
In linux I can set the battery threshold with TLP Also in Windows it works With YogaSMC, if I set a threshold it disappears if I reopen the app (and it doesn't actually work if I plug the AC adaptor, it always charges until 95%)
The problem is here again with https://github.com/zhen-zen/YogaSMC/actions/runs/386348029 . With https://github.com/zhen-zen/YogaSMC/actions/runs/379956818 it was disappeared.
That's intended since it's not specified which method contains the information. And the previous commit breaks and actually it does nothing there.
In linux I can set the battery threshold with TLP Also in Windows it works With YogaSMC, if I set a threshold it disappears if I reopen the app (and it doesn't actually work if I plug the AC adaptor, it always charges until 95%)
Please attach a screenshot for ThinkVPC and expand those battery sections. According to the routine for linux driver, you need to specify the battery to set the limitation. The prefpane simplified that by skipping batteries with invalid range automatically.
You can set them manually according to https://github.com/zhen-zen/YogaSMC/projects/2.
Do you mean this?
Regarding specifying the battery, I can't understand what name/value to send with ioio. Sorry. If you could make an example, I could try.
ThinkVPC: Battery Wear control
Select battery first
ioio -s ThinkVPC Battery 0/1/2
(will trigger an update)
ioio -s ThinkVPC setCMstart 60
ioio -s ThinkVPC setCMstop 60
Can you try the pane in https://github.com/zhen-zen/YogaSMC/pull/81 again?
ThinkVPC: Battery Wear control Select battery first
ioio -s ThinkVPC Battery 0/1/2
(will trigger an update)ioio -s ThinkVPC setCMstart 60
ioio -s ThinkVPC setCMstop 60
Manually selecting the battery in this way works.
Can you try the pane in #81 again?
In fact it works also in this way, thanks!!!
These days I have done some testing. There are some problems, although not very important:
- if I select the threshold, close the prefpane and reopen it, I lose the previously saved value (the app shows me 100, but the value is still set correctly);
- for some strange reason if I select, for example, 75 as the threshold the battery stops charging at 77; if I select 80 it stops charging at 83; if I select 85 it stops charging at 89. The value does not match exactly what I set
- if I select the threshold, close the prefpane and reopen it, I lose the previously saved value (the app shows me 100, but the value is still set correctly);
Is the value in ioreg accurate?
- for some strange reason if I select, for example, 75 as the threshold the battery stops charging at 77; if I select 80 it stops charging at 83; if I select 85 it stops charging at 89. The value does not match exactly what I set
That's inevitable since the battery firmware will calculate the stop point on its own. And this process involves wear calculation. Is it accurate under Windows?
- if I select the threshold, close the prefpane and reopen it, I lose the previously saved value (the app shows me 100, but the value is still set correctly);
Is the value in ioreg accurate?
In IOReg I have:
and
or should I check something else? (I set 50% threshold in this case)
EDIT: moreover threshold isn't automatically set on startup
- for some strange reason if I select, for example, 75 as the threshold the battery stops charging at 77; if I select 80 it stops charging at 83; if I select 85 it stops charging at 89. The value does not match exactly what I set
That's inevitable since the battery firmware will calculate the stop point on its own. And this process involves wear calculation. Is it accurate under Windows?
Yes, it's not a big problem though. At least there's an explanation :)