#
✕ nick:Guest3839
#asahi-dev · 2026-10-25 06:54
Guest3839rtc, we use different keys, that exist on apple silicon too, but apple silicon dosent use them, so we need is_acpi, hwmon is very generic code (i think it can replace ur DT implementation, but i havent done that currently: https://github.com/t2linux/linux-t2-patches/blob/main/3013-hwmon-add-support-for-x86-macs-in-macsmc-hwmon.patch#L196)
#asahi-dev · 2026-10-25 06:50
Guest3839and its not like the battery sensor dont use quirks, it does use quirks for firmware afair
#asahi-dev · 2026-10-25 06:50
Guest3839the code in the platform device would get too big, and adding quirks everytime we want to add something or change something is not that great
#asahi-dev · 2026-10-25 06:48
Guest3839k will do
#asahi-dev · 2026-10-25 06:47
Guest3839chadmed: "you just said theyre all like that", yeah sorry i meant all battery keys are mixed
#asahi-dev · 2026-10-25 06:45
Guest3839hwmon is fine, rtc we need is_acpi
#asahi-dev · 2026-10-25 06:45
Guest3839wont that be a worse design than just adding quirks?, only the battery sensor is that messed up, every other driver is fine
#asahi-dev · 2026-10-25 06:42
Guest3839instead of nvram it uses CLKO
#asahi-dev · 2026-10-25 06:42
Guest3839rtc, also uses different keys
#asahi-dev · 2026-10-25 06:42
Guest3839whole thing
#asahi-dev · 2026-10-25 06:41
Guest3839standardised "read_u16" wont be able to fix the keys that use LE
#asahi-dev · 2026-10-25 06:41
Guest3839some use LE
#asahi-dev · 2026-10-25 06:41
Guest3839but the thing is not all keys use BE in battery
#asahi-dev · 2026-10-25 06:34
Guest3839as you can see here, we need to do that in macsmc-power, for that we need to know if the backend is acpi or rtkit
#asahi-dev · 2026-10-25 06:33
Guest3839we cant do all of that in the backend
#asahi-dev · 2026-10-25 06:33
Guest3839https://github.com/t2linux/linux-t2-patches/blob/7.3/3010-power-supply-add-support-for-x86-macs-in-macsmc-powe.patch#L309
#asahi-dev · 2026-10-25 06:32
Guest3839(power keys in intel macs uses BE instead of LE, so we need to use that, and also hwmon, we dont use dt)
#asahi-dev · 2026-10-25 06:32
Guest3839uhh so how am i supposed to implement difference between acpi and rtkit code
#asahi-dev · 2026-10-25 06:31
Guest3839we have tested on mbp16,1 mbp15,1 imac20,1 mbp12,1 and mba4,1
#asahi-dev · 2026-10-25 06:30
Guest3839and creates a new file macsmc-core.c
#asahi-dev · 2026-10-25 06:30
Guest3839shifts the asahi backend to soc/apple/
#asahi-dev · 2026-10-25 06:29
Guest3839chadmed: the code does that: https://github.com/t2linux/linux-t2-patches/blob/7.3/3001-treewide-add-backend-for-macsmc.patch
#asahi-dev · 2026-10-25 06:29
Guest3839JamesCalligeros[m]: ive seen the original smc implementation in ur linux github repo, this is inspired from that
#asahi-dev · 2026-10-25 06:28
Guest3839MichaelReeves[m]: so what are we supposed to do, as m-series and intel macs share a lot of keys (B0AP, B0AC, and a lot more, including the charge limit key used in new intel macs firmware), separate driver will mean duplicate code