Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

soc: apple: rtkit: Add function to poweroff

Add a function to put a co-processor into the lowest possible power
state from which recovery usually isn't possible without a full SoC
reset. This is required for the USB4/Thunderbolt co-processors which
can be restarted since the entire USB4 root complex can be completely
reset independently of the rest of the SoC.

Reviewed-by: Janne Grunau <j@jannau.net>
Link: https://patch.msgid.link/20260117-apple-rtkit-poweroff-v2-1-b882a180e44d@kernel.org
Signed-off-by: Sven Peter <sven@kernel.org>

+23
+16
drivers/soc/apple/rtkit.c
··· 851 851 } 852 852 EXPORT_SYMBOL_GPL(apple_rtkit_shutdown); 853 853 854 + int apple_rtkit_poweroff(struct apple_rtkit *rtk) 855 + { 856 + int ret; 857 + 858 + ret = apple_rtkit_set_ap_power_state(rtk, APPLE_RTKIT_PWR_STATE_OFF); 859 + if (ret) 860 + return ret; 861 + 862 + ret = apple_rtkit_set_iop_power_state(rtk, APPLE_RTKIT_PWR_STATE_OFF); 863 + if (ret) 864 + return ret; 865 + 866 + return apple_rtkit_reinit(rtk); 867 + } 868 + EXPORT_SYMBOL_GPL(apple_rtkit_poweroff); 869 + 854 870 int apple_rtkit_idle(struct apple_rtkit *rtk) 855 871 { 856 872 int ret;
+7
include/linux/soc/apple/rtkit.h
··· 126 126 int apple_rtkit_shutdown(struct apple_rtkit *rtk); 127 127 128 128 /* 129 + * Put the co-processor into the lowest power state. Note that it usually 130 + * is not possible to recover from this state without a full SoC reset. 131 + */ 132 + 133 + int apple_rtkit_poweroff(struct apple_rtkit *rtk); 134 + 135 + /* 129 136 * Put the co-processor into idle mode 130 137 */ 131 138 int apple_rtkit_idle(struct apple_rtkit *rtk);