#
#asahi-dev · 2025-09-25 20:02
svenif that were probed before acio init it would serror
#asahi-dev · 2025-09-25 20:02
svenyes
#asahi-dev · 2025-09-25 20:00
jannauwith a compatible that matches apple-dart?
#asahi-dev · 2025-09-25 19:59
sven*subnode
#asahi-dev · 2025-09-25 19:59
sveni e.g. have a dart as a subside of my tbt main node and that certainly doesn’t get probed automatically
#asahi-dev · 2025-09-25 19:58
svenI don’t think the core is supposed to probe sub node just because they have a match table
#asahi-dev · 2025-09-25 19:47
chadmedi will reintroduce it for v3
#asahi-dev · 2025-09-25 19:47
chadmedyeah i am remembering now
#asahi-dev · 2025-09-25 19:47
jannauchadmed: it's the reason why I added the __SMC_KEY macro in the downstream driver. I think gcc had this issue always
#asahi-dev · 2025-09-25 19:45
chadmedruicon_: unfortunately we cant really decouple hwmon from dt for the reasons mentioned without abusing dt compatibles and having a giant header file full of tables which is really gross
#asahi-dev · 2025-09-25 19:45
jannauI think if we add compatibles and of_match tables driver core could probe them as well
#asahi-dev · 2025-09-25 19:44
chadmedjannau: thats odd. i will see whats up with that
#asahi-dev · 2025-09-25 19:34
svenwe should set the data before calling mfd_add_devices
#asahi-dev · 2025-09-25 19:33
svenonly if we mess up I think
#asahi-dev · 2025-09-25 19:24
jannauI'm seing this https://paste.debian.net/1398135/ and saw essentially the same with smc-hid before
#asahi-dev · 2025-09-25 19:22
jannauis it possible that trhe sub drivers are probed before the smc driver set its driver data?
#asahi-dev · 2025-09-25 19:15
ketteniswell, some of the keys are universal, some of the keys depend on the firmware version, some of the keys are SoC-specific, some of the keys are machine-specific
#asahi-dev · 2025-09-25 19:14
svenwe can always check the SMC root node compatible which is soc-specific anyway
#asahi-dev · 2025-09-25 19:13
jannauthe keys aren't fully though but in the case of hwmon that's delegated directly into the DT
#asahi-dev · 2025-09-25 19:11
kettenisthat would make no sense; the smc interface is hardware-independent
#asahi-dev · 2025-09-25 18:56
jannaudo we need soc specific compatibles for the smc subnodes?
#asahi-dev · 2025-09-25 18:50
ruicon_so bascially check if has dt, if has use dt, if not use hardcoded table which i meationed above?
#asahi-dev · 2025-09-25 18:45
svenso if it shares code with x86 hwmon just branch off that and select a hardcoded table instead of parsing from the DT
#asahi-dev · 2025-09-25 18:45
svenbut I assume there’s a if(has dt node) check or something inside hwmon already
#asahi-dev · 2025-09-25 18:44
svenessentially yes, you need a mfd cell entry and it’s gonna probe the sub driver then no matter what
#asahi-dev · 2025-09-25 18:42
jannauaren't the sub driver probed via mfd cells?
#asahi-dev · 2025-09-25 18:42
jannauI think we need smc subnodes with their own compatibles on apple silicon
#asahi-dev · 2025-09-25 18:38
ruicon_so, do i write a new driver like macsmc-hwmon-x86?
#asahi-dev · 2025-09-25 18:32
svenpresumably the probe path is different on x86, so just use your hardcoded key table there
#asahi-dev · 2025-09-25 18:31
ruicon_so i can use compiler flags to differeniate x86 and arm, and use of on arm and hardcoding keys on x86?
#asahi-dev · 2025-09-25 18:28
jannauyes, but it's not clear/constant what the individual keys are. you can't (shouldn't) just expose all because at least on apple silicon there are keys either reporting constant 0 or bogus values
#asahi-dev · 2025-09-25 18:28
chaos_princessi guess you can hardcode it in driver for x86 macs and match on smbios
#asahi-dev · 2025-09-25 18:28
chaos_princessRight, but seeing "it is some temp sensor, which one? - you tell me", is not helpful
#asahi-dev · 2025-09-25 18:28
ruicon_changed*
#asahi-dev · 2025-09-25 18:26
ruicon_apple hasnt change this at all
#asahi-dev · 2025-09-25 18:26
ruicon_jannau: it wouldnt be too hard tbh, we already know fan keys and i already know that keys that start with 'I' are current keys, keys that start with 'P' are power keys, same for 'T' for temp and 'V' for voltage
#asahi-dev · 2025-09-25 18:23
jannauon apple silicon side DT is preferred because it means that we do not have to modify the driver when a new model arrives. just the DT which we have to add anyway
#asahi-dev · 2025-09-25 18:22
jannauplease reply now to the v2 hwmon driver patch that there is a use case for non-DT macsmc HW mon support
#asahi-dev · 2025-09-25 18:20
jannauI don't see how you can hardcode the keys as they differ per model / soc (on apple silicon side)
#asahi-dev · 2025-09-25 18:19
jannauno, that would not be ok
#asahi-dev · 2025-09-25 18:18
ruicon_uhm, would it be ok if i removed dt from macsmc-hwmon after it has been upstream (i am asking cuz i dont want to create 2 different dt entries for same thing, and if i just hardcoded the keys, it would be better)? if not can anyone please recommend any other meathod?
#asahi-dev · 2025-09-25 15:26
jannauchadmed: hwmom in that v2 doesn't compile for. gcc fails with "error: case label does not reduce to an integer constant" on 'case _SMC_KEY("flt ")'
#asahi-dev · 2025-09-25 15:21
ruiconthanks
#asahi-dev · 2025-09-25 15:21
ruiconhmm, ok fine
#asahi-dev · 2025-09-25 15:20
jannauthat's already in https://lore.kernel.org/asahi/20250827-macsmc-subdevs-v2-0-ce5e99d54c28@gmail.com/ so please do not send it again
#asahi-dev · 2025-09-25 15:20
svenprobably best to wait until that’s upstream and then send follow up patches
#asahi-dev · 2025-09-25 15:19
ruiconhwmon
#asahi-dev · 2025-09-25 15:18
jannauruicon: what code? note that chadmed is currently upstreaming more of our smc subdevices and has already sent 2 versions
#asahi-dev · 2025-09-25 15:18
jannauchadmed: ^^^ probably not online right now
#asahi-dev · 2025-09-25 15:16
ruiconIf you are James Calligeros, would you be okay with me using part of your code in my SMC implementation and upstreaming it, provided I give you proper credit?

plus ›