Another important driver component for Apple Silicon devices in the open source community has been officially submitted for review: the Apple SMC power driver (macsmc-power). Its goal is to completely expose the MacBook's battery level, power consumption, and power adapter status to the Linux user space, making Apple notebooks running Linux a critical step in power management and battery monitoring.

image.webp

The driver was patched by Michael Reeves and has a code size of nearly 900 lines. It targets Apple's System Management Controller (SMC) and is used to report the charging status, battery status and related power indicators of the AC power adapter in the Linux kernel. The new driver is based on the existing out-of-tree driver code in the Asahi Linux kernel tree. It has since been refactored to meet the mainline integration requirements, and has improved compatibility with new versions of Apple SMC firmware, battery-less devices and other scenarios.

At the configuration level, the new driver is enabled through the new MACSMC_POWER Kconfig option. With Apple SMC, the upper layer can read key information such as battery capacity, voltage, current, and charging status. These data are provided externally through Linux's existing power supply framework, so they can be directly recognized and utilized by current mainstream Linux user space power tools without special adaptation.

The arrival of this feature is particularly important for users who want to evaluate the difference in battery power consumption between Apple Silicon MacBook and Intel Core, AMD Ryzen and other notebooks under Linux. It also provides reliable power monitoring capabilities for users who use Apple Silicon MacBook as their main Linux productivity device on a daily basis. At present, this driver is mainly targeted at Apple M1, M2, and M3 series hardware. It is expected that it will take a long time to get good support for new generation chips such as Apple M4 and M5 in the Linux ecosystem.

Interested developers and users can view the detailed implementation and review progress of this Apple SMC power driver through the mailing list patch set, waiting for it to eventually enter the mainline Linux kernel:

https://lore.kernel.org/linux-pm/[email protected]/