Re: [PATCH] hwmon: (applesmc) Expose the SMC battery charge limit

From: Lukas Wunner

Date: Thu Sep 24 2026 - 04:02:49 EST


[+cc Jordan]

On Wed, Sep 23, 2026 at 04:41:17PM +0200, Michal Szpakowski wrote:
> Intel Macs keep a battery charge limit inside the SMC, in the key BCLM
> (one byte, percent). The SMC enforces it on its own: charging stops at
> the limit and the value survives reboots and operating systems, so the
> only thing an OS has to do is write it. On macOS the tool "bclm" does
> that; on Linux there has been no way, because applesmc exposes keys
> read-only through key_at_index.
>
> Expose it as the standard charge_control_end_threshold property on the
> battery through a power supply extension, so UPower and the desktops
> that read that property pick it up without knowing anything about
> Apple. The battery of an Intel Mac is an ACPI Smart Battery handled by
> the sbs driver, which the ACPI battery hooks do not cover, so the
> supply is found by walking the registered supplies; should it register
> after applesmc, its first property-change notification attaches the
> extension. Nothing happens on machines whose SMC lacks the key. Writes
> are read back, because the SMC silently drops values it does not
> accept; 100 disables the cap.
>
> Tested on a MacBookPro13,1 (2016, 13", no Touch Bar): with the limit at
> 80 and the charger attached, charging ran at a steady 1.55 A and stopped
> at 79% of charge_full with status "Full" and current 0, and the limit
> read back 80 after a reboot.

Jordan Brough is working on similar patches, perhaps you two can
work together to make sure there's no breakage on either of your
laptops an no conflict between your patches:

https://lore.kernel.org/r/20260918175052.85461-1-jordan@xxxxxxxxxx

Thanks,

Lukas