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