diff options
author | Yunhee Seo <yuni.seo@samsung.com> | 2024-03-15 11:41:58 +0900 |
---|---|---|
committer | Yunhee Seo <yuni.seo@samsung.com> | 2024-03-18 18:49:10 +0900 |
commit | bdffd78f76081bc3d4722e57b372d3842c50190c (patch) | |
tree | 4421b432f1d273d5b6134f64a8b46d1d4de67417 | |
parent | 5bb07b50e5e00594c704a2a201e4bca5cd5a46e3 (diff) | |
download | device-bdffd78f76081bc3d4722e57b372d3842c50190c.tar.gz device-bdffd78f76081bc3d4722e57b372d3842c50190c.tar.bz2 device-bdffd78f76081bc3d4722e57b372d3842c50190c.zip |
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>
-rw-r--r-- | haltest/display.cpp | 2 | ||||
-rw-r--r-- | include/hal-device-display-interface.h (renamed from include/hal-display-interface.h) | 10 | ||||
-rw-r--r-- | include/hal-device-display.h (renamed from include/hal-display.h) | 8 | ||||
-rw-r--r-- | src/display.c | 182 |
4 files changed, 101 insertions, 101 deletions
diff --git a/haltest/display.cpp b/haltest/display.cpp index 9bb7e14..7a6bcbc 100644 --- a/haltest/display.cpp +++ b/haltest/display.cpp @@ -2,7 +2,7 @@ #include <system_info.h> #include "haltest.h" -#include "hal-display.h" +#include "hal-device-display.h" static int image_effect_raw_to_enum(int effect); diff --git a/include/hal-display-interface.h b/include/hal-device-display-interface.h index ab28c2f..6e3e427 100644 --- a/include/hal-display-interface.h +++ b/include/hal-device-display-interface.h @@ -15,8 +15,8 @@ */ -#ifndef __HAL_DISPLAY_INTERFACE_H__ -#define __HAL_DISPLAY_INTERFACE_H__ +#ifndef __HAL_DEVICE_DISPLAY_INTERFACE__ +#define __HAL_DEVICE_DISPLAY_INTERFACE__ #ifdef __cplusplus extern "C" { @@ -72,7 +72,7 @@ enum hal_device_display_rotation_direction { HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE, }; -typedef struct _hal_backend_display_funcs { +typedef struct _hal_backend_device_display_funcs { /* Control display brightness */ int (*get_max_brightness)(int *brightness); int (*get_brightness)(int *brightness); @@ -113,9 +113,9 @@ typedef struct _hal_backend_display_funcs { /* Control display rotation angle */ int (*get_rotation_angle)(int display_index, enum hal_device_display_rotation_angle *angle); int (*set_rotation_angle)(int display_index, enum hal_device_display_rotation_angle angle, enum hal_device_display_rotation_direction direction); -} hal_backend_display_funcs; +} hal_backend_device_display_funcs; #ifdef __cplusplus } #endif -#endif /* __HAL_DISPLAY_INTERFACE_H__ */ +#endif /* __HAL_DEVICE_DISPLAY_INTERFACE__ */ diff --git a/include/hal-display.h b/include/hal-device-display.h index 2f49bff..5a59c3b 100644 --- a/include/hal-display.h +++ b/include/hal-device-display.h @@ -15,10 +15,10 @@ */ -#ifndef __HAL_DISPLAY_H__ -#define __HAL_DISPLAY_H__ +#ifndef __HAL_DEVICE_DISPLAY_H__ +#define __HAL_DEVICE_DISPLAY_H__ -#include "hal-display-interface.h" +#include "hal-device-display-interface.h" #ifdef __cplusplus extern "C" { @@ -54,4 +54,4 @@ int hal_device_display_set_rotation_angle(int display_index, enum hal_device_dis #endif -#endif // __HAL_DISPLAY_H__ +#endif // __HAL_DEVICE_DISPLAY_H__ diff --git a/src/display.c b/src/display.c index a2b311d..d3ae4eb 100644 --- a/src/display.c +++ b/src/display.c @@ -16,10 +16,10 @@ #include <hal/hal-common.h> -#include "hal-display-interface.h" +#include "hal-device-display-interface.h" #include "common.h" -static hal_backend_display_funcs *hal_display_funcs = NULL; +static hal_backend_device_display_funcs *hal_device_display_funcs = NULL; /* -1 : failed to initialize 0 : not initialized @@ -31,10 +31,10 @@ int hal_device_display_get_backend(void) { int ret; - if (hal_display_funcs) + if (hal_device_display_funcs) return 0; - ret = hal_common_get_backend(HAL_MODULE_DEVICE_DISPLAY, (void **)&hal_display_funcs); + ret = hal_common_get_backend(HAL_MODULE_DEVICE_DISPLAY, (void **)&hal_device_display_funcs); if (ret < 0) { _E("Failed to get display backend"); hal_initialized = -1; @@ -47,11 +47,11 @@ int hal_device_display_get_backend(void) int hal_device_display_put_backend(void) { - if (!hal_display_funcs) + if (!hal_device_display_funcs) return 0; - hal_common_put_backend(HAL_MODULE_DEVICE_DISPLAY, (void *)hal_display_funcs); - hal_display_funcs = NULL; + hal_common_put_backend(HAL_MODULE_DEVICE_DISPLAY, (void *)hal_device_display_funcs); + hal_device_display_funcs = NULL; hal_initialized = 0; return 0; @@ -61,320 +61,320 @@ int hal_device_display_get_max_brightness(int *brightness) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_max_brightness) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_max_brightness) return -ENODEV; - return hal_display_funcs->get_max_brightness(brightness); + return hal_device_display_funcs->get_max_brightness(brightness); } int hal_device_display_get_brightness(int *brightness) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_brightness) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_brightness) return -ENODEV; - return hal_display_funcs->get_brightness(brightness); + return hal_device_display_funcs->get_brightness(brightness); } int hal_device_display_set_brightness(int brightness) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_brightness) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_brightness) return -ENODEV; - return hal_display_funcs->set_brightness(brightness); + return hal_device_display_funcs->set_brightness(brightness); } int hal_device_display_set_multi_brightness(int brightness, int step, int delay) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_multi_brightness) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_multi_brightness) return -ENODEV; - return hal_display_funcs->set_multi_brightness(brightness, step, delay); + return hal_device_display_funcs->set_multi_brightness(brightness, step, delay); } int hal_device_display_get_auto_brightness(float lmax, float lmin, float light, int *brightness) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_auto_brightness) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_auto_brightness) return -ENODEV; - return hal_display_funcs->get_auto_brightness(lmax, lmin, light, brightness); + return hal_device_display_funcs->get_auto_brightness(lmax, lmin, light, brightness); } int hal_device_display_get_state(enum display_state *state) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_state) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_state) return -ENODEV; - return hal_display_funcs->get_state(state); + return hal_device_display_funcs->get_state(state); } int hal_device_display_set_state(enum display_state state) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_state) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_state) return -ENODEV; - return hal_display_funcs->set_state(state); + return hal_device_display_funcs->set_state(state); } int hal_device_display_get_image_effect(enum display_image_effect *effect) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_image_effect) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_image_effect) return -ENODEV; - return hal_display_funcs->get_image_effect(effect); + return hal_device_display_funcs->get_image_effect(effect); } int hal_device_display_set_image_effect(enum display_image_effect effect) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_image_effect) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_image_effect) return -ENODEV; - return hal_display_funcs->set_image_effect(effect); + return hal_device_display_funcs->set_image_effect(effect); } int hal_device_display_get_panel_mode(enum display_panel_mode *mode) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_panel_mode) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_panel_mode) return -ENODEV; - return hal_display_funcs->get_panel_mode(mode); + return hal_device_display_funcs->get_panel_mode(mode); } int hal_device_display_set_panel_mode(enum display_panel_mode mode) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_panel_mode) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_panel_mode) return -ENODEV; - return hal_display_funcs->set_panel_mode(mode); + return hal_device_display_funcs->set_panel_mode(mode); } int hal_device_display_get_aod_mode(enum display_aod_mode *mode) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_aod_mode) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_aod_mode) return -ENODEV; - return hal_display_funcs->get_aod_mode(mode); + return hal_device_display_funcs->get_aod_mode(mode); } int hal_device_display_get_aod_brightness(int *max, int *normal, int *min, int *charging) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_aod_brightness) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_aod_brightness) return -ENODEV; - return hal_display_funcs->get_aod_brightness(max, normal, min, charging); + return hal_device_display_funcs->get_aod_brightness(max, normal, min, charging); } int hal_device_display_get_max_frame_rate(int *rate) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_max_frame_rate) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_max_frame_rate) return -ENODEV; - return hal_display_funcs->get_max_frame_rate(rate); + return hal_device_display_funcs->get_max_frame_rate(rate); } int hal_device_display_get_min_frame_rate(int *rate) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_min_frame_rate) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_min_frame_rate) return -ENODEV; - return hal_display_funcs->get_min_frame_rate(rate); + return hal_device_display_funcs->get_min_frame_rate(rate); } int hal_device_display_get_frame_rate(int *rate) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_frame_rate) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_frame_rate) return -ENODEV; - return hal_display_funcs->get_frame_rate(rate); + return hal_device_display_funcs->get_frame_rate(rate); } int hal_device_display_set_frame_rate(int rate) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_frame_rate) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_frame_rate) return -ENODEV; - return hal_display_funcs->set_frame_rate(rate); + return hal_device_display_funcs->set_frame_rate(rate); } int hal_device_display_set_white_balance(enum hal_display_white_balance white_balance_type, int value) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_white_balance) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_white_balance) return -ENODEV; - return hal_display_funcs->set_white_balance(white_balance_type, value); + return hal_device_display_funcs->set_white_balance(white_balance_type, value); } int hal_device_display_get_white_balance(enum hal_display_white_balance white_balance_type, int* value) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_white_balance) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_white_balance) return -ENODEV; - return hal_display_funcs->get_white_balance(white_balance_type, value); + return hal_device_display_funcs->get_white_balance(white_balance_type, value); } int hal_device_display_get_rotation_angle(int display_index, enum hal_device_display_rotation_angle *angle) { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->get_rotation_angle) + if (!hal_device_display_funcs || + !hal_device_display_funcs->get_rotation_angle) return -ENODEV; - return hal_display_funcs->get_rotation_angle(display_index, angle); + return hal_device_display_funcs->get_rotation_angle(display_index, angle); } int hal_device_display_set_rotation_angle(int display_index, @@ -383,14 +383,14 @@ int hal_device_display_set_rotation_angle(int display_index, { int ret; - if (!hal_display_funcs && !hal_initialized) { + if (!hal_device_display_funcs && !hal_initialized) { if ((ret = hal_device_display_get_backend()) < 0) return ret; } - if (!hal_display_funcs || - !hal_display_funcs->set_rotation_angle) + if (!hal_device_display_funcs || + !hal_device_display_funcs->set_rotation_angle) return -ENODEV; - return hal_display_funcs->set_rotation_angle(display_index, angle, direction); + return hal_device_display_funcs->set_rotation_angle(display_index, angle, direction); } |