summaryrefslogtreecommitdiff
path: root/drivers/mfd/macsmc.c
AgeCommit message (Collapse)Author
2026-01-22mfd: macsmc: Initialize mutexJanne Grunau
Initialize struct apple_smc's mutex in apple_smc_probe(). Using the mutex uninitialized surprisingly resulted only in occasional NULL pointer dereferences in apple_smc_read() calls from the probe() functions of sub devices. Cc: stable@vger.kernel.org Fixes: e038d985c9823 ("mfd: Add Apple Silicon System Management Controller") Signed-off-by: Janne Grunau <j@jannau.net> Reviewed-by: Sven Peter <sven@kernel.org> Reviewed-by: Neal Gompa <neal@gompa.dev> Link: https://patch.msgid.link/20251231-macsmc-mutex_init-v2-1-5818c9dc9b29@jannau.net Signed-off-by: Lee Jones <lee@kernel.org>
2026-01-22mfd: macsmc: Wire up Apple SMC input subdeviceJames Calligeros
Add the new SMC input function to the mfd device Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Reviewed-by: Neal Gompa <neal@gompa.dev> Link: https://patch.msgid.link/20251215-macsmc-subdevs-v6-5-0518cb5f28ae@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2026-01-22mfd: macsmc: Wire up Apple SMC hwmon subdeviceJames Calligeros
Add the SMC hwmon functionality to the mfd device Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Reviewed-by: Neal Gompa <neal@gompa.dev> Link: https://patch.msgid.link/20251215-macsmc-subdevs-v6-3-0518cb5f28ae@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2026-01-22mfd: macsmc: Wire up Apple SMC RTC subdeviceJames Calligeros
Add the new SMC RTC function to the mfd device Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Reviewed-by: Neal Gompa <neal@gompa.dev> Link: https://patch.msgid.link/20251215-macsmc-subdevs-v6-2-0518cb5f28ae@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-11-06mfd: macsmc: Make SMC write buffers constAtharva Tiwari
Mark the write buffer arguments in apple_smc_write(), apple_smc_rw(), and apple_smc_write_atomic() as const. These functions do not modify the data provided by the caller, so the parameters should be const qualified. Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com> Reviewed-by: Sven Peter <sven@kernel.org> Signed-off-by: Lee Jones <lee@kernel.org>
2025-10-01mfd: macsmc: Add "apple,t8103-smc" compatibleJanne Grunau
After discussion with the devicetree maintainers we agreed to not extend lists with the generic compatible "apple,smc" anymore [1]. Use "apple,t8103-smc" as base compatible as it is the SoC the driver and bindings were written for. [1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/ Signed-off-by: Janne Grunau <j@jannau.net> Link: https://lore.kernel.org/r/20250828-dt-apple-t6020-v1-18-507ba4c4b98e@jannau.net Signed-off-by: Lee Jones <lee@kernel.org>
2025-10-01mfd: macsmc: Remove error prints for devm_add_action_or_reset()Waqar Hameed
When `devm_add_action_or_reset()` fails, it is due to a failed memory allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do anything when error is `-ENOMEM`. Therefore, remove the useless call to `dev_err_probe()` when `devm_add_action_or_reset()` fails, and just return the value instead. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Reviewed-by: Sven Peter <sven@kernel.org> Link: https://lore.kernel.org/r/pnd8qjym7td.a.out@axis.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-07-24mfd: Add Apple Silicon System Management ControllerSven Peter
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 <marcan@marcan.st> Signed-off-by: Hector Martin <marcan@marcan.st> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Sven Peter <sven@kernel.org> Link: https://lore.kernel.org/r/20250610-smc-6-15-v7-5-556cafd771d3@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>