static int rtc_suspend_device(struct device *dev) { qm_rtc_save_context(QM_RTC_0, &rtc_ctx); rtc_qmsi_set_power_state(dev, DEVICE_PM_SUSPEND_STATE); return 0; }
void save_my_context(device_sleep_t dev) { /* * Each core saves its own UART. * STDOUT_UART is defined by the Makefile and should be different for * both cores. */ qm_uart_save_context(STDOUT_UART, &uart_ctx); /* * RTC is only used for the master which triggers the sleep. * Only restore the RTC for this core. */ if (dev == SOC_SLEEP) { qm_rtc_save_context(QM_RTC_0, &rtc_ctx); } /* * Each core saves its own interrupt context. The function call is the * same for both cores. */ qm_irq_save_context(&irq_ctx); }