Hi,There are some ways to do this. Which one is better will depend on what
you are doing.
- You can register a notification with a callback to be called when the
system is about suspend/resume and handle your devices there. Be aware
of the imposed constraints (IRQ lockeds). See:
void pm_notifier_register(struct pm_notifier *notifier)
int pm_notifier_unregister(struct pm_notifier *notifier)
- If you are implementing the hook to set the SoC state in
our application (implementing the method pm_power_state_set(struct
pm_state_info info)) you can suspend your devices there are resume them
in pm_power_state_exit_post_ops(struct pm_state_info info)
Note that in both cases, your application will be called after Zephyr
has handled all "know" devices.
There are other hacks that you can do, but these two (mainly the first)
are the best options IMHO.