power: refactor power change state wait API
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 8 Dec 2022 08:16:35 +0000 (17:16 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 16 Dec 2022 06:33:42 +0000 (15:33 +0900)
commit9c6eb233cbb531b5bff0ef283caf85775f093da8
tree88b056770a8ea76653deba1f5639a468000e5bfa
parentd74cfdb521220aad1e043ff80a9cd45019c29f10
power: refactor power change state wait API

Hide state index enumeration into source code
 - It has been changed to be defined by enumeration
   DEVICE_POWER_STATE_*.

Introduce enumeration for transition reason
 - power_transition_reason_e

Rearrange value of enumeration device_power_state_e
 and device_power_transient_state_e
 - Previously, those enumerations share bit not to overlap each other.
   This somehow implies those enumerations are related each other. To
   clarify that they have nothing to do with each other, rearranged bit.
 - From the above change, the APIs have changed to support exclusive
   register/unregister/callback subroutine by enumeration type.
    • device_power_add_state_wait_callback()
    • device_power_add_transient_state_wait_callback()
    • device_power_remove_state_wait_callback()
    • device_power_remove_transient_wait_callback()
 - Each callback has parameter of corresponding state enumeration type.
 - Callback now receives each information directly from parameter
   instead of struct device_change_state_info. The struct
   device_change_state_info has been removed.
 - Only the device_power_wait_done() has left unchanged in that it
   can be utilized by callback of both enumeration type.

Change-Id: I991994a3bb5e648db4aefde252c5bde1feeca86d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/power-internal.h
src/power-internal.c