From 4a99885731063078090b78460003a18b51a796fe Mon Sep 17 00:00:00 2001 From: taeyoung Date: Mon, 21 Nov 2016 19:26:27 +0900 Subject: thermal: add thermal HAL interface Change-Id: Ic614ce4ec06f710de2d96019360b7ec0b62ece9f Signed-off-by: taeyoung --- hw/thermal.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 hw/thermal.h diff --git a/hw/thermal.h b/hw/thermal.h new file mode 100644 index 0000000..8262a38 --- /dev/null +++ b/hw/thermal.h @@ -0,0 +1,66 @@ +/* + * libdevice-node + * + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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 __HW_THERMAL_H__ +#define __HW_THERMAL_H__ + +#include + +/** + * The id of this device + */ +#define THERMAL_HARDWARE_DEVICE_ID "thermal" + +/** + * The version of this device + */ +#define THERMAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1) + +typedef enum _thermal_state { + THERMAL_STATE_LOW, + THERMAL_STATE_NORMAL, + THERMAL_STATE_HIGH, +} thermal_state_e; + +typedef enum _thermal_level { + THERMAL_LEVEL_NORMAL = 1001, + THERMAL_LEVEL_WARNING, + THERMAL_LEVEL_CRITICAL, + THERMAL_LEVEL_POWEROFF, +} thermal_level_e; + +struct thermal_info { + thermal_state_e state; + thermal_level_e level; +}; + +typedef void (*ThermalUpdated)(struct thermal_info *info, void *data); + +struct thermal_device { + struct hw_common common; + + /* Get thermal state */ + int (*get_state)(struct thermal_info *info); + + /* Register thermal event */ + int (*register_changed_event)(ThermalUpdated updated_cb, void *data); + int (*unregister_changed_event)(ThermalUpdated updated_cb); +}; + +#endif /* __HW_THERMAL_H__ */ -- cgit v1.2.3 From 1a390a1c5d09cf94ea0aa76038b959e965f4d86c Mon Sep 17 00:00:00 2001 From: taeyoung Date: Wed, 30 Nov 2016 17:02:08 +0900 Subject: display: add internal interface for display enhancement Change-Id: Ia6e66afdd517f9678c5dd2923c19cf5a7f7e54ee Signed-off-by: taeyoung --- hw/display_internal.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 hw/display_internal.h diff --git a/hw/display_internal.h b/hw/display_internal.h new file mode 100644 index 0000000..c07ba3b --- /dev/null +++ b/hw/display_internal.h @@ -0,0 +1,74 @@ +/* + * libdevice-node + * + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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. + */ + +/*******************************************/ +/* THIS IS THE HAL FOR EXPERIMENTAL USAGES */ +/*******************************************/ + + +#ifndef __HW_DISPLAY_INTERNAL_H__ +#define __HW_DISPLAY_INTERNAL_H__ + +#include + +/** + * The id of this device + */ +#define DISPLAY_INTERNAL_HARDWARE_DEVICE_ID "display_internal" + +/** + * The version of this device + */ +#define DISPLAY_INTERNAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,2) + +typedef enum display_internal_enhance_mode { + ENHANCE_MODE_NONE = 1001, + ENHANCE_MODE_DYNAMIC, + ENHANCE_MODE_STANDARD, + ENHANCE_MODE_NATURAL, + ENHANCE_MODE_GRAYSCALE, + ENHANCE_MODE_MOVIE, + ENHANCE_MODE_AUTO, +} display_internal_enhance_mode_e; + +typedef enum display_internal_enhance_scenario { + ENHANCE_SCENARIO_NONE = 2001, + ENHANCE_SCENARIO_NORMAL, + ENHANCE_SCENARIO_GALLERY, + ENHANCE_SCENARIO_VIDEO, + ENHANCE_SCENARIO_VTCALL, + ENHANCE_SCENARIO_CAMERA, + ENHANCE_SCENARIO_BROWSER, + ENHANCE_SCENARIO_NEGATIVE, + ENHANCE_SCENARIO_EMAIL, + ENHANCE_SCENARIO_EBOOK, + ENHANCE_SCENARIO_GRAYSCALE, +} display_intermal_enhance_scenario_e; + +struct display_internal_device { + struct hw_common common; + + int (*set_enhance_mode)(display_internal_enhance_mode_e mode); + int (*get_enhance_mode)(display_internal_enhance_mode_e *mode); + + int (*set_enhance_scenario)(display_internal_enhance_scenario_e scenario); + int (*get_enhance_scenario)(display_internal_enhance_scenario_e *scenario); + +}; + +#endif -- cgit v1.2.3 From 7788993aeace89d652c4fe66db1a9462096115cb Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Tue, 6 Dec 2016 19:12:11 +0900 Subject: device-node : remove unreachable code Change-Id: I590c995f69ab84e54fb7124a9e577673a97c2693 Signed-off-by: Kichan Kwon --- src/device-node.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/device-node.c b/src/device-node.c index 07ba917..3000a76 100644 --- a/src/device-node.c +++ b/src/device-node.c @@ -68,11 +68,6 @@ API int device_get_property(enum device_type devtype, int property, int *value) } dev = container_of(type, struct device, type); - if (dev == NULL) { - _E("device cannot find"); - errno = EPERM; - return -1; - } if (dev->get_prop == NULL) { _E("devtype doesn't have getter function"); @@ -109,11 +104,6 @@ API int device_set_property(enum device_type devtype, int property, int value) } dev = container_of(type, struct device, type); - if (dev == NULL) { - _E("device cannot find"); - errno = EPERM; - return -1; - } if (dev->set_prop == NULL) { _E("devtype doesn't have setter function"); -- cgit v1.2.3 From e9b546a48e051bfea154046df8fe483d1b0ad6bc Mon Sep 17 00:00:00 2001 From: taeyoung Date: Tue, 6 Dec 2016 18:36:50 +0900 Subject: display: add display enhance function for both mode and scenario Change-Id: I8bd596f6ec62dc2239a510151ee091a5023d4090 Signed-off-by: taeyoung --- hw/display_internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/display_internal.h b/hw/display_internal.h index c07ba3b..125f0d9 100644 --- a/hw/display_internal.h +++ b/hw/display_internal.h @@ -69,6 +69,11 @@ struct display_internal_device { int (*set_enhance_scenario)(display_internal_enhance_scenario_e scenario); int (*get_enhance_scenario)(display_internal_enhance_scenario_e *scenario); + int (*set_enhance)(display_internal_enhance_mode_e mode, + display_internal_enhance_scenario_e scenario); + int (*get_enhance)(display_internal_enhance_mode_e *mode, + display_internal_enhance_scenario_e *scenario); + }; #endif -- cgit v1.2.3 From 22be1ab827e676e97bf8f3a03b26155e60b15fdb Mon Sep 17 00:00:00 2001 From: taeyoung Date: Fri, 16 Dec 2016 15:51:13 +0900 Subject: cpu: add cpu HAL interfaces Currently cpu boosting related functions are added. Change-Id: I4f73ea6433711aff6c9b6d95d04ac3af07378b29 Signed-off-by: taeyoung --- hw/cpu.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 hw/cpu.h diff --git a/hw/cpu.h b/hw/cpu.h new file mode 100644 index 0000000..c35f0c8 --- /dev/null +++ b/hw/cpu.h @@ -0,0 +1,43 @@ +/* + * libdevice-node + * + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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 requcpued 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 __HW_CPU_H__ +#define __HW_CPU_H__ + +#include + +/** + * The id of this device + */ +#define CPU_HARDWARE_DEVICE_ID "cpu" + +/** + * The version of this device + */ +#define CPU_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1) + +struct cpu_device { + struct hw_common common; + + /* CPU boost */ + int (*start_boost)(void *data); + int (*stop_boost)(void *data); +}; + +#endif -- cgit v1.2.3