device-bezel: Fix incorrect module naming 48/309948/1
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 18 Apr 2024 02:58:42 +0000 (11:58 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Thu, 18 Apr 2024 02:58:42 +0000 (11:58 +0900)
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>
haltest/bezel.cpp
include/hal-bezel-interface.h [deleted file]
include/hal-bezel.h [deleted file]
include/hal-device-bezel-interface.h [new file with mode: 0644]
include/hal-device-bezel.h [new file with mode: 0644]
src/bezel.c

index c6be72c16b250c37fa108dc70b84a6a7132c5aa2..2f6eb62dac26a5441670e949d89d6a53dccf31c3 100644 (file)
@@ -1,7 +1,7 @@
 #include <system_info.h>
 
 #include "haltest.h"
-#include "hal-bezel.h"
+#include "hal-device-bezel.h"
 
 class BEZEL : public testing::Test {
        protected:
diff --git a/include/hal-bezel-interface.h b/include/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/hal-bezel.h b/include/hal-bezel.h
deleted file mode 100644 (file)
index bad7f79..0000000
+++ /dev/null
@@ -1,41 +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_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__ */
diff --git a/include/hal-device-bezel-interface.h b/include/hal-device-bezel-interface.h
new file mode 100644 (file)
index 0000000..0ccfda9
--- /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_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__ */
diff --git a/include/hal-device-bezel.h b/include/hal-device-bezel.h
new file mode 100644 (file)
index 0000000..15c20ab
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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__ */
index 768354532768afd9f08be0e51b0f44cd3608c25b..4f0edd98d9842b89af04fca4bd20777a294e5511 100644 (file)
 #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;
@@ -40,11 +40,11 @@ int hal_device_bezel_get_backend(void)
 
 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;
 }
@@ -53,95 +53,95 @@ int hal_device_bezel_get_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_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);
 }