Commit 7d65ee4
power: supply: macsmc_power: Driver for Apple SMC power/battery stats
This driver implements support for battery stats on top of the macsmc
framework, to support Apple M1 Mac machines.
power: supply: macsmc_power: Add cycle count and health props
power: supply: macsmc_power: Add present prop
power: supply: macsmc_power: Add more props, rework others
power: supply: macsmc_power: Use BUIC instead of BRSC for charge
power: supply: macsmc_power: Turn off OBC flags if macOS left them on
power: supply: macsmc_power: Add AC power supply
power: supply: macsmc_power: Add critical level shutdown & misc events
power: supply: macsmc_power: Add CHWA charge thresholds
This is a hardcoded charge threshold feature present in firmware 13.0 or
newer. Userspace settings are rounded to one of the two possible
behaviors.
power: supply: macsmc_power: Report available charge_behaviours
The generic handling if charge_behaviours in the power_supply core
requires power_supply_desc.charge_behaviours to be set.
power: supply: macsmc_power: Add more properties
Report more voltages from the battery, and also fudge energy numbers
from charge numbers. This way userspace doesn't try to convert on its
own (and gets it very wrong).
power: supply: macsmc_power: Add CHLS charge thresholds
Since macOS Sequoia firmware, CHLS replaced CHWA and now allows an
arbitrary end charge threshold to be configured.
Prefer CHWA over CHLS since the SMC firmware from iBoot-10151.1.1
(macOS 14.0) is not compatible with our CHGLS usage. It was working
with the SMC firmware from iBoot-10151.121.1 (macOS 14.5).
power: supply: macsmc_power: Remove CSIL
Gone in Sequoia firmware.
power: supply: macsmc_power: Report not charging for CHLS thresholds
If a CHLS charge threshold is configured and the current SoC is above
the start threshold report a busy BMS as not charging.
power: supply: macsmc_power: Report only supported properties
The SMC firmware in macOS 15.4 dropped "AC-i" and "AC-n" (and all keys
with lower case last letter) without obvious replacement. Stop reporting
VOLTAGE_NOW / INPUT_CURRENT_LIMIT if "AC-n" is not present.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Co-developed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Co-developed-by: Janne Grunau <j@jannau.net>
Co-authored-by: Joey Gouly <joey.gouly@arm.com>
Signed-off-by: Hector Martin <marcan@marcan.st>1 parent 5182e1e commit 7d65ee4
4 files changed
Lines changed: 819 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1135 | 1142 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
0 commit comments