power: add read wakeup source function 01/285101/7 tizen
authorTaeminYeom <taemin.yeom@samsung.com>
Tue, 6 Dec 2022 06:53:42 +0000 (15:53 +0900)
committerTaeminYeom <taemin.yeom@samsung.com>
Tue, 10 Jan 2023 10:59:32 +0000 (19:59 +0900)
commita027bd191c2407f449de5db34cc9cd5962e3d591
tree00ab8aad22669163850ec8fcdd2ce289510642af
parent2b1bd811c34ffc5bdef9baeabc48b778e55dfcfe
power: add read wakeup source function

wakeup source: the information of "/sys/kernel/debug/wakeup_sources" node
wakeup reason: defined TIZEN Enum and able to be get by wakeup source

To add getter wakeup reason in device API, it is needed to read kernel
node (/sys/kernel/debug/wakeup_sources)

This node is including information of wakeup, so it is possible to get
the source of wakeup by compare the value of "wakeup_count" value.

Detailed function description
- hal_backend_device_common_read_wakeup_sources (char ***wakeup_source_name, int *wakeup_source_number):
   wakeup_source_name : get the name of wakeup sources with string array.
     each string and wakeup_source_name should be freed after using.
     caller declare a char ** variable and use the pointer of it.
   wakeup_source_number : the number of wakeup sources.
     caller delcare a int vairable and use the pointer of it.
  Exported and can be called by other HAL backend.

Change-Id: I605a5d539addb2cef7684f8e57f4ab3b5d9c65d4
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
CMakeLists.txt
include/hal-backend-device-common-power.h [new file with mode: 0644]
src/power/power.c [new file with mode: 0644]