power: add callback for tracking power lock state 64/287864/1
authorYunhee Seo <yuni.seo@samsung.com>
Tue, 31 Jan 2023 07:38:27 +0000 (16:38 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Tue, 7 Feb 2023 07:31:02 +0000 (16:31 +0900)
commitdb6592589ec05f1e77204f7e23b515014b913b3b
tree4f4a7efad4665fae954d0b79f558d707b324cd20
parent50f23af397925499c2df31863a175d3eeb319d38
power: add callback for tracking power lock state

Add functions to tracking power lock state.
In this context, power lock state is meaning of "locked or unlocked"
about specific power lock type.
When the registered(specific) power lock is changed,
callback function will be called.

To inform power lock status, this enum type will be used.
typedef enum {
DEVICE_POWER_LOCK_STATE_UNLOCK, /**< Power lock is unlocked */
DEVICE_POWER_LOCK_STATE_LOCK, /**< Power lock is locked */
} device_power_lock_state_e;

These are function prototype to be added.
typedef void (*device_power_lock_state_change_callback) (power_lock_e power_lock_type,
device_power_lock_state_e power_lock_state, void *user_data);
-> This callback will be called when the registered power_lock_type lock is changed.

int device_power_get_lock_state(power_lock_e power_lock_type,
device_power_lock_state_e *power_lock_state);
-> This function gets the status(locked or unlocked) of power_lock_type

int device_power_add_lock_state_change_callback(power_lock_e power_lock_type,
device_power_lock_state_change_callback power_lock_state_change_callback,
void *user_data);
-> This function register callback with parameter power_lock_type.

int device_power_remove_lock_state_change_callback(power_lock_e power_lock_type);
-> This function remove registered callback with parameter power_lock_type.

Change-Id: I1e2449dfdf4a27caa03d0c8a6000606ef90b31f8
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
include/power-internal.h
src/power-internal.c