platform/hal/api/power.git
20 months agohalapi: power: Remove duplicate code 86/280386/3 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/7.0/unified/20221110.063448 accepted/tizen/7.0/unified/hotfix/20221116.110334 accepted/tizen/8.0/unified/20231005.094419 accepted/tizen/unified/20220830.032644 submit/tizen/20220829.110539 tizen_7.0_m2_release tizen_8.0_m2_release
Chanwoo Choi [Mon, 29 Aug 2022 07:19:51 +0000 (16:19 +0900)]
halapi: power: Remove duplicate code

Change-Id: I9fa73a2ae63cdd5d14dd6472b3a441a0b8f5530a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
20 months agohalapi: power: Check dvfs->get_avail_governor() properly 84/280084/1 accepted/tizen/unified/20220824.042337 submit/tizen/20220823.090238
Seung-Woo Kim [Tue, 23 Aug 2022 08:58:52 +0000 (17:58 +0900)]
halapi: power: Check dvfs->get_avail_governor() properly

Do null check properly for dvfs->get_avail_governor().

Change-Id: I70edddcf552ff677a25611c948ad9e8a2572025a
Fixes: 9f76c33751ba ("halapi: power: Add exec_func helper to simplify the function call")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
21 months agohalapi: power: Add new resources type for disk and network 45/278545/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20230303.115847 accepted/tizen/unified/20220801.131511 submit/tizen/20220726.004630 submit/tizen_6.5/20230303.025602
Chanwoo Choi [Fri, 22 Jul 2022 01:06:36 +0000 (10:06 +0900)]
halapi: power: Add new resources type for disk and network

Add missing resource type of display/system/process_group
and then add new resource type for block/network hardware resource.

Change-Id: Idebb762d28f8a4917a4357c7be48fbaf6d4c9eb4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agohalapi: power: Add exec_func helper to simplify the function call 53/277453/2 accepted/tizen/unified/20220715.141321 submit/tizen/20220714.022550 submit/tizen/20220715.015941
Chanwoo Choi [Wed, 15 Jun 2022 10:23:11 +0000 (19:23 +0900)]
halapi: power: Add exec_func helper to simplify the function call

hal-api-power functions checks the validation of function pointer
and then execute the initialized function pointer with proper argument.

Almost hal-api-power funcitons uses the same pattern style
to both check and execute the function pointer.

So that add exec_func_* helper functions to simplify
the same pattern and keep the consistent coding style.

Change-Id: I6c09fc027bdbc03977e4cecd9e6ae7f375560385
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
22 months agohalapi: power: Check whether fault_around_bytes input is valid or not 88/276388/4 accepted/tizen/unified/20220622.215414 submit/tizen/20220622.061549
Chanwoo Choi [Tue, 14 Jun 2022 10:19:41 +0000 (19:19 +0900)]
halapi: power: Check whether fault_around_bytes input is valid or not

The minimum of fault_around_bytes is 4096 bytes.
In orde to set the default faround_around_bytes,
must use the multiple value of 4096 bytes.

Change-Id: I8f0aa3fc0c7570e4e8fb9661c2dc5544df43eb72
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
22 months agohalapi: power: Remove duplicate code by adding isValidParam() function 87/276387/4
Chanwoo Choi [Wed, 15 Jun 2022 09:40:29 +0000 (18:40 +0900)]
halapi: power: Remove duplicate code by adding isValidParam() function

All hal-api-power funcitons should check the parameter validation.
Add new isValidParam() functions in order to remove the duplicate codes
and then in order to add easily new parameter validation rule.

Change-Id: I079fe095b1758a7aac0ecc8f52445d0d31c12b0f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
22 months agotest: unittest: Add hal-backend-power for hal-api-power 86/276386/3
Chanwoo Choi [Wed, 15 Jun 2022 08:05:26 +0000 (17:05 +0900)]
test: unittest: Add hal-backend-power for hal-api-power

In order to test the exported functions of hal-api-power,
require the power hal backend package. So that
add basic hal-backend-power backend and reimplement
hal_common_get_backend/hal_common_put_backend for hooking.

Change-Id: I14e8dfc02babb9672ac1b209081431870ff86a28
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
22 months agotest: unittest: hal-api-power-unittest when building package 85/276385/3
Chanwoo Choi [Tue, 14 Jun 2022 04:28:41 +0000 (13:28 +0900)]
test: unittest: hal-api-power-unittest when building package

Add new hal-api-power unittest code in order to
test the hal-api-power functions when building package.

Change-Id: Ide409a1a197971589fa364c1ed7ac0fe1673c2b0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2 years agohalapi: power: Add new PASS_RESOURCE_PROCESS_ID for indicating the process 01/270001/1 accepted/tizen/unified/20220125.121749 submit/tizen/20220124.062208
Chanwoo Choi [Mon, 24 Jan 2022 06:11:47 +0000 (15:11 +0900)]
halapi: power: Add new PASS_RESOURCE_PROCESS_ID for indicating the process

Change-Id: I42fbf6fb11b1e225638e87b83dfa014c462869fd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2 years agohalapi: power: fix a typo 68/265068/1
Sung-hun Kim [Fri, 8 Oct 2021 05:49:37 +0000 (14:49 +0900)]
halapi: power: fix a typo

Change-Id: I7e48c3feeb998e6b7598f5895ea39f9b96372c9d
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2 years agohal-api: power: Use usage_count to support multiple call accepted/tizen/6.5/unified/20211028.115016 accepted/tizen/unified/20210929.022354 submit/tizen/20210928.093203 submit/tizen_6.5/20211028.163201 tizen_6.5.m2_release
Chanwoo Choi [Tue, 28 Sep 2021 07:20:40 +0000 (16:20 +0900)]
hal-api: power: Use usage_count to support multiple call

The user of hal-api-power such as PASS daemon can execute
the hal_power_get_backend and hal_power_put_backend at multiple times.

Until now, hal-api-power doesn't support the multiple function call
of hal_power_get_backend/put_backend. It cause that return error value
when calling hal_power_put_backend from user of hal-api-power.

In order to fix this issue, use usage_count to put the hal backend
when usage_count is zero.

Change-Id: Idc1aef66e09e335cc158ace4c359673ff45792b8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2 years agohalapi: power: Add new battery HAL API to control charging status 49/262549/3 accepted/tizen/unified/20210816.122904 submit/tizen/20210813.100724
Chanwoo Choi [Fri, 13 Aug 2021 04:03:04 +0000 (13:03 +0900)]
halapi: power: Add new battery HAL API to control charging status

When over-temperature is meaused for h/w resource, must need to change
the state in order to down the temperature for preventing the dangerous
situation. So that add new battery HAL API for controlling the battery
status via power_supply subsystem in Linux kernel.

[Detailed new thermal HAL API]
/* Get and set the batterh charging state */
int hal_power_battery_set_charging_state(unsigned int device_type, char *res_name, int state);
int hal_power_battery_get_charging_state(unsigned int device_type, char *res_name);

/* Get and set the battery charging current (unit: uA) */
int hal_power_battery_set_charging_current(unsigned int device_type, char *res_name, int charing_current_uA);
int hal_power_battery_get_charging_current(unsigned int device_type, char *res_name);

Change-Id: Ie627e3619fea1876c5a52dce503e0f322dfad837
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2 years agohalapi: power: Add support of thermal operation for PASS_RESOURCE_NONSTANDARD_ID 54/262154/3 accepted/tizen/unified/20210809.061405 submit/tizen/20210809.032652 submit/tizen/20210813.013856
Chanwoo Choi [Mon, 2 Aug 2021 05:15:57 +0000 (14:15 +0900)]
halapi: power: Add support of thermal operation for PASS_RESOURCE_NONSTANDARD_ID

The non-standard h/w resource doesn't depend on the any specific linux
kernel subsystem. But, any h/w resources are able to be affected from
temperature. So that add support of thermal operation
for PASS_RESOURCE_NONSTANDARD_ID to control the over-temperature
with the proper behaviors.

Change-Id: I1fb20b5ee10aa876a95fde899bdcfdd537c7633c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2 years agohalapi: power: Add new PASS_RESOURCE_BATTER_ID for battery h/w 53/262153/1
Chanwoo Choi [Mon, 2 Aug 2021 04:12:58 +0000 (13:12 +0900)]
halapi: power: Add new PASS_RESOURCE_BATTER_ID for battery h/w

The battery h/w resource is very important in order to prevent
the dangerous situation such as fire, skin burn and so on.

So that it must need to monitor the temperature of battery
and then if over-temperature is detected, need to change
the battery status like discharging for decreasing the temperture
until safe tempeature.

Change-Id: I52ee3a2ea0fbe4ffdc51a2ce1afdb8dddb8506d4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2 years agohalapi: power: Add new thermal HAL API for cooling device of thermal 52/262152/1
Chanwoo Choi [Mon, 2 Aug 2021 03:58:57 +0000 (12:58 +0900)]
halapi: power: Add new thermal HAL API for cooling device of thermal

When over-temperature is meaused for h/w resource, must need to change
the state in order to down the temperature for preventing the dangerous
situation. So that add new thermal HAL API for cooling device of thermal
to change the state of h/w resource such as discharging the battery,
decrease the maximum freuqency of CPU/GPU/BUS and so on.

[Detailed new thermal HAL API]
int hal_power_thermal_set_cooling_device_state(unsigned int device_type,
char *cooling_device_name, int state);
int hal_power_thermal_get_cooling_device_state(unsigned int device_type,
char *cooling_device_name);
int hal_power_thermal_get_cooling_device_max_state(unsigned int device_type,
char *cooling_device_name);

Change-Id: I7cde3f47e607f2f92c87e6874ddb291e3b7bb99e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: Replace fPIE gcc option with fPIC 81/257281/2 accepted/tizen/unified/20210427.085802 submit/tizen/20210426.101321
Chanwoo Choi [Thu, 22 Apr 2021 05:46:43 +0000 (14:46 +0900)]
halapi: Replace fPIE gcc option with fPIC

The fPIE option is for the executable binary.
It is not proper for shared library files.
So that correct the wrong use-case by using fPIC.

Change-Id: If5a12ac729fd280451cf90c8f8723ac9868c497b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: power: add hal-api-common dependency to pc 06/255906/1 accepted/tizen/unified/20210328.230643 submit/tizen/20210325.052307
Seung-Woo Kim [Thu, 25 Mar 2021 04:09:51 +0000 (13:09 +0900)]
halapi: power: add hal-api-common dependency to pc

To refer hal-api-common specific libs from hal-api-power linked
binary, add hal-api-common dependency to pc explictly.

Change-Id: Ie30d115c0191a5406e38e95a0e7b9453ee14668a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agohalapi: power: Check g_power_funcs is initialized always 63/252563/1 accepted/tizen/unified/20210204.134457 submit/tizen/20210201.020414 submit/tizen/20210204.032624
Seung-Woo Kim [Fri, 29 Jan 2021 09:09:32 +0000 (18:09 +0900)]
halapi: power: Check g_power_funcs is initialized always

Check g_power_funcs initialized always.

Change-Id: I4141eeaa4181187516b7ab569db9ea0a46a70ccd
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agopackaging: Remove redundant separator and remove duplicate defintion 63/251863/1
Chanwoo Choi [Wed, 20 Jan 2021 04:49:51 +0000 (13:49 +0900)]
packaging: Remove redundant separator and remove duplicate defintion

The spec file has passed the redundant separator ('/') with %{_libdir}.
It is not needed. So that remove it. Also, remove the duplicate
definition in CMakeLists.txt.

Change-Id: I96730c061e1c859cd9a7892016c1ca1a18b3913a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: power: Add hal-api-power package for Power HAL API 45/251345/4 accepted/tizen/unified/20210115.004615 submit/tizen/20210114.085609
Chanwoo Choi [Tue, 5 Jan 2021 06:36:14 +0000 (15:36 +0900)]
halapi: power: Add hal-api-power package for Power HAL API

Power HAL API (hal-api-power) provides the HAL C API for Tizen internal user such as
library and daemon. Also, it provides HAL interface for Tizen device
developer in order to port Tizen to new h/w devices.

hal-api-power supports the control of CPU, Memory Bus, GPU and Memory
h/w resources for boosting the performance and for limiting the
power-consumption. hal-api-power makes the following two packages:

[Packages provided by hal-api-power git]
1. hal-api-power-*.rpm
- /usr/lib/hal/libhal-api-power.so if armv7l
- /usr/lib64/hal/libhal-api-power.so if aarch64

2. hal-api-power-devel-*.rpm
- /usr/include/hal/hal-power.h
- /usr/include/hal/hal-power-interface.h

Change-Id: I3989416368bc8aaf910696596daa6eaddeb22e92
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoInitial empty repository master
Tizen Infrastructure [Fri, 18 Dec 2020 00:44:27 +0000 (00:44 +0000)]
Initial empty repository