Skip to content

Commit b04d336

Browse files
committed
Merge tag 'apple-soc-drivers-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/sven/linux into soc/drivers
Apple SoC driver updates for 6.20 - Add a poweroff function to the RTKit library which will be required for the first USB4/Thunderbolt series I hope to submit next cycle. * tag 'apple-soc-drivers-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/sven/linux: soc: apple: rtkit: Add function to poweroff Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 733f030 + ba99035 commit b04d336

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

drivers/soc/apple/rtkit.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,22 @@ int apple_rtkit_shutdown(struct apple_rtkit *rtk)
851851
}
852852
EXPORT_SYMBOL_GPL(apple_rtkit_shutdown);
853853

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+
854870
int apple_rtkit_idle(struct apple_rtkit *rtk)
855871
{
856872
int ret;

include/linux/soc/apple/rtkit.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ int apple_rtkit_wake(struct apple_rtkit *rtk);
125125
*/
126126
int apple_rtkit_shutdown(struct apple_rtkit *rtk);
127127

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+
128135
/*
129136
* Put the co-processor into idle mode
130137
*/

0 commit comments

Comments
 (0)