Re: [PATCH v7 05/10] mfd: Add Apple Silicon System Management Controller
From: Sven Peter <sven@kernel.org>
Date: 2025-07-19 12:57:46
Also in:
asahi, linux-devicetree, linux-gpio, linux-pm, lkml
On 24.06.25 17:53, Lee Jones wrote:
On Sat, 21 Jun 2025, Sven Peter wrote:quoted
On 19.06.25 13:49, Lee Jones wrote:quoted
On Tue, 10 Jun 2025, Sven Peter wrote:quoted
The System Management Controller (SMC) on Apple Silicon machines is a piece of hardware that exposes various functionalities such as temperature sensors, voltage/power meters, shutdown/reboot handling, GPIOs and more. Communication happens via a shared mailbox using the RTKit protocol which is also used for other co-processors. The SMC protocol then allows reading and writing many different keys which implement the various features. The MFD core device handles this protocol and exposes it to the sub-devices. Some of the sub-devices are potentially also useful on pre-M1 Apple machines and support for SMCs on these machines can be added at a later time. Co-developed-by: Hector Martin <redacted> Signed-off-by: Hector Martin <redacted> Reviewed-by: Alyssa Rosenzweig <redacted> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Sven Peter <sven@kernel.org> --- MAINTAINERS | 2 + drivers/mfd/Kconfig | 18 ++ drivers/mfd/Makefile | 1 + drivers/mfd/macsmc.c | 498 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/macsmc.h | 279 +++++++++++++++++++++++++ 5 files changed, 798 insertions(+)This is ready. Let me know when you have all of the other driver/* Acks.They've all been reviewed by the respective maintainers. I assume you want to take this all through the mfd tree and we'll need acks from Sebastian for power/reset and either Linus or Bartosz for gpio then.That's right.
Can you maybe comment on https://lore.kernel.org/asahi/20250610-smc-6-15-v7-0-556cafd771d3@kernel.org/T/#m25fe0bd8fe5fa47ed63f4238da80d7186a65450c (local)? A sub device declared with MFD_CELL_OF("macsmc-reboot", NULL, NULL, 0, 0, "apple,smc-reboot") is picked up even if there's no corresponding node in the device tree. Is this expected behavior for mfd? There are some pre-M1 iDevices that also have a variant of SMC that doesn't have the reboot functionality. We can always special case it with a different compatible but just dropping the sub-node from the device tree would've been neat.
quoted
The one line change inside drivers/soc/apple would usually go through my tree and I'm fine with taking that through mfd instead.If there are no build-time dependencies on it, you can take it.
Okay, I've picked it up now.
I'm happy to take only the inter-dep ones or all (except the arch/ ones).
Sure, I'll take those as well once the dt-bindings are in. Thanks, Sven