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>
#include <system_info.h>
#include "haltest.h"
-#include "hal-bezel.h"
+#include "hal-device-bezel.h"
class BEZEL : public testing::Test {
protected:
+++ /dev/null
-/*
- * 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__ */
+++ /dev/null
-/*
- * 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_H__
-#define __HAL_BEZEL_H__
-
-#include "hal-bezel-interface.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int hal_device_bezel_get_backend(void);
-int hal_device_bezel_put_backend(void);
-int hal_device_bezel_get_state(enum bezel_state *state);
-int hal_device_bezel_set_state(enum bezel_state state);
-int hal_device_bezel_get_sw_state(enum bezel_state *state);
-int hal_device_bezel_set_sw_state(enum bezel_state state);
-int hal_device_bezel_get_vib_state(enum bezel_state *state);
-int hal_device_bezel_set_vib_state(enum bezel_state state);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* __HAL_BEZEL_H__ */
--- /dev/null
+/*
+ * 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_DEVICE_BEZEL_INTERFACE_H__
+#define __HAL_DEVICE_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_device_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_device_bezel_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_BEZEL_INTERFACE_H__ */
--- /dev/null
+/*
+ * 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_DEVICE_BEZEL_H__
+#define __HAL_DEVICE_BEZEL_H__
+
+#include "hal-device-bezel-interface.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int hal_device_bezel_get_backend(void);
+int hal_device_bezel_put_backend(void);
+int hal_device_bezel_get_state(enum bezel_state *state);
+int hal_device_bezel_set_state(enum bezel_state state);
+int hal_device_bezel_get_sw_state(enum bezel_state *state);
+int hal_device_bezel_set_sw_state(enum bezel_state state);
+int hal_device_bezel_get_vib_state(enum bezel_state *state);
+int hal_device_bezel_set_vib_state(enum bezel_state state);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __HAL_DEVICE_BEZEL_H__ */
#include <stdio.h>
#include <hal/hal-common.h>
-#include "hal-bezel-interface.h"
+#include "hal-device-bezel-interface.h"
#include "common.h"
-static hal_backend_bezel_funcs *hal_bezel_funcs = NULL;
+static hal_backend_device_bezel_funcs *hal_device_bezel_funcs = NULL;
int hal_device_bezel_get_backend(void)
{
int ret;
- if (hal_bezel_funcs)
+ if (hal_device_bezel_funcs)
return 0;
- ret = hal_common_get_backend(HAL_MODULE_DEVICE_BEZEL, (void **)&hal_bezel_funcs);
+ ret = hal_common_get_backend(HAL_MODULE_DEVICE_BEZEL, (void **)&hal_device_bezel_funcs);
if (ret < 0) {
_E("Failed to get bezel backend");
return -EINVAL;
int hal_device_bezel_put_backend(void)
{
- if (!hal_bezel_funcs)
+ if (!hal_device_bezel_funcs)
return 0;
- hal_common_put_backend(HAL_MODULE_DEVICE_BEZEL, (void *)hal_bezel_funcs);
- hal_bezel_funcs = NULL;
+ hal_common_put_backend(HAL_MODULE_DEVICE_BEZEL, (void *)hal_device_bezel_funcs);
+ hal_device_bezel_funcs = NULL;
return 0;
}
{
int ret;
- if (!hal_bezel_funcs) {
+ if (!hal_device_bezel_funcs) {
if ((ret = hal_device_bezel_get_backend()) < 0)
return ret;
}
- if (!hal_bezel_funcs ||
- !hal_bezel_funcs->get_state)
+ if (!hal_device_bezel_funcs ||
+ !hal_device_bezel_funcs->get_state)
return -ENODEV;
- return hal_bezel_funcs->get_state(state);
+ return hal_device_bezel_funcs->get_state(state);
}
int hal_device_bezel_set_state(enum bezel_state state)
{
int ret;
- if (!hal_bezel_funcs) {
+ if (!hal_device_bezel_funcs) {
if ((ret = hal_device_bezel_get_backend()) < 0)
return ret;
}
- if (!hal_bezel_funcs ||
- !hal_bezel_funcs->set_state)
+ if (!hal_device_bezel_funcs ||
+ !hal_device_bezel_funcs->set_state)
return -ENODEV;
- return hal_bezel_funcs->set_state(state);
+ return hal_device_bezel_funcs->set_state(state);
}
int hal_device_bezel_get_sw_state(enum bezel_state *state)
{
int ret;
- if (!hal_bezel_funcs) {
+ if (!hal_device_bezel_funcs) {
if ((ret = hal_device_bezel_get_backend()) < 0)
return ret;
}
- if (!hal_bezel_funcs ||
- !hal_bezel_funcs->get_sw_state)
+ if (!hal_device_bezel_funcs ||
+ !hal_device_bezel_funcs->get_sw_state)
return -ENODEV;
- return hal_bezel_funcs->get_sw_state(state);
+ return hal_device_bezel_funcs->get_sw_state(state);
}
int hal_device_bezel_set_sw_state(enum bezel_state state)
{
int ret;
- if (!hal_bezel_funcs) {
+ if (!hal_device_bezel_funcs) {
if ((ret = hal_device_bezel_get_backend()) < 0)
return ret;
}
- if (!hal_bezel_funcs ||
- !hal_bezel_funcs->set_sw_state)
+ if (!hal_device_bezel_funcs ||
+ !hal_device_bezel_funcs->set_sw_state)
return -ENODEV;
- return hal_bezel_funcs->set_sw_state(state);
+ return hal_device_bezel_funcs->set_sw_state(state);
}
int hal_device_bezel_get_vib_state(enum bezel_vib_state *state)
{
int ret;
- if (!hal_bezel_funcs) {
+ if (!hal_device_bezel_funcs) {
if ((ret = hal_device_bezel_get_backend()) < 0)
return ret;
}
- if (!hal_bezel_funcs ||
- !hal_bezel_funcs->get_vib_state)
+ if (!hal_device_bezel_funcs ||
+ !hal_device_bezel_funcs->get_vib_state)
return -ENODEV;
- return hal_bezel_funcs->get_vib_state(state);
+ return hal_device_bezel_funcs->get_vib_state(state);
}
int hal_device_bezel_set_vib_state(enum bezel_vib_state state)
{
int ret;
- if (!hal_bezel_funcs) {
+ if (!hal_device_bezel_funcs) {
if ((ret = hal_device_bezel_get_backend()) < 0)
return ret;
}
- if (!hal_bezel_funcs ||
- !hal_bezel_funcs->set_vib_state)
+ if (!hal_device_bezel_funcs ||
+ !hal_device_bezel_funcs->set_vib_state)
return -ENODEV;
- return hal_bezel_funcs->set_vib_state(state);
+ return hal_device_bezel_funcs->set_vib_state(state);
}