mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-02 05:51:14 -04:00
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>
This commit is contained in:
@@ -851,6 +851,22 @@ int apple_rtkit_shutdown(struct apple_rtkit *rtk)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(apple_rtkit_shutdown);
|
||||
|
||||
int apple_rtkit_poweroff(struct apple_rtkit *rtk)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = apple_rtkit_set_ap_power_state(rtk, APPLE_RTKIT_PWR_STATE_OFF);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = apple_rtkit_set_iop_power_state(rtk, APPLE_RTKIT_PWR_STATE_OFF);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return apple_rtkit_reinit(rtk);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(apple_rtkit_poweroff);
|
||||
|
||||
int apple_rtkit_idle(struct apple_rtkit *rtk)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -125,6 +125,13 @@ int apple_rtkit_wake(struct apple_rtkit *rtk);
|
||||
*/
|
||||
int apple_rtkit_shutdown(struct apple_rtkit *rtk);
|
||||
|
||||
/*
|
||||
* Put the co-processor into the lowest power state. Note that it usually
|
||||
* is not possible to recover from this state without a full SoC reset.
|
||||
*/
|
||||
|
||||
int apple_rtkit_poweroff(struct apple_rtkit *rtk);
|
||||
|
||||
/*
|
||||
* Put the co-processor into idle mode
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user