include: Relocate interface header files from backend folder to include folder 22/307822/5
authorYunhee Seo <yuni.seo@samsung.com>
Wed, 13 Mar 2024 08:19:09 +0000 (17:19 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Mon, 18 Mar 2024 09:48:01 +0000 (18:48 +0900)
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>
27 files changed:
CMakeLists.txt
include/backend/hal-battery-interface.h [deleted file]
include/backend/hal-bezel-interface.h [deleted file]
include/backend/hal-board-interface.h [deleted file]
include/backend/hal-device-input-interface.h [deleted file]
include/backend/hal-device-power-interface.h [deleted file]
include/backend/hal-display-interface.h [deleted file]
include/backend/hal-external_connection-interface.h [deleted file]
include/backend/hal-haptic-interface.h [deleted file]
include/backend/hal-ir-interface.h [deleted file]
include/backend/hal-led-interface.h [deleted file]
include/backend/hal-memory-interface.h [deleted file]
include/backend/hal-thermal-interface.h [deleted file]
include/backend/hal-touchscreen-interface.h [deleted file]
include/hal-battery-interface.h [new file with mode: 0644]
include/hal-bezel-interface.h [new file with mode: 0644]
include/hal-board-interface.h [new file with mode: 0644]
include/hal-device-input-interface.h [new file with mode: 0644]
include/hal-device-power-interface.h [new file with mode: 0644]
include/hal-display-interface.h [new file with mode: 0644]
include/hal-external_connection-interface.h [new file with mode: 0644]
include/hal-haptic-interface.h [new file with mode: 0644]
include/hal-ir-interface.h [new file with mode: 0644]
include/hal-led-interface.h [new file with mode: 0644]
include/hal-memory-interface.h [new file with mode: 0644]
include/hal-thermal-interface.h [new file with mode: 0644]
include/hal-touchscreen-interface.h [new file with mode: 0644]

index 2cec322556153a1308f55d0e31a064b3ed309cd4..8426df035d99092621fee77f88aaecaf15d9e991 100644 (file)
@@ -9,7 +9,6 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${INC_DIR})
-INCLUDE_DIRECTORIES(${INC_DIR}/backend)
 
 SET(PKG_MODULES
                dlog
@@ -53,11 +52,6 @@ INSTALL(
     FILES_MATCHING
     PATTERN "${INC_DIR}/hal-*.h"
 )
-INSTALL(
-    DIRECTORY ${INC_DIR}/backend/ DESTINATION include/hal/device
-    FILES_MATCHING
-    PATTERN "${INC_DIR}/backend/hal-*.h"
-)
 
 SET(PC_NAME ${fw_name})
 SET(PC_REQUIRED ${pc_dependents})
diff --git a/include/backend/hal-battery-interface.h b/include/backend/hal-battery-interface.h
deleted file mode 100644 (file)
index 00d06b5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_BATTERY_INTERFACE_H__
-#define __HAL_BATTERY_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The id of this device
- */
-#define BATTERY_HARDWARE_DEVICE_ID     "battery"
-
-#define POWER_SOURCE_NONE     "none"
-#define POWER_SOURCE_AC       "ac"
-#define POWER_SOURCE_USB      "usb"
-#define POWER_SOURCE_WIRELESS "wireless"
-
-struct battery_info {
-       char *name;
-       char *status;
-       char *health;
-       char *power_source;
-
-       int online;
-       int present;
-       int capacity;
-
-       int current_now;
-       int current_average;
-       int voltage_now;
-       int voltage_average;
-       int temperature;
-};
-
-typedef void (*BatteryUpdated)(struct battery_info *info, void *data);
-
-typedef struct _hal_backend_battery_funcs {
-       /* Register battery event */
-       int (*register_changed_event)(BatteryUpdated updated_cb, void *data);
-       void (*unregister_changed_event)(BatteryUpdated updated_cb);
-
-       /* Get current states */
-       int (*get_current_state)(BatteryUpdated updated_cb, void *data);
-} hal_backend_battery_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_BATTERY_INTERFACE_H__ */
diff --git a/include/backend/hal-bezel-interface.h b/include/backend/hal-bezel-interface.h
deleted file mode 100644 (file)
index 5b0154e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_BEZEL_INTERFACE_H__
-#define __HAL_BEZEL_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum bezel_state {
-       BEZEL_TURNOFF = 0,
-       BEZEL_TURNON,
-};
-
-enum bezel_vib_state {
-       BEZEL_VIB_NONE = 0,
-       BEZEL_VIB_LIGHT,
-       BEZEL_VIB_MEDIUM,
-       BEZEL_VIB_STRONG,
-};
-
-typedef struct _hal_backend_bezel_funcs {
-       /* Control hardware bezel state */
-       int (*get_state)(enum bezel_state *state);
-       int (*set_state)(enum bezel_state state);
-       /* Control software bezel state */
-       int (*get_sw_state)(enum bezel_state *state);
-       int (*set_sw_state)(enum bezel_state state);
-
-       /* Control bezel vibration state */
-       int (*get_vib_state)(enum bezel_vib_state *state);
-       int (*set_vib_state)(enum bezel_vib_state state);
-} hal_backend_bezel_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_BEZEL_INTERFACE_H__ */
diff --git a/include/backend/hal-board-interface.h b/include/backend/hal-board-interface.h
deleted file mode 100644 (file)
index 3226597..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_BOARD_INTERFACE_H__
-#define __HAL_BOARD_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _hal_backend_board_funcs {
-       /* Serial number of this device */
-       int (*get_device_serial_number)(char *buffer, const int max_len);
-       int (*get_device_revision)(int *revision);
-
-       int (*set_boot_success)(void);
-       int (*clear_boot_mode)(void);
-       int (*get_boot_mode)(char *buffer, const int max_len);
-       int (*get_boot_reason)(char *buffer, const int max_len);
-
-       int (*get_current_partition)(char *partition_ab);
-       int (*switch_partition)(char partition_ab);
-       int (*set_partition_ab_cloned)(void);
-       int (*clear_partition_ab_cloned)(void);
-       int (*get_partition_ab_cloned)(int *cloned);
-       int (*set_partition_status)(char partition_ab, const char *status);
-       int (*get_partition_status)(char partition_ab, char *buffer, const int max_len);
-
-       int (*set_upgrade_status)(int status);
-       int (*get_upgrade_status)(int *status);
-
-} hal_backend_board_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_BOARD_INTERFACE_H__ */
diff --git a/include/backend/hal-device-input-interface.h b/include/backend/hal-device-input-interface.h
deleted file mode 100644 (file)
index c67dca0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __HAL_DEVICE_INPUT_INTERFACE_H__
-#define __HAL_DEVICE_INPUT_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-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_TOUCHSCREEN, /**< Input device type which is touchscreen-type */
-
-       HAL_DEVICE_INPUT_TYPE_CUSTOM_KNOB = 1000, /**< Input device type which is customed knob-type */
-} hal_device_input_type;
-
-typedef struct _hal_backend_device_input_funcs {
-       /* Control input device event */
-       int (*set_event_state)(int input_device_id, int on);
-       int (*get_event_state)(int input_device_id, int* on);
-} hal_backend_device_input_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DEVICE_INPUT_INTERFACE_H__ */
diff --git a/include/backend/hal-device-power-interface.h b/include/backend/hal-device-power-interface.h
deleted file mode 100644 (file)
index 275869b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __HAL_DEVICE_POWER_INTERFACE_H__
-#define __HAL_DEVICE_POWER_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum hal_device_power_transition_reason {
-       HAL_DEVICE_POWER_TRANSITION_REASON_UNKNOWN,
-       HAL_DEVICE_POWER_TRANSITION_REASON_POWER_KEY,
-       HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_UP_KEY,
-       HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_DOWN_KEY,
-       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_NORMAL_LEVEL,
-       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_WARNING_LEVEL,
-       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_CRITICAL_LEVEL,
-       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_POWEROFF_LEVEL,
-       HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF,
-       HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT,
-       HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_KEY,
-       HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_SCREEN,
-       HAL_DEVICE_POWER_TRANSITION_REASON_USB,
-       HAL_DEVICE_POWER_TRANSITION_REASON_CHARGER,
-       HAL_DEVICE_POWER_TRANSITION_REASON_HDMI,
-       HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_PORT,
-       HAL_DEVICE_POWER_TRANSITION_REASON_EMBEDDED_DISPLAY_PORT,
-       HAL_DEVICE_POWER_TRANSITION_REASON_WIFI,
-       HAL_DEVICE_POWER_TRANSITION_REASON_BLUETOOTH,
-       HAL_DEVICE_POWER_TRANSITION_REASON_NFC,
-       HAL_DEVICE_POWER_TRANSITION_REASON_TELEPHONY,
-       HAL_DEVICE_POWER_TRANSITION_REASON_ZIGBEE,
-       HAL_DEVICE_POWER_TRANSITION_REASON_ETHERNET,
-       HAL_DEVICE_POWER_TRANSITION_REASON_AUDIO,
-       HAL_DEVICE_POWER_TRANSITION_REASON_ALARM,
-       HAL_DEVICE_POWER_TRANSITION_REASON_SENSOR,
-       HAL_DEVICE_POWER_TRANSITION_REASON_RTC,
-       HAL_DEVICE_POWER_TRANSITION_REASON_HEADSET,
-       HAL_DEVICE_POWER_TRANSITION_REASON_EXTERNAL_MEMORY,
-
-       HAL_DEVICE_POWER_TRANSITION_REASON_CUSTOM = 1000,       /**< Define custom reason from here */
-};
-
-typedef struct _hal_backend_device_power_funcs {
-       int (*get_wakeup_reason)(enum hal_device_power_transition_reason *reason);
-} hal_backend_device_power_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DEVICE_POWER_INTERFACE_H__ */
diff --git a/include/backend/hal-display-interface.h b/include/backend/hal-display-interface.h
deleted file mode 100644 (file)
index ab28c2f..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_DISPLAY_INTERFACE_H__
-#define __HAL_DISPLAY_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum display_state {
-       DISPLAY_ON,       /* In use */
-       DISPLAY_STANDBY,  /* Blanked, low power */
-       DISPLAY_SUSPEND,  /* Blanked, lower power */
-       DISPLAY_OFF,      /* Shut off, awaiting activity */
-       DISPLAY_DETACH,   /* Detached display at runtime */
-};
-
-enum display_image_effect {
-       DISPLAY_IMAGE_EFFECT_STANDARD,     /* No effect */
-       DISPLAY_IMAGE_EFFECT_NEGATIVE,         /* Negative effect */
-       DISPLAY_IMAGE_EFFECT_GREY,             /* Grey effect */
-       DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE,    /* Grey Negative effect */
-       DISPLAY_IMAGE_EFFECT_MAX,
-};
-
-enum display_panel_mode {
-       DISPLAY_PANEL_MODE_STANDARD,      /* Standard mode */
-       DISPLAY_PANEL_MODE_OUTDOOR,       /* Outdoor mode */
-       DISPLAY_PANEL_MODE_CONTENTS,      /* Contents adaptive brightness control mode */
-       DISPLAY_PANEL_MODE_LOWPOWER,      /* Low power mode */
-};
-
-enum display_aod_mode {
-       DISPLAY_AOD_MODE_OFF,
-       DISPLAY_AOD_MODE_ON,
-};
-
-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,
-};
-
-enum hal_device_display_rotation_angle {
-       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN = -1,
-       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 = 0,
-       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 = 90,
-       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 = 180,
-       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 = 270,
-};
-
-enum hal_device_display_rotation_direction {
-       HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
-       HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
-};
-
-typedef struct _hal_backend_display_funcs {
-       /* Control display brightness */
-       int (*get_max_brightness)(int *brightness);
-       int (*get_brightness)(int *brightness);
-       int (*set_brightness)(int brightness);
-       int (*set_multi_brightness)(int brightness, int step, int delay);
-
-       /* Control display brightness by sensor */
-       int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);
-
-       /* Control display state */
-       int (*get_state)(enum display_state *state);
-       int (*set_state)(enum display_state state);
-
-       /* Control image effect */
-       int (*get_image_effect)(enum display_image_effect *effect);
-       int (*set_image_effect)(enum display_image_effect effect);
-
-       /* Control panel mode */
-       int (*get_panel_mode)(enum display_panel_mode *mode);
-       int (*set_panel_mode)(enum display_panel_mode mode);
-
-       /* Control AOD mode */
-       int (*get_aod_mode)(enum display_aod_mode *mode);
-
-       /* Control AOD brightness */
-       int (*get_aod_brightness)(int *max, int *normal, int *min, int *charging);
-
-       /* Control display frame rate */
-       int (*get_max_frame_rate)(int *rate);
-       int (*get_min_frame_rate)(int *rate);
-       int (*get_frame_rate)(int *rate);
-       int (*set_frame_rate)(int rate);
-
-       /* Control display white balance */
-       int (*set_white_balance)(enum hal_display_white_balance, int value);
-       int (*get_white_balance)(enum hal_display_white_balance, int *value);
-
-       /* 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;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DISPLAY_INTERFACE_H__ */
diff --git a/include/backend/hal-external_connection-interface.h b/include/backend/hal-external_connection-interface.h
deleted file mode 100644 (file)
index 3f5a6bf..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
-#define __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define EXTERNAL_CONNECTION_USB       "USB"
-#define EXTERNAL_CONNECTION_USB_HOST  "USB-HOST"
-#define EXTERNAL_CONNECTION_TA        "TA"
-#define EXTERNAL_CONNECTION_HDMI      "HDMI"
-#define EXTERNAL_CONNECTION_DOCK      "Dock"
-#define EXTERNAL_CONNECTION_MIC       "Microphone"
-#define EXTERNAL_CONNECTION_HEADPHONE "Headphone"
-
-struct connection_info {
-       char *name;
-       char *state;
-       int flags;
-};
-
-typedef void (*ConnectionUpdated)(struct connection_info *info, void *data);
-
-typedef struct _hal_backend_external_connection_funcs {
-       /* Register external_connection event */
-       int (*register_changed_event)(ConnectionUpdated updated_cb, void *data);
-       void (*unregister_changed_event)(ConnectionUpdated updated_cb);
-
-       /* Get current states */
-       int (*get_current_state)(ConnectionUpdated updated_cb, void *data);
-} hal_backend_external_connection_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_EXTERNAL_CONNECTION_INTERFACE_H__ */
diff --git a/include/backend/hal-haptic-interface.h b/include/backend/hal-haptic-interface.h
deleted file mode 100644 (file)
index d0b8d4a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_HAPTIC_INTERFACE_H__
-#define __HAL_HAPTIC_INTERFACE_H__
-
-#include <hal/hal-common-interface.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Enumerations of unlimited duration for the Haptic Module API.
- */
-typedef enum {
-    HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
-} haptic_module_duration;
-
-typedef struct _hal_backend_haptic_funcs {
-       int (*get_device_count)(int *count);
-       int (*open_device)(int *dev_handle);
-       int (*close_device)(int dev_handle);
-       bool (*is_valid)(void);
-       int (*vibrate_monotone)(int device_handle, int duration, int frequency, int overdrive, int level, int intensity, int priority);
-       int (*stop_device)(int dev_handle);
-} hal_backend_haptic_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_HAPTIC_INTERFACE_H__ */
diff --git a/include/backend/hal-ir-interface.h b/include/backend/hal-ir-interface.h
deleted file mode 100644 (file)
index f311405..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_IR_INTERFACE_H__
-#define __HAL_IR_INTERFACE_H__
-
-#include "hal-ir.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _hal_backend_ir_funcs {
-       /* Control ir state */
-       int (*is_available)(bool *available);
-       int (*transmit)(int *frequency_pattern, int size);
-} hal_backend_ir_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_IR_INTERFACE_H__ */
diff --git a/include/backend/hal-led-interface.h b/include/backend/hal-led-interface.h
deleted file mode 100644 (file)
index d38bca1..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __HAL_LED_INTERFACE_H__
-#define __HAL_LED_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum led_type {
-       LED_TYPE_MANUAL,
-       LED_TYPE_BLINK,
-};
-
-enum led_device_type {
-       CAMERA_FRONT,
-       CAMERA_BACK,
-       NOTIFICATION,
-       TOUCH_KEY,
-};
-
-struct led_state {
-       /* Led type */
-       enum led_type type;
-       /**
-        * The first byte means opaque and the other 3 bytes are RGB values.
-        * You can use opaque byte as a led brightness value.
-        * If the first byte is 0x00, led will be turned off.
-        * Anything else will be worked as on. The max value is 0xFF.
-        */
-       unsigned int color;
-       /* Turn on time in milliseconds */
-       int duty_on;
-       /* Turn off time in milliseconds */
-       int duty_off;
-};
-
-struct keyled_state {
-       int keycode;
-       int brightness;
-};
-
-struct led_funcs {
-       /* Set led state */
-       int (*set_state)(enum led_device_type type, struct led_state *state);
-
-       /* Get led state */
-       int (*get_state)(enum led_device_type type, struct led_state **state);
-
-       /* Get led number */
-       int (*get_number)(void);
-
-       /* Set led number */
-       void (*set_num)(int number);
-
-       /* Get max led number */
-       int (*get_max_num)(void);
-
-       /* Set keyled state */
-       int (*keyled_set_state)(struct keyled_state *state);
-
-       /* Get keyled state */
-       int (*keyled_get_state)(int *keycode, int *brightness);
-};
-
-typedef struct _hal_backend_led_funcs {
-    struct led_funcs *camera_front;
-    struct led_funcs *camera_back;
-    struct led_funcs *notification;
-    struct led_funcs *touch_key;
-} hal_backend_led_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_LED_INTERFACE_H__ */
diff --git a/include/backend/hal-memory-interface.h b/include/backend/hal-memory-interface.h
deleted file mode 100644 (file)
index b29bffe..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_MEMORY_INTERFACE_H__
-#define __HAL_MEMORY_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct gpu_info {
-       int used_pages;
-};
-
-struct gem_info {
-       int rss;
-       int pss;
-};
-
-typedef struct __hal_backend_memory_funcs {
-       int (*get_gpu_info)(const int pid, struct gpu_info *info);
-       int (*get_gem_info)(const int pid, struct gem_info *info);
-} hal_backend_memory_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_MEMORY_INTERFACE_H__ */
diff --git a/include/backend/hal-thermal-interface.h b/include/backend/hal-thermal-interface.h
deleted file mode 100644 (file)
index 76fc3e6..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_TEMPERATURE_INTERFACE_H__
-#define __HAL_TEMPERATURE_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum
-{
-    HAL_DEVICE_THERMAL_AP,      /* AP temperature */
-    HAL_DEVICE_THERMAL_CP,      /* CP temperature */
-    HAL_DEVICE_THERMAL_BATTERY, /* Battery temperature */
-} hal_device_thermal_e;
-
-struct thermal_info {
-       int temp;
-       int adc;
-};
-
-typedef void (*ThermalUpdated)(struct thermal_info *info, void *data);
-
-typedef struct _hal_backend_thermal_funcs {
-       /* Get thermal state */
-       int (*get_info)(hal_device_thermal_e type, struct thermal_info *info);
-
-       /* Register thermal event */
-       int (*register_changed_event)(ThermalUpdated updated_cb, void *data);
-       int (*unregister_changed_event)(ThermalUpdated updated_cb);
-} hal_backend_thermal_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_TEMPERATURE_INTERFACE_H__ */
diff --git a/include/backend/hal-touchscreen-interface.h b/include/backend/hal-touchscreen-interface.h
deleted file mode 100644 (file)
index 040f481..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAL_TOUCHSCREEN_INTERFACE_H__
-#define __HAL_TOUCHSCREEN_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TOUCHSENSITIVITY_GLOVE_MODE_OFF  0     /* Disable glove mode */
-#define TOUCHSENSITIVITY_GLOVE_MODE_ON  1      /* Enable glove mode */
-
-enum touchscreen_state {
-       TOUCHSCREEN_OFF,     /* Disable touchscreen */
-       TOUCHSCREEN_ON,      /* Enable touchscreen */
-};
-
-enum touchscreen_sensitivity_state {
-       GLOVE_MODE_OFF,     /* Disable glove mode */
-       GLOVE_MODE_ON,      /* Enable glove mode */
-};
-
-typedef struct _hal_backend_touchscreen_funcs {
-       /* Control touchscreen state */
-       int (*get_state)(enum touchscreen_state *state);
-       int (*set_state)(enum touchscreen_state state);
-       int (*get_powersaving)(int *state);
-       int (*set_powersaving)(int state);
-
-       /* Control touch sensitivity state */
-       int (*glove_mode_get_state)(int *state);
-       int (*glove_mode_set_state)(int state);
-} hal_backend_touchscreen_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_TOUCHSCREEN_INTERFACE_H__ */
diff --git a/include/hal-battery-interface.h b/include/hal-battery-interface.h
new file mode 100644 (file)
index 0000000..00d06b5
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_BATTERY_INTERFACE_H__
+#define __HAL_BATTERY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The id of this device
+ */
+#define BATTERY_HARDWARE_DEVICE_ID     "battery"
+
+#define POWER_SOURCE_NONE     "none"
+#define POWER_SOURCE_AC       "ac"
+#define POWER_SOURCE_USB      "usb"
+#define POWER_SOURCE_WIRELESS "wireless"
+
+struct battery_info {
+       char *name;
+       char *status;
+       char *health;
+       char *power_source;
+
+       int online;
+       int present;
+       int capacity;
+
+       int current_now;
+       int current_average;
+       int voltage_now;
+       int voltage_average;
+       int temperature;
+};
+
+typedef void (*BatteryUpdated)(struct battery_info *info, void *data);
+
+typedef struct _hal_backend_battery_funcs {
+       /* Register battery event */
+       int (*register_changed_event)(BatteryUpdated updated_cb, void *data);
+       void (*unregister_changed_event)(BatteryUpdated updated_cb);
+
+       /* Get current states */
+       int (*get_current_state)(BatteryUpdated updated_cb, void *data);
+} hal_backend_battery_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_BATTERY_INTERFACE_H__ */
diff --git a/include/hal-bezel-interface.h b/include/hal-bezel-interface.h
new file mode 100644 (file)
index 0000000..5b0154e
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_BEZEL_INTERFACE_H__
+#define __HAL_BEZEL_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum bezel_state {
+       BEZEL_TURNOFF = 0,
+       BEZEL_TURNON,
+};
+
+enum bezel_vib_state {
+       BEZEL_VIB_NONE = 0,
+       BEZEL_VIB_LIGHT,
+       BEZEL_VIB_MEDIUM,
+       BEZEL_VIB_STRONG,
+};
+
+typedef struct _hal_backend_bezel_funcs {
+       /* Control hardware bezel state */
+       int (*get_state)(enum bezel_state *state);
+       int (*set_state)(enum bezel_state state);
+       /* Control software bezel state */
+       int (*get_sw_state)(enum bezel_state *state);
+       int (*set_sw_state)(enum bezel_state state);
+
+       /* Control bezel vibration state */
+       int (*get_vib_state)(enum bezel_vib_state *state);
+       int (*set_vib_state)(enum bezel_vib_state state);
+} hal_backend_bezel_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_BEZEL_INTERFACE_H__ */
diff --git a/include/hal-board-interface.h b/include/hal-board-interface.h
new file mode 100644 (file)
index 0000000..3226597
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_BOARD_INTERFACE_H__
+#define __HAL_BOARD_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _hal_backend_board_funcs {
+       /* Serial number of this device */
+       int (*get_device_serial_number)(char *buffer, const int max_len);
+       int (*get_device_revision)(int *revision);
+
+       int (*set_boot_success)(void);
+       int (*clear_boot_mode)(void);
+       int (*get_boot_mode)(char *buffer, const int max_len);
+       int (*get_boot_reason)(char *buffer, const int max_len);
+
+       int (*get_current_partition)(char *partition_ab);
+       int (*switch_partition)(char partition_ab);
+       int (*set_partition_ab_cloned)(void);
+       int (*clear_partition_ab_cloned)(void);
+       int (*get_partition_ab_cloned)(int *cloned);
+       int (*set_partition_status)(char partition_ab, const char *status);
+       int (*get_partition_status)(char partition_ab, char *buffer, const int max_len);
+
+       int (*set_upgrade_status)(int status);
+       int (*get_upgrade_status)(int *status);
+
+} hal_backend_board_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_BOARD_INTERFACE_H__ */
diff --git a/include/hal-device-input-interface.h b/include/hal-device-input-interface.h
new file mode 100644 (file)
index 0000000..c67dca0
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HAL_DEVICE_INPUT_INTERFACE_H__
+#define __HAL_DEVICE_INPUT_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+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_TOUCHSCREEN, /**< Input device type which is touchscreen-type */
+
+       HAL_DEVICE_INPUT_TYPE_CUSTOM_KNOB = 1000, /**< Input device type which is customed knob-type */
+} hal_device_input_type;
+
+typedef struct _hal_backend_device_input_funcs {
+       /* Control input device event */
+       int (*set_event_state)(int input_device_id, int on);
+       int (*get_event_state)(int input_device_id, int* on);
+} hal_backend_device_input_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_INPUT_INTERFACE_H__ */
diff --git a/include/hal-device-power-interface.h b/include/hal-device-power-interface.h
new file mode 100644 (file)
index 0000000..275869b
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HAL_DEVICE_POWER_INTERFACE_H__
+#define __HAL_DEVICE_POWER_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum hal_device_power_transition_reason {
+       HAL_DEVICE_POWER_TRANSITION_REASON_UNKNOWN,
+       HAL_DEVICE_POWER_TRANSITION_REASON_POWER_KEY,
+       HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_UP_KEY,
+       HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_DOWN_KEY,
+       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_NORMAL_LEVEL,
+       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_WARNING_LEVEL,
+       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_CRITICAL_LEVEL,
+       HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_POWEROFF_LEVEL,
+       HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF,
+       HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT,
+       HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_KEY,
+       HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_SCREEN,
+       HAL_DEVICE_POWER_TRANSITION_REASON_USB,
+       HAL_DEVICE_POWER_TRANSITION_REASON_CHARGER,
+       HAL_DEVICE_POWER_TRANSITION_REASON_HDMI,
+       HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_PORT,
+       HAL_DEVICE_POWER_TRANSITION_REASON_EMBEDDED_DISPLAY_PORT,
+       HAL_DEVICE_POWER_TRANSITION_REASON_WIFI,
+       HAL_DEVICE_POWER_TRANSITION_REASON_BLUETOOTH,
+       HAL_DEVICE_POWER_TRANSITION_REASON_NFC,
+       HAL_DEVICE_POWER_TRANSITION_REASON_TELEPHONY,
+       HAL_DEVICE_POWER_TRANSITION_REASON_ZIGBEE,
+       HAL_DEVICE_POWER_TRANSITION_REASON_ETHERNET,
+       HAL_DEVICE_POWER_TRANSITION_REASON_AUDIO,
+       HAL_DEVICE_POWER_TRANSITION_REASON_ALARM,
+       HAL_DEVICE_POWER_TRANSITION_REASON_SENSOR,
+       HAL_DEVICE_POWER_TRANSITION_REASON_RTC,
+       HAL_DEVICE_POWER_TRANSITION_REASON_HEADSET,
+       HAL_DEVICE_POWER_TRANSITION_REASON_EXTERNAL_MEMORY,
+
+       HAL_DEVICE_POWER_TRANSITION_REASON_CUSTOM = 1000,       /**< Define custom reason from here */
+};
+
+typedef struct _hal_backend_device_power_funcs {
+       int (*get_wakeup_reason)(enum hal_device_power_transition_reason *reason);
+} hal_backend_device_power_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_POWER_INTERFACE_H__ */
diff --git a/include/hal-display-interface.h b/include/hal-display-interface.h
new file mode 100644 (file)
index 0000000..ab28c2f
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_DISPLAY_INTERFACE_H__
+#define __HAL_DISPLAY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum display_state {
+       DISPLAY_ON,       /* In use */
+       DISPLAY_STANDBY,  /* Blanked, low power */
+       DISPLAY_SUSPEND,  /* Blanked, lower power */
+       DISPLAY_OFF,      /* Shut off, awaiting activity */
+       DISPLAY_DETACH,   /* Detached display at runtime */
+};
+
+enum display_image_effect {
+       DISPLAY_IMAGE_EFFECT_STANDARD,     /* No effect */
+       DISPLAY_IMAGE_EFFECT_NEGATIVE,         /* Negative effect */
+       DISPLAY_IMAGE_EFFECT_GREY,             /* Grey effect */
+       DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE,    /* Grey Negative effect */
+       DISPLAY_IMAGE_EFFECT_MAX,
+};
+
+enum display_panel_mode {
+       DISPLAY_PANEL_MODE_STANDARD,      /* Standard mode */
+       DISPLAY_PANEL_MODE_OUTDOOR,       /* Outdoor mode */
+       DISPLAY_PANEL_MODE_CONTENTS,      /* Contents adaptive brightness control mode */
+       DISPLAY_PANEL_MODE_LOWPOWER,      /* Low power mode */
+};
+
+enum display_aod_mode {
+       DISPLAY_AOD_MODE_OFF,
+       DISPLAY_AOD_MODE_ON,
+};
+
+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,
+};
+
+enum hal_device_display_rotation_angle {
+       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN = -1,
+       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 = 0,
+       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 = 90,
+       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 = 180,
+       HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 = 270,
+};
+
+enum hal_device_display_rotation_direction {
+       HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
+       HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
+};
+
+typedef struct _hal_backend_display_funcs {
+       /* Control display brightness */
+       int (*get_max_brightness)(int *brightness);
+       int (*get_brightness)(int *brightness);
+       int (*set_brightness)(int brightness);
+       int (*set_multi_brightness)(int brightness, int step, int delay);
+
+       /* Control display brightness by sensor */
+       int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);
+
+       /* Control display state */
+       int (*get_state)(enum display_state *state);
+       int (*set_state)(enum display_state state);
+
+       /* Control image effect */
+       int (*get_image_effect)(enum display_image_effect *effect);
+       int (*set_image_effect)(enum display_image_effect effect);
+
+       /* Control panel mode */
+       int (*get_panel_mode)(enum display_panel_mode *mode);
+       int (*set_panel_mode)(enum display_panel_mode mode);
+
+       /* Control AOD mode */
+       int (*get_aod_mode)(enum display_aod_mode *mode);
+
+       /* Control AOD brightness */
+       int (*get_aod_brightness)(int *max, int *normal, int *min, int *charging);
+
+       /* Control display frame rate */
+       int (*get_max_frame_rate)(int *rate);
+       int (*get_min_frame_rate)(int *rate);
+       int (*get_frame_rate)(int *rate);
+       int (*set_frame_rate)(int rate);
+
+       /* Control display white balance */
+       int (*set_white_balance)(enum hal_display_white_balance, int value);
+       int (*get_white_balance)(enum hal_display_white_balance, int *value);
+
+       /* 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;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DISPLAY_INTERFACE_H__ */
diff --git a/include/hal-external_connection-interface.h b/include/hal-external_connection-interface.h
new file mode 100644 (file)
index 0000000..3f5a6bf
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
+#define __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EXTERNAL_CONNECTION_USB       "USB"
+#define EXTERNAL_CONNECTION_USB_HOST  "USB-HOST"
+#define EXTERNAL_CONNECTION_TA        "TA"
+#define EXTERNAL_CONNECTION_HDMI      "HDMI"
+#define EXTERNAL_CONNECTION_DOCK      "Dock"
+#define EXTERNAL_CONNECTION_MIC       "Microphone"
+#define EXTERNAL_CONNECTION_HEADPHONE "Headphone"
+
+struct connection_info {
+       char *name;
+       char *state;
+       int flags;
+};
+
+typedef void (*ConnectionUpdated)(struct connection_info *info, void *data);
+
+typedef struct _hal_backend_external_connection_funcs {
+       /* Register external_connection event */
+       int (*register_changed_event)(ConnectionUpdated updated_cb, void *data);
+       void (*unregister_changed_event)(ConnectionUpdated updated_cb);
+
+       /* Get current states */
+       int (*get_current_state)(ConnectionUpdated updated_cb, void *data);
+} hal_backend_external_connection_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_EXTERNAL_CONNECTION_INTERFACE_H__ */
diff --git a/include/hal-haptic-interface.h b/include/hal-haptic-interface.h
new file mode 100644 (file)
index 0000000..d0b8d4a
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_HAPTIC_INTERFACE_H__
+#define __HAL_HAPTIC_INTERFACE_H__
+
+#include <hal/hal-common-interface.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Enumerations of unlimited duration for the Haptic Module API.
+ */
+typedef enum {
+    HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
+} haptic_module_duration;
+
+typedef struct _hal_backend_haptic_funcs {
+       int (*get_device_count)(int *count);
+       int (*open_device)(int *dev_handle);
+       int (*close_device)(int dev_handle);
+       bool (*is_valid)(void);
+       int (*vibrate_monotone)(int device_handle, int duration, int frequency, int overdrive, int level, int intensity, int priority);
+       int (*stop_device)(int dev_handle);
+} hal_backend_haptic_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_HAPTIC_INTERFACE_H__ */
diff --git a/include/hal-ir-interface.h b/include/hal-ir-interface.h
new file mode 100644 (file)
index 0000000..f311405
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_IR_INTERFACE_H__
+#define __HAL_IR_INTERFACE_H__
+
+#include "hal-ir.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _hal_backend_ir_funcs {
+       /* Control ir state */
+       int (*is_available)(bool *available);
+       int (*transmit)(int *frequency_pattern, int size);
+} hal_backend_ir_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_IR_INTERFACE_H__ */
diff --git a/include/hal-led-interface.h b/include/hal-led-interface.h
new file mode 100644 (file)
index 0000000..d38bca1
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HAL_LED_INTERFACE_H__
+#define __HAL_LED_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum led_type {
+       LED_TYPE_MANUAL,
+       LED_TYPE_BLINK,
+};
+
+enum led_device_type {
+       CAMERA_FRONT,
+       CAMERA_BACK,
+       NOTIFICATION,
+       TOUCH_KEY,
+};
+
+struct led_state {
+       /* Led type */
+       enum led_type type;
+       /**
+        * The first byte means opaque and the other 3 bytes are RGB values.
+        * You can use opaque byte as a led brightness value.
+        * If the first byte is 0x00, led will be turned off.
+        * Anything else will be worked as on. The max value is 0xFF.
+        */
+       unsigned int color;
+       /* Turn on time in milliseconds */
+       int duty_on;
+       /* Turn off time in milliseconds */
+       int duty_off;
+};
+
+struct keyled_state {
+       int keycode;
+       int brightness;
+};
+
+struct led_funcs {
+       /* Set led state */
+       int (*set_state)(enum led_device_type type, struct led_state *state);
+
+       /* Get led state */
+       int (*get_state)(enum led_device_type type, struct led_state **state);
+
+       /* Get led number */
+       int (*get_number)(void);
+
+       /* Set led number */
+       void (*set_num)(int number);
+
+       /* Get max led number */
+       int (*get_max_num)(void);
+
+       /* Set keyled state */
+       int (*keyled_set_state)(struct keyled_state *state);
+
+       /* Get keyled state */
+       int (*keyled_get_state)(int *keycode, int *brightness);
+};
+
+typedef struct _hal_backend_led_funcs {
+    struct led_funcs *camera_front;
+    struct led_funcs *camera_back;
+    struct led_funcs *notification;
+    struct led_funcs *touch_key;
+} hal_backend_led_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_LED_INTERFACE_H__ */
diff --git a/include/hal-memory-interface.h b/include/hal-memory-interface.h
new file mode 100644 (file)
index 0000000..b29bffe
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_MEMORY_INTERFACE_H__
+#define __HAL_MEMORY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct gpu_info {
+       int used_pages;
+};
+
+struct gem_info {
+       int rss;
+       int pss;
+};
+
+typedef struct __hal_backend_memory_funcs {
+       int (*get_gpu_info)(const int pid, struct gpu_info *info);
+       int (*get_gem_info)(const int pid, struct gem_info *info);
+} hal_backend_memory_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_MEMORY_INTERFACE_H__ */
diff --git a/include/hal-thermal-interface.h b/include/hal-thermal-interface.h
new file mode 100644 (file)
index 0000000..76fc3e6
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_TEMPERATURE_INTERFACE_H__
+#define __HAL_TEMPERATURE_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+    HAL_DEVICE_THERMAL_AP,      /* AP temperature */
+    HAL_DEVICE_THERMAL_CP,      /* CP temperature */
+    HAL_DEVICE_THERMAL_BATTERY, /* Battery temperature */
+} hal_device_thermal_e;
+
+struct thermal_info {
+       int temp;
+       int adc;
+};
+
+typedef void (*ThermalUpdated)(struct thermal_info *info, void *data);
+
+typedef struct _hal_backend_thermal_funcs {
+       /* Get thermal state */
+       int (*get_info)(hal_device_thermal_e type, struct thermal_info *info);
+
+       /* Register thermal event */
+       int (*register_changed_event)(ThermalUpdated updated_cb, void *data);
+       int (*unregister_changed_event)(ThermalUpdated updated_cb);
+} hal_backend_thermal_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_TEMPERATURE_INTERFACE_H__ */
diff --git a/include/hal-touchscreen-interface.h b/include/hal-touchscreen-interface.h
new file mode 100644 (file)
index 0000000..040f481
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_TOUCHSCREEN_INTERFACE_H__
+#define __HAL_TOUCHSCREEN_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TOUCHSENSITIVITY_GLOVE_MODE_OFF  0     /* Disable glove mode */
+#define TOUCHSENSITIVITY_GLOVE_MODE_ON  1      /* Enable glove mode */
+
+enum touchscreen_state {
+       TOUCHSCREEN_OFF,     /* Disable touchscreen */
+       TOUCHSCREEN_ON,      /* Enable touchscreen */
+};
+
+enum touchscreen_sensitivity_state {
+       GLOVE_MODE_OFF,     /* Disable glove mode */
+       GLOVE_MODE_ON,      /* Enable glove mode */
+};
+
+typedef struct _hal_backend_touchscreen_funcs {
+       /* Control touchscreen state */
+       int (*get_state)(enum touchscreen_state *state);
+       int (*set_state)(enum touchscreen_state state);
+       int (*get_powersaving)(int *state);
+       int (*set_powersaving)(int state);
+
+       /* Control touch sensitivity state */
+       int (*glove_mode_get_state)(int *state);
+       int (*glove_mode_set_state)(int state);
+} hal_backend_touchscreen_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_TOUCHSCREEN_INTERFACE_H__ */