power: add read wakeup source function 08/286608/1 tizen_7.0
authorTaeminYeom <taemin.yeom@samsung.com>
Tue, 6 Dec 2022 06:53:42 +0000 (15:53 +0900)
committerTaemin Yeom <taemin.yeom@samsung.com>
Tue, 10 Jan 2023 11:09:49 +0000 (11:09 +0000)
commit097d2d3a987977da1cfd48de007d9eb34de3682c
tree00ab8aad22669163850ec8fcdd2ce289510642af
parent8e20038d67873402dd177e8d5f626dc5d7271d2a
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>
(cherry picked from commit a027bd191c2407f449de5db34cc9cd5962e3d591)
CMakeLists.txt
include/hal-backend-device-common-power.h [new file with mode: 0644]
src/power/power.c [new file with mode: 0644]