pm: state: improve formatting

- stick to 80 cols
- push macros '\' to 80 cols
- remove spaces from code examples
- add missing power-states node in example code

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-12-01 18:03:31 +01:00 committed by Anas Nashif
commit 5d5b2809b0

View file

@ -48,10 +48,10 @@ enum pm_state {
* @brief Suspend to idle state
*
* The system goes through a normal platform suspend where it puts
* all of the cores in deepest possible idle state and *may* puts peripherals
* into low-power states. No operating state is lost (ie. the cpu core
* does not lose execution context), so the system can go back to where
* it left off easily enough.
* all of the cores in deepest possible idle state and *may* puts
* peripherals into low-power states. No operating state is lost (ie.
* the cpu core does not lose execution context), so the system can go
* back to where it left off easily enough.
*
* @note This state is correlated with ACPI S1 state
*/
@ -85,10 +85,10 @@ enum pm_state {
*
* This state offers significant energy savings by powering off as much
* of the system as possible, including the memory. The contents of
* memory are written to disk or other non-volatile storage, and on resume
* it's read back into memory with the help of boot-strapping code,
* restores the system to the same point of execution where it went to
* suspend to disk.
* memory are written to disk or other non-volatile storage, and on
* resume it's read back into memory with the help of boot-strapping
* code, restores the system to the same point of execution where it
* went to suspend to disk.
*
* @note This state is correlated with ACPI S4 state
*/
@ -232,19 +232,19 @@ struct pm_state_info {
* };
*
* ...
* power-states {
* power-states {
* state0: state0 {
* compatible = "zephyr,power-state";
* power-state-name = "suspend-to-idle";
* min-residency-us = <10000>;
* exit-latency-us = <100>;
* exit-latency-us = <100>;
* };
*
* state1: state1 {
* compatible = "zephyr,power-state";
* power-state-name = "suspend-to-ram";
* min-residency-us = <50000>;
* exit-latency-us = <500>;
* exit-latency-us = <500>;
* };
* };
* @endcode
@ -252,17 +252,17 @@ struct pm_state_info {
* Example usage:
*
* @code{.c}
* const struct pm_state_info states[] =
* PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
* const struct pm_state_info states[] =
* PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
* @endcode
*
* @param node_id A node identifier with compatible zephyr,power-state
* @return an array of struct pm_state_info.
*/
#define PM_STATE_INFO_DT_ITEMS_LIST(node_id) { \
UTIL_LISTIFY(PM_STATE_DT_ITEMS_LEN(node_id), \
Z_PM_STATE_INFO_DT_ITEMS_LISTIFY_FUNC,\
node_id) \
#define PM_STATE_INFO_DT_ITEMS_LIST(node_id) \
{ \
UTIL_LISTIFY(PM_STATE_DT_ITEMS_LEN(node_id), \
Z_PM_STATE_INFO_DT_ITEMS_LISTIFY_FUNC, node_id) \
}
/**
@ -282,34 +282,36 @@ struct pm_state_info {
* };
*
* ...
* state0: state0 {
* compatible = "zephyr,power-state";
* power-state-name = "suspend-to-idle";
* min-residency-us = <10000>;
* exit-latency-us = <100>;
* };
* power-states {
* state0: state0 {
* compatible = "zephyr,power-state";
* power-state-name = "suspend-to-idle";
* min-residency-us = <10000>;
* exit-latency-us = <100>;
* };
*
* state1: state1 {
* compatible = "zephyr,power-state";
* power-state-name = "suspend-to-ram";
* min-residency-us = <50000>;
* exit-latency-us = <500>;
* state1: state1 {
* compatible = "zephyr,power-state";
* power-state-name = "suspend-to-ram";
* min-residency-us = <50000>;
* exit-latency-us = <500>;
* };
* };
* @endcode
*
* Example usage:
*
* @code{.c}
* const enum pm_state states[] = PM_STATE_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
* const enum pm_state states[] = PM_STATE_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
* @endcode
*
* @param node_id A node identifier with compatible zephyr,power-state
* @return an array of enum pm_state items.
*/
#define PM_STATE_DT_ITEMS_LIST(node_id) { \
UTIL_LISTIFY(PM_STATE_DT_ITEMS_LEN(node_id),\
Z_PM_STATE_DT_ITEMS_LISTIFY_FUNC,\
node_id) \
#define PM_STATE_DT_ITEMS_LIST(node_id) \
{ \
UTIL_LISTIFY(PM_STATE_DT_ITEMS_LEN(node_id), \
Z_PM_STATE_DT_ITEMS_LISTIFY_FUNC,node_id) \
}
/**