Coder Social home page Coder Social logo

yogasmc's Introduction

YogaSMC CI Join the chat at https://gitter.im/YogaSMC/community

This driver consists of YogaSMC, YogaWMI and YogaVPC.

Each component can be derived for different targets. Currently ThinkPad and IdeaPad series (all other consumer brands) are supported. Support for generic Intel HID event & 5 button array is experimental.

Command to driver can be sent with ioio, e.g. ioio -s IdeaVPC ConservationMode true.

The driver will update the status in ioreg, while details are available in system log, e.g. log stream --predicate 'senderImagePath contains "YogaSMC"'.

Companion userspace apps, YogaSMCPane and YogaSMCNC are also available with GUI configuration and notification service.

YogaSMC

Allow syncing SMC keys like sensors reading and battery conservation mode.

Based on acidanthera/VirtualSMC

Customized sensor reading

The EC field name for corresponding SMC key is read from Info.plist. If there's no FieldUnit object at desired offset, you can add an OperationRegion like SSDT-THINK.dsl in SSDTSample.

Fan control (WIP)

YogaWMI

Support for parsing WMI devices and properties. On some devices, it could act as YogaVPC with access to extensive device control method.

(For Thunderbolt WMI interface, see al3xtjames/ThunderboltPkg instead.)

Based on the-darkvoid/macOS-IOElectrify (Dolnor/IOWMIFamily) and bmfparser (pali/bmfdec)

IdeaWMI

Currently available functions:

  • WMIY Yoga Mode detection and disabling keyboard/touchpad when flipped
  • WBAT Extra battery information (requires patching related methods like battery ones)
  • WMI2 Fn+esc (obsolete paper looking function), currently assigned to Fn mode toggle.

ThinkWMI (WIP)

Based on lenovo/thinklmi (iksaif/thinkpad-wmi)

YogaVPC

Intercepting events on vendor-specific Virtual Power Controller (VPC) devices and sync states, some instructions are on project boards.

Currently available functions:

  • EC reading
  • DYTC setting (available for idea/think, might need appropriate OS version for XOSI)
  • Automatic backlight and LED control
  • Clamshell mode (need additional patch on _LID like SSDT-RCSM.dsl in SSDTSample)
Variant IdeaVPC ThinkVPC YogaHIDD
_HID VPC2004 LEN0268
LEN0068
INT33D5
INTC1051
Reference ideapad-laptop thinkpad_acpi intel-hid
Hotkey polling
Conservation mode N/A
Battery threshold Not supported N/A
Charging control Need testing Need testing N/A
DYTC N/A
Fan reading Need testing N/A
Fan control Need testing N/A
Fn lock mode Native N/A
LED control Not supported N/A
Keyboard backlight N/A

EC reading:

When Rehabman's battery patching method RE1B RECB present (or SSDT-ECRW.dsl in SSDTSample), desired EC fields can be read using following commands:

  • One byte at specific offset: ioio -s YogaVPC ReadECOffset 0xA4 for field at offset 0xA4
  • Bulk reading: ioio -s YogaVPC ReadECOffset 0x1006 for 0x10 bytes at offset 0x06 (add total bytes to read before offset)
  • Dump whole EC area: ioio -s YogaVPC ReadECOffset 0x10000
  • Known EC field name: ioio -s YogaVPC ReadECName B1CY (no larger than 1 byte due to OS constraint)

YogaSMCPane

The preference pane provides a graphical user interface for basic information and settings, such as battery conservation mode and backlight.

YogaSMCNC

The notification application receives EC events and displays them on OSD. Corresonding actions will also be triggered for function keys. The configuration can be customized at ~/Library/Preferences/org.zhen.YogaSMC.plist after closing the app.

Only a few models support dual fan reading and control, which could be enabled manually via debug prefpane or SecondThinkFan in preference plist.

For unknown events in preset, feel free to submit a PR like #40.

If you want to add new actions, the easiest approach is to use the script action and fill the AppleScript in option field. be295da is a good example to add it as a built-in action, which may be replaced with native one later.

Installation

The kext should work out-of-the-box. If you have modified _QXX methods before, please remove the patches.

Some features may rely on methods accessing EC. Although it won't affect the core functionality, please consider patching related EC fields larger than 8-bit.

The YogaSMCAlter.kext is a variant without SMC keys support and the dependencies of Lilu and VirtualSMC. It's designed for quick loading / unloading without reboot when debugging.

Building

  1. Copy latest debug version of Lilu.kext and VirtualSMC.kext into the folder
  2. git clone --depth 1 https://github.com/acidanthera/MacKernelSDK
  3. In Xcode, Select build target on upper left and click the button on the left

Credits

yogasmc's People

Contributors

zhen-zen avatar junaedahmed avatar benbender avatar 1revenger1 avatar usr-sse2 avatar sniki avatar gitter-badger avatar antoniomcr96 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.