Youngjae Cho [Thu, 10 Apr 2025 10:57:52 +0000 (19:57 +0900)]
Fix to support both ipc and passthrough transport
The platform can now specify both ipc and passthrough to platform
manifest. It gives chance for backend to choose one of it through
backend manifest. It is possible that a backend may not specify one.
If then, the first specified platform transport, the passthrough,
is be used as a default transport.
Change-Id: I5701969736bb0a4f94b5325ed7c2f6c2ea2e6543
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 8 Apr 2025 02:26:49 +0000 (11:26 +0900)]
device-battery: Fix IPC get_backend()/put_backend() to be consistent to other modules
To keep style consistent between IPC modules, fix the get_backend()
and put_backend() of device-battery to follow the other modules' style.
Change-Id: I1b539a4554ae48935ba638afd56de827496cf24f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 04:39:32 +0000 (13:39 +0900)]
device-external_connection: Add hal-backend-service-device-external-connection plugin
Added hal-backend-service-device-external-connection plugin that is
HAL IPC stub(server) for HAL_MODULE_DEVICE_EXTERNAL_CONNECTION.
Change-Id: I3557cc51c1c4c972e8b3ea3c2d065e26cac99b0b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 02:31:10 +0000 (11:31 +0900)]
device-external_connection: Support hal-api passthrough and IPC mode selectively by configuration
To support two way communication mode, added switch to selectively
take passthrough or ipc functions by transport. The transport is
determined by searching transport version from manifest file that
matches to the installed backend version.
Before
- Passthrough
- hal-api(external_connection) --(dlopen)--> hal-backend
After
- Passthrough and IPC
- hal-api(external_connection) --(dlopen)--> hal-backend
|
|(proxy)
|
|-----------(IPC)-----> hal-backend-serivce(stub) --> hal-backend
Change-Id: I1ebc62d656fb95f5841ee19e117789a79daa8052
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 02:08:12 +0000 (11:08 +0900)]
device-external_connection: Add hal-api IPC module using TIDL generated code
To support IPC mode, the ipc code has been added using tidl-generated
proxy code.
- Connect or disconnect to hal-backend-service
- Handle losing connsection to hal-backend-service
- Send request to hal-backend-service
Change-Id: I5f028a6c2051aa4a40fd244ef31df6aedd522a22
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 01:21:26 +0000 (10:21 +0900)]
device-external_connection: Add IPC module generated by TIDL
These are newly added files.
- include/hal_device_external_connection_ipc_1.tidl
: Define types and interfaces. Based on the tidl file, proxy and
stub code are generated.
- src/generated/hal_device_external_connection_proxy_1.h
- src/generated/hal_device_external_connection_proxy_1.c
: By using this code, client can be implemented. And it talks to
sever that has been implemented by the stub code below.
- src/generated/hal_device_external_connection_stub_1.h
- src/generated/hal_device_external_connection_stub_1.c
: By using this code. server can be implemented. And it can
handle request from a client that has been implemented by the
above proxy code.
Change-Id: I0d6043717d7c33c159872ae0e765f57b98a55b31
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 01:04:00 +0000 (10:04 +0900)]
device-external_connection: Add hal-api passthrough mode
It is necessary to switch passthrough/ipc by transport. Therefore,
added code for passthrough only.
Change-Id: I2a18d0eaa05fb2fead662b44664635dd8ec04029
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 27 Mar 2025 04:48:47 +0000 (13:48 +0900)]
Fix ambiguous expression of testing 'get_backend() != RPC_PORT_ERROR_NONE'
The statement below is evaluated as intended.
• if (ret = hal_device_battery_ipc_get_backend() != RPC_PORT_ERROR_NONE)
Technically, however, to get the evaluation process, it is essential to
know the operator precedence and associativity. To clearly express the
same meaning without knowing such things, fixed it like below.
• if (hal_device_battery_ipc_get_backend() != RPC_PORT_ERROR_NONE)
Change-Id: I51157a951ced399c4e3cbeea342d40cf7ed2209e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 06:55:41 +0000 (15:55 +0900)]
device-bezel: Add hal-backend-service-device-bezel plugin
Added hal-backend-service-device-bezel plugin that is HAL IPC stub
(server) for HAL_MODULE_DEVICE_BEZEL.
Change-Id: I72efa2e88240d7d17749fc7f3476e1ee4a7799e1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 03:56:38 +0000 (12:56 +0900)]
device-bezel: Support hal-api passthrough and IPC mode selectively by configuration
To support two way communication mode, added switch to selectively
take passthrough or ipc functions by transport. The transport is
determined by searching transport version from manifest file that
matches to the installed backend version.
Before
- Passthrough
- hal-api(bezel) --(dlopen)--> hal-backend
After
- Passthrough and IPC
- hal-api(bezel) --(dlopen)--> hal-backend
|
|(proxy)
|
|-----------(IPC)-----> hal-backend-serivce(stub) --> hal-backend
Change-Id: I3a70a7439067cc3a074fd24e6bb533a167b3ebc5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 03:48:32 +0000 (12:48 +0900)]
device-bezel: Add hal-api IPC module using TIDL generated code
To support IPC mode, the ipc code has been added using tidl-generated
proxy code.
- Connect or disconnect to hal-backend-service
- Handle losing connsection to hal-backend-service
- Send request to hal-backend-service
Change-Id: I4340f9b644b768cbb48b93bc48087956ff75fba9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 01:44:04 +0000 (10:44 +0900)]
device-bezel: Add IPC module generated by TIDL
To support hal-api IPC transport, tidl-generated code has been added.
By generating proxy/stub code in pair, it provides a way to communicate
between server and client in a predefined manner.
These are newly added files.
- include/hal_device_bezel_ipc_1.tidl
: Define types and interfaces. Based on the tidl file, proxy and
stub code are generated.
- src/generated/hal_device_bezel_proxy_1.h
- src/generated/hal_device_bezel_proxy_1.c
: By using this code, client can be implemented. And it talks to
sever that has been implemented by the stub code below.
- src/generated/hal_device_bezel_stub_1.h
- src/generated/hal_device_bezel_stub_1.c
: By using this code. server can be implemented. And it can
handle request from a client that has been implemented by the
above proxy code.
Change-Id: Ie63d504c77db21a7499a39518085656fe75008f9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 01:30:31 +0000 (10:30 +0900)]
device-bezel: Add hal-api passthrough module
It is necessary to switch passthrough/ipc by transport. Therefore,
added code for passthrough only.
Change-Id: Ic1d99ba6f93ff5230c31b74500a3f2e9818209c3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
SangYoun Kwak [Fri, 28 Mar 2025 07:23:32 +0000 (16:23 +0900)]
device-led: Fix typo in hal module enum for getting stub proc name
In the function that connects to the stub of device-led module for IPC,
it gets stub proc name before establishing connection.
There were some typos:
The enum of device-led is HAL_MODULE_DEVICE_LED but it was
HAL_MODULE_DEVICE_DISPLAY.
In the log message, it should be "device-led" but
"device-display".
Despite of this typo, the IPC had no error since the stub proc name of
device-display and device-led was same.
But this typo might cause serious error, it should be fixed.
Change-Id: If58e6a8c35aa8f181d7104b36491bc7e99fad99c
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Youngjae Cho [Wed, 26 Mar 2025 04:11:59 +0000 (13:11 +0900)]
Drop warning log for getting transport if hal-backend is not supported
The hal_common_get_transport() returns -ENOENT if it fails to load
backend library, for example, due to the library hasn't been installed
on the image. This might happen as a product image could not fully
supports all the hal backends and this could spam the log. Therefore,
do not print log in this case.
Change-Id: I93be7243999420e864b839ae1bc85f2cdbdc73d5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 04:27:09 +0000 (13:27 +0900)]
device-bezel: Fix incorrect parameter of vibration state getter/setter
Those getter/setter should have had parameter type of
hal_device_bezel_vib_state_e, but it had hal_device_bezel_state_e.
Fixed it to the correct type and also fixed related haltest accordingly.
Change-Id: I0fe531b273bba5a8641d91cbca0e9244b8969c87
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 01:50:06 +0000 (10:50 +0900)]
Fix macro LOG_TAG redefinition warning
Fixed it not to define again if the LOG_TAG macro has already been
defined. This might happen when the common.h was included after
the other header that had also defined the LOG_TAG.
/home/abuild/rpmbuild/BUILD/hal-api-device-1.0.0/include/common.h:21:13:
warning: "LOG_TAG" redefined
21 | #define LOG_TAG "HALAPI_DEVICE"
| ^~~~~~~
In file included from /usr/include/dlog/dlog.h:42,
from /home/abuild/rpmbuild/BUILD/hal-api-device-1.0.0
/hal-backend-service-plugin/led/hal-backend-service-device-led.c:22:
/usr/include/dlog/dlog-internal.h:41:9:
note: this is the location of the previous definition
41 | #define LOG_TAG NULL
| ^~~~~~~
Change-Id: I8939d03964417f3bbe58ff68648ed9448b51fa13
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Tue, 25 Mar 2025 01:33:58 +0000 (10:33 +0900)]
doc: Fix hal external-connection module defgroup name
In the HAL API reference page, group name has underbar character "_".
Thus, group name External_connection is changed to External Connection.
Change-Id: If49e4c99db8e4d1759f27a1b64d0ed0913f6bb20
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
SangYoun Kwak [Tue, 11 Mar 2025 11:04:22 +0000 (20:04 +0900)]
Change to get stub proc name from hal-api-common
Since the stub proc name can be vary, it should not be hard-coded but
comes from the stub.
To accomplish this, an api function from the hal-api-common is used:
hal_common_get_stub_proc_name().
This function returns stub proc name which created dynamically in the
build time.
Change-Id: I1f30edd5e005593354332c1674142da13bba1d49
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Youngjae Cho [Thu, 13 Mar 2025 10:18:50 +0000 (19:18 +0900)]
hal-api-device-manifest: Change battery transport type to ipc
In order to communicate IPC between hal-api and hal-bakend-device-battery,
changed device-battery type to ipc.
Change-Id: I7617a84b9f5cb53dc3185c582e4b05c9a60fe320
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 10 Mar 2025 09:12:51 +0000 (18:12 +0900)]
device-battery: Add hal-backend-service-device-battery plugin
Added hal-backend-service-device-battery plugin that is HAL IPC stub
(server) for HAL_MODULE_DEVICE_BATTERY.
Change-Id: Iaab8872858354de65cc6387b3c88b882675b3610
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 10 Mar 2025 08:11:45 +0000 (17:11 +0900)]
device-battery: Support hal-api passthrough and IPC mode selectively by configuration
To support two way communication mode, added switch to selectively
take passthrough or ipc functions by transport. The transport is
determined by searching transport version from manifest file that
matches to the installed backend version.
Before
- Passthrough
- hal-api(battery) --(dlopen)--> hal-backend
After
- Passthrough and IPC
- hal-api(battery) --(dlopen)--> hal-backend
|
|(proxy)
|
|-----------(IPC)-----> hal-backend-serivce(stub) --> hal-backend
Change-Id: I1646ab8e16ef56cf0b271816dcd7850b1e71d6d4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 10 Mar 2025 06:59:58 +0000 (15:59 +0900)]
device-battery: Add hal-api IPC module using generated IPC module by TIDL
To support IPC mode, the ipc code has been added using tidl-generated
proxy code.
- Connect or disconnect to hal-backend-service
- Handle losing connection to hal-backend-service
- Send request to hal-backend-service
Change-Id: Ibf08c21fd29041340b89b1b4a149b187898da8eb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 7 Mar 2025 06:37:00 +0000 (15:37 +0900)]
device-battery: Add IPC module generated by TIDL
To support hal-api IPC transport, tidl-generated code has been added.
By generating proxy/stub code in pair, it provides a way to communicate
between server and client in a predefined manner.
These are newly added files,
- include/hal_device_battery_ipc_1.tidl
: Define types and interfaces. Based on the tidl file, proxy and
stub code are generated.
- src/generated/hal_device_battery_proxy_1.h
- src/generated/hal_device_battery_proxy_1.c
: By using this code, one can implement client to talk to server
that has been implemented by the stub code below.
- src/generated/hal_device_battery_stub_1.h
- src/generated/hal_device_battery_stub_1.c
: By using this code, server can be implemented. And it can
handle request from a clinet that has been implemented by the
above proxy code.
Change-Id: I256b4e04c047ea8dc15df244914d1fc89a35a4bc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 7 Mar 2025 06:34:27 +0000 (15:34 +0900)]
device-battery: Add hal-api passthrough module
As hal-api module supporting ipc communication, it is required
to distinguish passthrough and ipc functions, so fix the existing
functions to have 'passthrough' in their name.
Change-Id: Ib83d4fe5154985fefb98fef373dbf57630b40aec
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Tue, 4 Mar 2025 11:00:14 +0000 (20:00 +0900)]
Get HAL transport from HAL manifest on library constructor
Get HAL transport from HAL manifest on library constructor dynamically
instead of constant build config setting.
- HAL manifest : /etc/hal/hal-api-device-manifest.xml
Change-Id: Idbed802737dc9c3d906de2828dc87967d207e195
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 27 Feb 2025 06:54:36 +0000 (15:54 +0900)]
hal-api-device-manifest: Change device-display/-led transport type to ipc
In order to communicate IPC between hal-api and hal-bakend-device-display
and hal-backend-device-led, change device-display/-led transport type to ipc.
Change-Id: I19372111ef4a9a6bbd089ea8419df6e46e6edb7d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Yunhee Seo [Thu, 27 Feb 2025 02:45:57 +0000 (11:45 +0900)]
device-led: Add hal-backend-service-device-led plugin
Add hal-backend-service-device-led plugin which is HAL IPC stub(server)
for HAL_MODULE_DEVICE_LED.
Change-Id: I35d7040cf5dd08fa1616e02f7b8ae32604047644
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 14 Feb 2025 06:59:31 +0000 (15:59 +0900)]
device-led: Support hal-api passthrough and IPC selectively by configuration
Now, two-way communication method from HAL is supported.
Please refer changed communication method.
Before
- Passthrough
- hal-api(led) --(dlopen)--> hal-backend
After
- Passthrough and IPC
- hal-api(led) --(dlopen)--> hal-backend
|
|(proxy)
|
|-------(IPC)-----> hal-backend-serivce(stub) --> hal-backend
With hal_transport configuration, transport method can be selected.
It defines IPC or passthrough communication way.
Therefore, the existing hal-api code should call either IPC or passthrough.
Change-Id: I4f40e8fe9c5f66e28dd5c0765779b6d55246bc4e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 07:05:57 +0000 (16:05 +0900)]
device-led: Add hal-api IPC module using generated IPC module by TIDL
To support IPC communication with hal-backend-service,
hal-api IPC module is newly added.
With generated codes from TIDL, below descriptions are added.
- proxy initialization for IPC communication
- handling IPC communication
- using generated proxy function call
Change-Id: I13844ecf6154ad1dc3fb0c1a891d8d74c1ae3524
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 06:23:45 +0000 (15:23 +0900)]
device-led: Add IPC module generated by TIDL
To support hal-api IPC communication, generated communication codes should be added.
proxy and stub generated IPC codes are located below src/generated/ path.
With this, hal-api can implement IPC communication method with hal-backend-service.
These are newly added files,
- include/hal_device_led_ipc_1.tidl
- tidl file is converted from hal-device-led-interface-1.h.
- src/generated/hal_device_led_proxy_1.h
- src/generated/hal_device_led_proxy_1.c
- These are generated from hal_device_led_ipc_1.tidl.
With the proxy implementation, hal-api led module can request to hal-backend-service.
- src/generated/hal_device_led_stub_1.h
- src/generated/hal_device_led_stub_1.c
- There are generated from hal_device_led_ipc_1.tidl.
To implement hal-backend-service, stub codes should be added.
In stub side, it will handle the hal-api led requests from proxy side.
Change-Id: I00096d9d45774f32769d90676f28084de72d5df5
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 06:15:53 +0000 (15:15 +0900)]
device-led: Add hal-api passthrough module
As hal-api module supporting ipc communcation,
hal-backend dlopen loading method should be devided.
The newly added code is same as the existing hal-api codes.
Change-Id: I5fec6e09cd04eae253ae21c15ca381838cca1842
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 06:14:34 +0000 (15:14 +0900)]
device-led: Add test code to haltest module
There was no device-led module test code.
To check HAL IPC and passthrough function call method,
test code is added before apply hal IPC module.
Change-Id: I0584d24c83ff41f6e754c2f7f7b063653be69dd6
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 18 Feb 2025 04:49:00 +0000 (13:49 +0900)]
device-display: Add hal-backend-service-device-display plugin
Add hal-backend-service-device-display plugin which is HAL IPC stub (server)
for HAL_MODULE_DEVICE_DISPLAY.
Change-Id: I77610cf34e9b2f2c789866c73ef3f7ac77910834
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 06:08:11 +0000 (15:08 +0900)]
device-display: Support hal-api passthrough and IPC selectively by configuration
To support two-way communication method from HAL,
hal_transport definition and implementation is added.
Please refer changed communication method.
Before
- Passthrough
- hal-api(display) --(dlopen)--> hal-backend
After
- Passthrough and IPC
- hal-api(display) --(dlopen)--> hal-backend
|
|(proxy)
|
|-----------(IPC)-----> hal-backend-serivce(stub) --> hal-backend
With hal_transport configuration, transport method can be selected.
It defines IPC or passthrough communication way.
Therefore, the existing hal-api code should call either IPC or passthrough.
Change-Id: I4a4e8450e8acd348bb1359f8a46c73c299df771a
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 05:22:35 +0000 (14:22 +0900)]
device-display: Add hal-api IPC module using generated IPC module by TIDL
To support IPC communication with hal-backend-service,
hal-api IPC module is newly added.
With generated codes from TIDL, below descriptions are added.
- proxy initialization for IPC communication
- handling IPC communication
- using generated proxy function call
Change-Id: I638d1b3881bb3929d65b5c09f777c255d0911e81
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 05:12:23 +0000 (14:12 +0900)]
device-display: Add IPC module generated by TIDL
To support hal-api IPC communication, generated communication codes should be added.
proxy and stub generated IPC codes are located below src/generated/ path.
With this, hal-api can implement IPC communication method with hal-backend-service.
These are newly added files,
- include/hal_device_display_ipc_1.tidl
- tidl file is converted from hal-device-display-interface-1.h.
- src/generated/hal_device_display_proxy_1.h
- src/generated/hal_device_display_proxy_1.c
- These are generated from hal_device_display_ipc_1.tidl.
With the proxy implementation, hal-api display module can request to hal-backend-service.
- src/generated/hal_device_display_stub_1.h
- src/generated/hal_device_display_stub_1.c
- There are generated from hal_device_display_ipc_1.tidl.
To implement hal-backend-service, stub codes should be added.
In stub side, it will handle the hal-api display requests from proxy side.
To avoid generated code analysis issue, exclude.txt is added.
Change-Id: I033221458efcaa63e5d0ee19066f205ba9ae4e5b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 04:32:43 +0000 (13:32 +0900)]
device-display: Add hal-api passthrough module
As hal-api module supporting ipc communcation,
hal-backend dlopen loading method should be devided.
The newly added code is same as the existing hal-api codes.
Change-Id: I76b436c8bb4489d8146914573a4ea06bded178e6
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Feb 2025 02:54:23 +0000 (11:54 +0900)]
Add to catch std::length_error in haltest main
RUN_ALL_TESTS() in haltest main,
it can cause std::length_error and handling code was omitted.
To fix this issue, catch statement is added.
Change-Id: I5187aef8cbe1962742abf4cd654d9e4b2a1a2c00
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Thu, 26 Dec 2024 10:28:52 +0000 (19:28 +0900)]
power: Add HAL_DEVICE_POWER_TRANSITION_REASON_POWER_LOCK
The reason is used when a power transition is triggered by power lock.
Change-Id: I4c7a5cb85ddb8ca7c2d9731dfef51f14956a881b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Fri, 29 Nov 2024 06:33:07 +0000 (15:33 +0900)]
Add detailed description for hal-api-device APIs
Before requests HAL ACR process, there were omitted standard description.
To keep ACR format, APIs and data structure descriptions are adeed.
This includes all submodule description of the hal-api-device.
Change-Id: I1c65561f2e025a2a8b2426989ea1e9a3420f8d57
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 5 Nov 2024 05:49:07 +0000 (14:49 +0900)]
doc: Add new documentation for reference generating
To support HAL API reference creating, the 'hal_device_doc.h' is added under
the 'doc' directory, which is also newly created.
Also, sub-module docs are added.
- hal_device_battery_doc.h
- hal_device_bezel_doc.h
- hal_device_board_doc.h
- hal_device_display_doc.h
- hal_device_external_connection_doc.h
- hal_device_haptic_doc.h
- hal_device_input_doc.h
- hal_device_ir_doc.h
- hal_device_led_doc.h
- hal_device_memory_doc.h
- hal_device_power_doc.h
- hal_device_thermal_doc.h
- hal_device_touchscreen_doc.h
Change-Id: I0fa9e208e3c130916ceb9d5563d45367004edabc
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 5 Dec 2024 05:03:56 +0000 (14:03 +0900)]
device-led: Remove unused hal_device_led_get_state()
Since it is added, it was not used in any related module.
Also, there is no implemented hal-backend.
Before apply HAL ACR process, this function is removed
because it had been unmanaged.
Change-Id: I763eda151a490c7221b72fa7f4f32488c478da3e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 25 Nov 2024 06:23:06 +0000 (15:23 +0900)]
board: Fix different type comparison issue
There was size_t and int type value comparison in for loop code.
Actually, the comparison size_t and int type is same as the
unsigned long and int comparison.
This comparsion can cause integer overflow and infinite for loop,
thus this is necessary.
Change-Id: I3f3479b0535779c104a3eb49a9485ad573e99132
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Mateusz Moscicki [Fri, 28 Jun 2024 09:48:20 +0000 (11:48 +0200)]
Add upgrade type feature
To allow to change the upgrade type to "offline" or "online", the api
functions are added.
Change-Id: I0123712e319b996a9e57b3b3d2ea060914dd7bf6
Youngjae Cho [Mon, 27 May 2024 02:28:52 +0000 (11:28 +0900)]
packagaing: Reset the result of hal-compatibility-checker
HALCC (HAL Compatibility Checker) checks and stores the compatibility
result of hal-backend package under /opt/etc/hal/ directory.
When installing/un-installing hal-api packages,
compatibility result between HAL manifest and hal-backend package should
be reset. So that reset the result of hal-compatibility-checker by
'usr/bin/hal-compatibility-checker --reset' command.
Change-Id: I531805ba0f985c842b3fd96ce03b9619d67ce6a1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 19 Jun 2024 02:55:38 +0000 (11:55 +0900)]
packaging: Rename to hal-api-device-manifest.xml and change the install dir
In order to keep the consistent directory path of hal,
change the install directory path and then rename to
hal-api-device-manifest.xml which indicates HAL manifest file.
[Changed install path and file name]
- /etc/hal-manifest/hal-api-device.xml -> /etc/hal/hal-api-device-manifest.xml
Change-Id: Id1dedff1fa37f3c67f5eeddbee52f5e98a8044c0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
SangYoun Kwak [Thu, 13 Jun 2024 07:00:05 +0000 (16:00 +0900)]
Modify upgrade state transition
The simplified upgrade state model is used, the transition rule should
be modified.
Change-Id: I63cfa6e41eadbf40a7e3cc139838a3dcfeed2c95
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Tue, 4 Jun 2024 10:57:11 +0000 (19:57 +0900)]
Add upgrade state feature
To clarify the state of upgrade process, "upgrade state" feature is
added.
To use hal backend functions for "upgrade state", corresponding function
structure and api functions are added.
Change-Id: I5251f888bef6c051a83376863f374340f8a5eeb3
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Chanwoo Choi [Thu, 23 May 2024 09:32:53 +0000 (18:32 +0900)]
include: Reduce duplicate header including of hal-device-[module]-types.h
In order to reduce duplicate header including of hal-device-[module]-types.h,
change the header hierarchy as following:
hal-devce-[module]-interface.h
|-- hal-devce-[module]-interface-1.h
|---- hal-devce-[module]-types.h.
Change-Id: I04b1ba320d65abbf627a69e976b213a43a3e0d93
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Tue, 21 May 2024 06:50:25 +0000 (15:50 +0900)]
hal-manifest: Add hal-manifest
Change-Id: Ia86a28c0fd9dae2e976130cd0e2d196016251d9d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Wed, 24 Apr 2024 07:14:03 +0000 (16:14 +0900)]
Remove NULL check for callback parameter
The void *data used as callback parameter,
it can be NULL depending on the callback function logic.
Thus, the checking of data parameter is unnecessary and should be removed
for proper operation.
To avoid confusion with the name of the callback parameter called "data",
it was changed from "data" to "user_data".
Change-Id: I92bf8bb7dda251df52c23d1b12a101d3ecb7137d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Wed, 24 Apr 2024 06:52:02 +0000 (15:52 +0900)]
device-external_connection: Change data struct variable name properly
In hal_device_external_connection_info_s structure,
the name used to distinguish specific device type with string name.
Since there is an enumeration that can distinguish device types,
change the name to an appropriate one.
"name" is changed to "device_type".
Change-Id: Id45547bb04c226d992c287797797f896b87285f1
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 23 Apr 2024 07:42:47 +0000 (16:42 +0900)]
device-external_connection: Add hal_device_external_connection_device_type_e to replace external connection type macros
External connection device type macros have a strong correlation.
And they can be grouped and there is no reason to exist
as an individual macro definition in terms of code maintenance.
Thus, hal_device_external_connection_device_type_e enum type is added.
To utilize above enum type properly,
converting functions are necessary.
With converting functions, enum can replace the use of existing macro string.
This functions is added.
- int hal_device_external_connection_get_device_name(hal_device_external_connection_device_type_e deivce_type, const char **device_name);
-> If hal_device_external_connection_device_type is not proper value, then this returns -EINVAL,
and device_name is filled with NULL.
If not, it will be return 0 and device_name is filled with proper device type name.
Also, converting const char* <-> hal_device_battery_power_source_type_e type
test case is added.
Change-Id: I3ababb0915c5340a3b6ca3c4751716077200282e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 23 Apr 2024 05:11:16 +0000 (14:11 +0900)]
device-battery: Add power source type and power source name getter
To utilize hal_device_battery_power_source_type_e enum type properly,
converting functions are necessary.
With converting getter, enum can replace the use of existing macro string.
These functions are added.
- void hal_device_battery_get_power_source_name(hal_device_battery_power_source_type_e power_source_type,
const char **power_source);
-> If power_souce or power_source_type argument is not proper, power_source is just filled with NULL,
and it will returns -EINVAL.
If not, power_source will be filled with proper power_source_type name with 0 return value.
- int hal_device_battery_get_power_source_type(char *power_source,
hal_device_battery_power_source_type_e *power_source_type);
-> If argument is not proper value, it will returns -EINVAL.
If not, it will returns 0 and power_source_type will be filled with proper type.
Also, converting const char* <-> hal_device_battery_power_source_type_e type
test case is added.
Change-Id: I47446d4857676c6fa23bee7c8d6fd6bf4e73ac6f
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 22 Apr 2024 11:26:57 +0000 (20:26 +0900)]
device-battery: Replace macro power source definitions to hal_device_battery_power_source_type_e
Power source type macros have a strong correlation.
And they can be grouped and there is no reason to exist
as an individual macro definition from a code maintenance point of view.
Thus macros are replaced by hal_device_battery_power_source_type_e enum type.
Change-Id: I59909b32986c2f2b087e56e7ee93a7d26c5bbf75
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 22 Apr 2024 07:17:25 +0000 (16:17 +0900)]
device-battery: Remove NULL check for callback parameter
The void *data used as callback parameter,
it can be NULL depending on the callback function logic.
Thus, the checking of data parameter is unnecessary and should be removed
for proper operation.
Change-Id: Id1074f059ddda843291ae1349956580a354b73fa
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 19 Apr 2024 01:57:20 +0000 (10:57 +0900)]
device-memory: Apply HAL ABI versioning rule
Change-Id: Ic1153389229de02ba00908e91f52802a93d6f7c4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 19 Apr 2024 01:26:37 +0000 (10:26 +0900)]
device-memory: Remove unnecessary hal_initialized flag
Before using hal api function, loading hal backend is essential.
Thus, before calling hal backend function, hal backend loading is always checked.
However hal_initialized flag is being used uncessarily in duplicate.
To avoid duplcated operation, hal_initialized flag is removed.
Change-Id: I3497904ff9cfb176b98db074237b064729dcdad6
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 19 Apr 2024 07:32:49 +0000 (16:32 +0900)]
device-touchscreen: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-touchscreen.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-touchscreen.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-touchscreen.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-touchscreen-types.h
-> Common data types like structures or enums used between the device-touchscreen
HAL-API and HAL-BACKEND
hal-device-touchscreen-interface-1.h
-> Declaration of functions to be implemented in the device-touchscreen HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-touchscreen-interface.h
-> Includes the hal-device-touchscreen-interface-[major].h files for each supported
major version.
hal-device-touchscreen.h
-> Declaration of the device-touchscreen HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
The module names that are not being used well have been modified to proper names.
"touchscreen" -> "device-touchscreen"
Change-Id: I4e48487b40524430e3a89726c6b6f54239b8b1f0
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 19 Apr 2024 06:28:00 +0000 (15:28 +0900)]
device-power: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-power.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-power.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-power.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-power-types.h
-> Common data types like structures or enums used between the device-power
HAL-API and HAL-BACKEND
hal-device-power-interface-1.h
-> Declaration of functions to be implemented in the device-power HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-power-interface.h
-> Includes the hal-device-power-interface-[major].h files for each supported
major version.
hal-device-power.h
-> Declaration of the device-power HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
Change-Id: Id65f850e9714e7174f7e2f74bc725d7c1f0ea7f0
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 18 Apr 2024 11:39:22 +0000 (20:39 +0900)]
device-led: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-led.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-led.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-led.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-led-types.h
-> Common data types like structures or enums used between the device-led
HAL-API and HAL-BACKEND
hal-device-led-interface-1.h
-> Declaration of functions to be implemented in the device-led HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-led-interface.h
-> Includes the hal-device-led-interface-[major].h files for each supported
major version.
hal-device-led.h
-> Declaration of the device-led HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
The module names that are not being used well have been modified to proper names.
"led" -> "device-led"
Change-Id: I6d5ffde13dbbaa72852765124716d15bcaf23094
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 19 Apr 2024 04:00:27 +0000 (13:00 +0900)]
device-thermal: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-thermal.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-thermal.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-thermal.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-thermal-types.h
-> Common data types like structures or enums used between the device-thermal
HAL-API and HAL-BACKEND
hal-device-thermal-interface-1.h
-> Declaration of functions to be implemented in the device-thermal HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-thermal-interface.h
-> Includes the hal-device-thermal-interface-[major].h files for each supported
major version.
hal-device-thermal.h
-> Declaration of the device-thermal HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
The module names that are not being used well have been modified to proper names.
"thermal" -> "device-thermal"
Change-Id: I1c8b25258edbfa32a539f681f50a9bd0b4d4f294
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 18 Apr 2024 10:40:54 +0000 (19:40 +0900)]
device-ir: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-ir.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-ir.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-ir.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-ir-types.h
-> Common data types like structures or enums used between the device-ir
HAL-API and HAL-BACKEND
hal-device-ir-interface-1.h
-> Declaration of functions to be implemented in the device-ir HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-ir-interface.h
-> Includes the hal-device-ir-interface-[major].h files for each supported
major version.
hal-device-ir.h
-> Declaration of the device-ir HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
The module names that are not being used well have been modified to proper names.
"ir" -> "device-ir"
Change-Id: I52ed91213210d314ede3cea4e997e112aa163515
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 18 Apr 2024 10:20:23 +0000 (19:20 +0900)]
device-input: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-input.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-external_connection.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-input.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-input-types.h
-> Common data types like structures or enums used between the device-input
HAL-API and HAL-BACKEND
hal-device-input-interface-1.h
-> Declaration of functions to be implemented in the device-input HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-input-interface.h
-> Includes the hal-device-input-interface-[major].h files for each supported
major version.
hal-device-input.h
-> Declaration of the device-input HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
Change-Id: I0255a683c22eeb89988c2c56fbeb122140043e1f
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 18 Apr 2024 08:49:18 +0000 (17:49 +0900)]
device-external_connection: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-external_connection.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-external_connection.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-external_connection.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-external_connection-types.h
-> Common data types like structures or enums used between the device-external_connection
HAL-API and HAL-BACKEND
hal-device-external_connection-interface-1.h
-> Declaration of functions to be implemented in the device-external_connection HAL-BACKEND(Major version
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(M
hal-device-external_connection-interface.h
-> Includes the hal-device-external_connection-interface-[major].h files for each supported
major version.
hal-device-external_connection.h
-> Declaration of the device-external_connection HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
The module names that are not being used well have been modified to proper names.
"external_connection" -> "device-external_connection"
Change-Id: I1be7041566576a1f86dc406c8431d8a9db3844ab
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 18 Apr 2024 05:45:44 +0000 (14:45 +0900)]
device-bezel: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-bezel.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-bezel.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-bezel.
Furthermore, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-bezel-types.h
-> Common data types like structures or enums used between the device-bezel
HAL-API and HAL-BACKEND
hal-device-bezel-interface-1.h
-> Declaration of functions to be implemented in the device-bezel HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-bezel-interface.h
-> Includes the hal-device-bezel-interface-[major].h files for each supported
major version.
hal-device-bezel.h
-> Declaration of the device-bezel HAL-API functions
As applying HAL ABI versioning, definitions are also chaged in Native API style.
Change-Id: Ibdb21a0e16ed6f7533ac4bcee28ac11cebc2f115
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 18 Apr 2024 02:58:42 +0000 (11:58 +0900)]
device-bezel: Fix incorrect module naming
Fix incorrect module name from "bezel" to "device-bezel".
struct
- hal_backend_bezel_funcs -> struct hal_backend_device_bezel_funcs
file
- hal-bezel.h -> hal-device-bezel.h
- hal-bezel-interface.h -> hal-device-bezel-interface.h
According to HAL API Prototype rule,
hal module funcs structure naming is same as below
- hal_backend_[module]_funcs.
Also, hal module header files naming is same as below.
- hal-[module].h
- hal-[module]-interface.h
However, the hal module name was being used incorrectly.
Actual hal module name is not "bezel" but "device-bezel".
Change-Id: I3da12abc7e9618ef12ddddc4567b3fcad38faf86
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 16 Apr 2024 10:48:24 +0000 (19:48 +0900)]
device-battery: Remove unused macro HAL_DEVICE_BATTERY_HARDWARE_DEVICE_ID
HAL_DEVICE_BATTERY_HARDWARE_DEVICE_ID is not used anymore in platform side.
It is removed from platform/core/system/deviced at patch
02c021113393b4db2c501133eedb2e2140e77576.
Currently, it is only used at hal-backend device-emulator.
There is no need to be exist hal-api-device-battery and it is removed.
Change-Id: I43fe95e00c395fc2d56842acc6c6ceb499f0231d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 16 Apr 2024 06:30:57 +0000 (15:30 +0900)]
device-battery: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-battery.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-battery.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-battery.
Change-Id: Ic1bdb9cacddb468bdd80b9c7af10024ba13d3077
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 08:10:26 +0000 (17:10 +0900)]
device-battery: Apply native API style
In hal-device-battery module,
definition and declarations are should be follow native API principles.
To follow native style, comment and data structure/function naming is changed like below descriptions.
1. Naming structure with suffix '_s'
2. Naming structure with prefix sub module
3. Naming callback function types with suffix '_cb'
4. Naming macro with prefix which clearly represents a module
Change-Id: I7c7c079ef1fd4689f131b76eaaecc43b44640e5e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 06:31:18 +0000 (15:31 +0900)]
device-battery: Separate device-battery header files
To apply HAL ABI Versioning, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-battery-types.h
-> Common data types like structures or enums used between the device-battery
HAL-API and HAL-BACKEND
hal-device-battery-interface-1.h
-> Declaration of functions to be implemented in the device-battery HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-battery-interface.h
-> Includes the hal-device-battery-interface-[major].h files for each supported
major version.
hal-device-battery.h
-> Declaration of the device-battery HAL-API functions
Change-Id: Ic2a07101cf70384b803e68f3088f9ea1db22a95b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 06:02:41 +0000 (15:02 +0900)]
device-battery: Fix incorrect module naming
Fix incorrect module name from "battery" to "device-battery".
struct
- hal_backend_battery_funcs -> struct hal_backend_device_battery_funcs
file
- hal-battery.h -> hal-device-battery.h
- hal-battery-interface.h -> hal-device-battery-interface.h
According to HAL API Prototype rule,
hal module funcs structure naming is same as below
- hal_backend_[module]_funcs.
Also, hal module header files naming is same as below.
- hal-[module].h
- hal-[module]-interface.h
However, the hal module name was being used incorrectly.
Actual hal module name is not "battery" but "device-battery".
Change-Id: I8e4b648b497b8aded8de390c45736434912aadf3
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 15 Apr 2024 07:59:05 +0000 (16:59 +0900)]
hal-api-device: Remove unnecessary hal_initialized flag
Before using hal api function, loading hal backend is essential.
Thus, before calling hal backend function, hal backend loading is always checked.
However hal_initialized flag is being used uncessarily in duplicate.
To avoid duplcated operation, hal_initialized flag is removed.
Change-Id: I64ff8e3f7405d12c8fe82038f96c96f21748cf8f
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 9 Apr 2024 02:22:46 +0000 (11:22 +0900)]
device-haptic: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-haptic.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-haptic.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-haptic.
Change-Id: I2386416788e4b1458bf8d95132a9ba630888ac41
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 9 Apr 2024 02:14:19 +0000 (11:14 +0900)]
device-haptic: Apply native API style
In hal-device-haptic module,
definition and declarations are should be follow native API principles.
To follow native style, comment and data structure/function naming is changed like below descriptions.
1. Naming enumeration with suffix '_e'
2. Naming enum type with prefix sub module
Change-Id: I3a10da467008f30e7cd55ac1f6803a8a11f646fa
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 9 Apr 2024 02:10:01 +0000 (11:10 +0900)]
device-haptic: Separate device-haptic header files
To apply HAL ABI Versioning, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-haptic-types.h
-> Common data types like structures or enums used between the device-haptic
HAL-API and HAL-BACKEND
hal-device-haptic-interface-1.h
-> Declaration of functions to be implemented in the device-haptic HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-haptic-interface.h
-> Includes the hal-device-haptic-interface-[major].h files for each supported
major version.
hal-device-haptic.h
-> Declaration of the device-haptic HAL-API functions
Change-Id: I63ca1071441233f009fe4b482a3e6932244e6255
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 9 Apr 2024 02:00:13 +0000 (11:00 +0900)]
device-haptic: Fix incorrect module naming
Fix incorrect module name from "board" to "device-haptic".
struct
- hal_backend_haptic_funcs -> struct hal_backend_device_haptic_funcs
file
- hal-haptic.h -> hal-device-haptic.h
- hal-haptic-interface.h -> hal-device-haptic-interface.h
According to HAL API Prototype rule,
hal module funcs structure naming is same as below
- hal_backend_[module]_funcs.
Also, hal module header files naming is same as below.
- hal-[module].h
- hal-[module]-interface.h
However, the hal module name was being used incorrectly.
Actual hal module name is not "haptic" but "device-haptic"
Change-Id: I976337bfdd34f05462cdaa9197d2c6314d9d3624
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 12:20:49 +0000 (21:20 +0900)]
device-board: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-board.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-board.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-board.
Change-Id: Idc344c9efca1e2270dcf8c12e621ffdc18d4c696
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 09:44:25 +0000 (18:44 +0900)]
device-board: Separate device-board header files
To apply HAL ABI Versioning, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-board-types.h
-> Common data types like structures or enums used between the device-board
HAL-API and HAL-BACKEND
hal-device-board-interface-1.h
-> Declaration of functions to be implemented in the device-board HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-board-interface.h
-> Includes the hal-device-board-interface-[major].h files for each supported
major version.
hal-device-board.h
-> Declaration of the device-board HAL-API functions
Change-Id: Ic225f2fbf6a13fbef24a1ef9ccc05e7ff816db97
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 09:33:46 +0000 (18:33 +0900)]
device-board: Fix incorrect module naming
Fix incorrect module name from "board" to "device-board".
struct
- hal_backend_board_funcs -> struct hal_backend_device_board_funcs
file
- hal-board.h -> hal-device-board.h
- hal-board-interface.h -> hal-device-board-interface.h
According to HAL API Prototype rule,
hal module funcs structure naming is same as below
- hal_backend_[module]_funcs.
Also, hal module header files naming is same as below.
- hal-[module].h
- hal-[module]-interface.h
However, the hal module name was being used incorrectly.
Actual hal module name is not "board" but "device-board".
Change-Id: Ib0db0f55a906e857d41af622399299dc17da7ef9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 10:24:50 +0000 (19:24 +0900)]
device-display: Add inclusion stdlib.h fila to resolve build warning
Change-Id: I1100c5d7012c7fffabc157289df41f2c9a1c3e05
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 10:10:17 +0000 (19:10 +0900)]
device-display: Add get backend logic
When the hal device display module api is called before loading hal-backend,
it should be handled with hal_device_display_get_backend().
This was removed as applying HAL ABI versioning,
however this logic is necessary.
Change-Id: I3ed1b67e3ea8fada9ae394d717e66f5c3f6d216f
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 8 Apr 2024 03:26:21 +0000 (12:26 +0900)]
Change header file installation path
Actually, the path of hal module interface and header files should be
under the "/usr/include/hal/" path, not "/usr/include/hal/device".
Thus, change the header file path from "/hal/device" to "/hal".
Change-Id: I70dc56ee692b40838b8aafacc78c9ddea81d6e51
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 4 Apr 2024 08:51:51 +0000 (17:51 +0900)]
device-display: Add hal_backend_device_display_funcs initialization
When the hal module fails open hal-backend,
after free hal_backend_[module]_funcs structure, it should be initialized by NULL.
Otherwise, there will be an error when approaching above function pointer structure.
To avoid accessing uninitialized value, this is necessary.
Change-Id: Icc0672941d681eafee471724a2cb2c0d49ac6919
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 2 Apr 2024 11:23:52 +0000 (20:23 +0900)]
device-display: Apply HAL ABI versioning rule
In HAL-API-[module], source file name should follow hal-api-[module].c format
for applying HAL ABI versioning.
hal-api-device-display.c
-> HAL-INTERFACE Wrapper call according to major version and implemenation of
functions declared in hal-device-display.h
To apply HAL ABI versioning, the backend function structure memory allocation part
was moved to hal-api-device-display.
Change-Id: I6c203c078a512e474a8568b1303bcfbf20afe31e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 2 Apr 2024 10:39:46 +0000 (19:39 +0900)]
device-display: Modify enum structure in native API style
In hal-device-display-types.h,
data types should be follow native API principles.
To follow native style, comment and data structure naming is changed like below descriptions.
1. Naming enum structure with suffix _e
2. Naming enum type with prefix sub module to prevent symbols conflict.
Change-Id: I642fef372363f7e3dce980cc0628ec357fdecf53
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 18 Mar 2024 04:18:37 +0000 (13:18 +0900)]
device-display: Separate device-display header files
To apply HAL ABI Versioning, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-display-types.h
-> Common data types like structures or enums used between the device-display
HAL-API and HAL-BACKEND
hal-device-display-interface-1.h
-> Declaration of functions to be implemented in the device-display HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-display-interface.h
-> Includes the hal-device-display-interface-[major].h files for each supported
major version.
hal-device-display.h
-> Declaration of the device-display HAL-API functions
Change-Id: I1caecf577cea48d2bf9303e083b3fdf072469ecf
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 15 Mar 2024 02:41:58 +0000 (11:41 +0900)]
display: Fix incorrect module naming
Fix incorrect module name from "display" to "device-display".
struct
- hal_backend_display_funcs -> struct hal_backend_device_display_funcs
file
- hal-display.h -> hal-device-display.h
- hal-display-interface.h -> hal-device-display-interface.h
According to HAL API Prototype rule,
hal module funcs structure naming is same as below
- hal_backend_[module]_funcs.
Also, hal module header files naming is same as below.
- hal-[module].h
- hal-[module]-interface.h
However, the hal module name was being used incorrectly.
Actual hal module name is not "display" but "device-display".
Change-Id: Icc209e6d73737209032603671542f13ad9f42c77
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Wed, 13 Mar 2024 08:19:09 +0000 (17:19 +0900)]
include: Relocate interface header files from backend folder to include folder
Remove backend folder below include folder and move interface header files
In order to apply HAL ABI Versioning, code refactoring is performed first.
Interface header files that was incorrectly located under the backend folder
are moved to include folder.
In the hal-api-device module, when the module is installed,
the header files is located below /usr/include/hal/device
Thus, backend folder is also removed to maintain hal-api-[module] code structure consistency.
Change-Id: I36e974f289fa72114662dc05dfa96cf30d60cd44
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Tue, 14 Feb 2023 01:10:51 +0000 (10:10 +0900)]
power: add enum for transition by DISPLAY_OFF_TIMEOUT
- DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF (existing one)
Reason for display off itself.
- DDEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT (added one)
Reason for expiration of timer triggered by display off. Commonly,
it is used for system suspend reason.
Change-Id: Icf18aa0c0da83cdbf2f63cf1c2fdad375f2f5aab
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Tue, 7 Feb 2023 09:30:10 +0000 (18:30 +0900)]
input: add HAL_DEVICE_INPUT_TYPE_TOUCHSCREEN
Add HAL_DEVICE_INPUT_TYPE_TOUCHSCREEN type to support touchscreen input device.
Change-Id: I4b57e95b3a6351b46793af8915dc283d0254c0cb
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
TaeminYeom [Thu, 19 Jan 2023 07:23:20 +0000 (16:23 +0900)]
haltest: Initialize local variables
These local variables are used to get the values in the
hal backend function with pointer.
If there is an error in hal backend function,
it is possible to use uninitialized local variables.
Change-Id: I43eadbe13f19e8fb3bd9537b610db6bc773b7d6f
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
TaeminYeom [Wed, 11 Jan 2023 02:13:32 +0000 (11:13 +0900)]
display: remove ROTATION_ANGLE_DEGREE_360
display rotation degree 360 is same angle with degree 0.
So, it is not needed.
Change-Id: I6faa8174298a64088fa7e63f96075b6b022fe97b
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
TaeminYeom [Thu, 29 Sep 2022 04:52:00 +0000 (13:52 +0900)]
display: Add rotation angle API
rotation angle means "physical display" angle.
Clients can rotate display or check current display angle.
API
-hal_device_display_get_rotation_angle
-hal_device_display_set_rotation_angle
enum
-hal_device_display_rotation_angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN : It can be seen in laid device
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 : Initial display rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 : 90° rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 : 180° rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 : 270° rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_360 : 360° rotation angle
-hal_device_display_rotation_direction
HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE : Rotate clockwise direction
HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE : Rotate counter clockwise direction
Change-Id: I617f42466218a0a7f579c5d331a818e534cf173c
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
TaeminYeom [Thu, 1 Dec 2022 09:07:44 +0000 (18:07 +0900)]
power: add hal interface and getter wakeup reason
Add power hal interface including getter wakeup reason function.
"wakeup reason" is the power transition state reason of sleep to normal.
There are several reasons why the device wakeup such as power key, Wifi and touchscreen.
Sometimes it Is needed to get the reason.
hal-interface
- hal_backend_device_power_funcs
- hal_device_power_get_backend
- hal_device_power_put_backend
function
- hal_device_power_get_wakeup_reason
enum
hal_device_power_wakeup_reason
It is same value with "device_power_transition_reason_e" in device API
HAL_DEVICE_POWER_TRANSITION_REASON_UNKNOWN : Unknown reason
HAL_DEVICE_POWER_TRANSITION_REASON_POWER_KEY : Power key pressed
HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_NORMAL_LEVEL : Battery capacity reaches normal level
HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_WARNING_LEVEL : Battery capacity reaches warning level
HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_CRITICAL_LEVEL : Battery capacity reaches critical level
HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_POWEROFF_LEVEL : Battery capacity reaches poweroff level
HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF : Display off
HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_KEY : Touch key pressed
HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_SCREEN : Touch screen pressed
HAL_DEVICE_POWER_TRANSITION_REASON_USB : USB attached or detached
HAL_DEVICE_POWER_TRANSITION_REASON_CHARGER : Charger attached or detached
HAL_DEVICE_POWER_TRANSITION_REASON_WIFI : WIFI event
HAL_DEVICE_POWER_TRANSITION_REASON_BLUETOOTH : Bluetooth event
HAL_DEVICE_POWER_TRANSITION_REASON_AUDIO : Audio event
HAL_DEVICE_POWER_TRANSITION_REASON_ALARM : Alarm event
HAL_DEVICE_POWER_TRANSITION_REASON_SENSOR : Sensor event
HAL_DEVICE_POWER_TRANSITION_REASON_RTC : RTC event
HAL_DEVICE_POWER_TRANSITION_REASON_HEADSET : Headset attatched or detached or button pressed
HAL_DEVICE_POWER_TRANSITION_REASON_EXTERNAL_MEMORY : External memory inserted or deleted
HAL_DEVICE_POWER_TRANSITION_REASON_DOWNLOAD : Download event
Change-Id: I4580b6b336f6f081d45315bc786d1e92c00d790b
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
Yunhee Seo [Tue, 13 Dec 2022 04:54:55 +0000 (13:54 +0900)]
input: add getter/setter for controlling input device event
Add a getter and setter function of input device event status
These are function prototype to be added.
int hal_device_input_get_backend(void);
-> This function initialize hal module which name is HAL_MODULE_DEVICE_INPUT
int hal_device_input_put_backend(void);
-> This function put hal module which is initialized from the above function.
int hal_device_input_set_event_state(int input_device_id, int on);
-> This function set input device event state,
With input_device_id, it is possible to distinguish input devices.
int hal_device_input_get_event_state(int input_device_id, int* on);
-> This function get event state value with the unique input_device_id value.
With input_device_id parameter, it is possible to enable/disable event of input device.
Because input_device_id work as a unique id of input devices.
To get input_device_id number, these input types will be used.
Also these enum types will be used for controlling and managing input devices.
typedef enum {
HAL_DEVICE_INPUT_TYPE_UNKNOWN = 0, /**< Input device type which is not defined. */
HAL_DEVICE_INPUT_TYPE_ALL, /**< Input device type which is all kinds of input devices */
HAL_DEVICE_INPUT_TYPE_MOUSE, /**< Input device type which is mouse-type */
HAL_DEVICE_INPUT_TYPE_KEYBOARD, /**< Input device type which is keyboard-type */
HAL_DEVICE_INPUT_TYPE_CUSTOM_KNOB, /**< Input device type which is customed knob-type */
} hal_device_input_type;
Change-Id: I2c8e68768f53137903d8a074b9e319d68ae95958
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 10 Nov 2022 08:19:39 +0000 (17:19 +0900)]
display: add getter/setter for white balance
Add a getter and setter function of display white balance which controls RGB gain and offset.
White balancing is adjusting standard point of white color, this because the light source is different for each device.
gain value is a value to be multiplied for RGB value calculation.
offset vealue is a value to be added for RGB value calculation.
These are function prototype to be added.
int hal_device_display_set_white_balance(enum hal_display_white_balance, int value);
int hal_device_display_get_white_balance(enum hal_display_white_balance, int* value);
With this enum type, it is possible to get and set RGB gain and offset value for white balancing.
It is used as a parameter of HAL getter and setter function.
enum hal_display_white_balance {
HAL_DISPLAY_WHITE_BALANCE_R_GAIN,
HAL_DISPLAY_WHITE_BALANCE_G_GAIN,
HAL_DISPLAY_WHITE_BALANCE_B_GAIN,
HAL_DISPLAY_WHITE_BALANCE_R_OFFSET,
HAL_DISPLAY_WHITE_BALANCE_G_OFFSET,
HAL_DISPLAY_WHITE_BALANCE_B_OFFSET,
};
Change-Id: I3afe3953e15b61657a8dfd842a30fde553359586
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Tue, 3 May 2022 04:50:49 +0000 (13:50 +0900)]
battery: remove unused struct variable
Change-Id: I86ba0c395fc7bd84e7b2177d3517e7e2985c0aa2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
SangYoun Kwak [Tue, 3 May 2022 05:30:53 +0000 (14:30 +0900)]
Add new API to set/get partition status
Change-Id: I1c21ce2dc6ec8f08b40316867682576f195ff23c
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>