power: Introduce resource-driver 34/296534/5
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 31 Jul 2023 10:31:29 +0000 (19:31 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 3 Aug 2023 01:17:46 +0000 (10:17 +0900)
commitaa06670d6caf5793446ad757b6440445f1ea763b
treec3538a5f708325b3bb44bbfaea6bf496017d971a
parent209e8d258f786e630672fb9b186b0420a94e32a6
power: Introduce resource-driver

The power module now operates on top of resource-driver.

 New attribute:
  - id: DEVICED_POWER_ATTR_SET_UINT64_4_CURRENT_STATE
  - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64_UINT64
  - setter: O
  - getter: X
  It trigger power transition to set current power state.
  Requires 4 parameter:
   1. FROM state
      Transition take place only from the 'FROM' state. If you
      don't mind whatever the 'FROM' state is, use
      DEVICED_POWER_STATE_ALL for the 'FROM' state.
   2. TO state
      Next state to transition
   3. triggering reason
   4. user_data

 New attribute:
  - id: DEVICED_POWER_ATTR_UINT64_CURRENT_STATE
  - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64
  - setter: X
  - getter: O
  It gets the current power state.

 New attribute:
  - id: DEVICED_POWER_ATTR_INT_WAKEUP_REASON
  - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
  - setter: X
  - getter: O
  It gets wakeup reason of the latest system wakeup.

 All enums and macros regarding power state have moved to libsyscommon,
syscommon-plugin-deviced-power-interface.h, so that those value can be
used by both the deviced core and plugin.

 To match type of user_data from resource-manager, fix the existing
'void *' to 'const void *'.

Change-Id: I58af2a74ce2313a07b676e1a884b4201751a882c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/power/power.c
src/power/power.h
src/power/resource-power.c [new file with mode: 0644]