power: device: deduplicate suspending code

Function to put devices in lower power mode were all implemented in the
same way. Deduplicate code there by implementing single function to
handle all cases.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
Marcin Niestroj 2020-01-21 22:53:48 +01:00 committed by Anas Nashif
commit 21409494d1
2 changed files with 37 additions and 32 deletions

View file

@ -361,6 +361,13 @@ __syscall struct device *device_get_binding(const char *name);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
/**
* @brief Get name of device PM state
*
* @param state State id which name should be returned
*/
const char *device_pm_state_str(u32_t state);
/**
* @brief Indicate that the device is in the middle of a transaction
*