#include <system_info.h>
#include "haltest.h"
-#include "hal-touchscreen.h"
+#include "hal-device-touchscreen.h"
class TOUCHSCREEN : public testing::Test
{
protected:
static void SetUpHalTestSuite() {
int ret_val, val;
- enum touchscreen_state state;
+ hal_device_touchscreen_state_e state;
ret_val = hal_device_touchscreen_get_backend();
ASSERT_EQ(ret_val, 0) << strerr("Failed to get touchscreeen backend", ret_val);
static void TearDownHalTestSuite() {
if (TOUCHSCREEN::orig_state != -1)
- hal_device_touchscreen_set_state((enum touchscreen_state)TOUCHSCREEN::orig_state);
+ hal_device_touchscreen_set_state((hal_device_touchscreen_state_e)TOUCHSCREEN::orig_state);
if (TOUCHSCREEN::orig_powersaving != -1)
hal_device_touchscreen_set_powersaving(TOUCHSCREEN::orig_powersaving);
if (TOUCHSCREEN::orig_glove_mode != -1)
TEST_F(TOUCHSCREEN, GetStateP)
{
int ret_val;
- enum touchscreen_state state;
+ hal_device_touchscreen_state_e state;
if (!TOUCHSCREEN::supported) {
SKIP_MESSAGE("Touchscreen not supported");
TEST_F(TOUCHSCREEN, SetStateP)
{
int ret_val;
- enum touchscreen_state state;
+ hal_device_touchscreen_state_e state;
if (!TOUCHSCREEN::supported) {
return;
}
- ret_val = hal_device_touchscreen_set_state(TOUCHSCREEN_OFF);
+ ret_val = hal_device_touchscreen_set_state(HAL_DEVICE_TOUCHSCREEN_OFF);
if (ret_val == -ENODEV) {
SKIP_MESSAGE("Not supported HAL");
return;
return;
}
EXPECT_EQ(ret_val, 0) << strerr("Failed to get touchscreen state", ret_val);
- EXPECT_EQ(state, TOUCHSCREEN_OFF) << "Failed to set touchscreen state";
+ EXPECT_EQ(state, HAL_DEVICE_TOUCHSCREEN_OFF) << "Failed to set touchscreen state";
- ret_val = hal_device_touchscreen_set_state(TOUCHSCREEN_ON);
+ ret_val = hal_device_touchscreen_set_state(HAL_DEVICE_TOUCHSCREEN_ON);
if (ret_val == -ENODEV) {
SKIP_MESSAGE("Not supported HAL");
return;
return;
}
EXPECT_EQ(ret_val, 0) << strerr("Failed to get touchscreen state", ret_val);
- EXPECT_EQ(state, TOUCHSCREEN_ON) << "Failed to set touchscreen state";
+ EXPECT_EQ(state, HAL_DEVICE_TOUCHSCREEN_ON) << "Failed to set touchscreen state";
// restore
if (TOUCHSCREEN::orig_state != -1)
- hal_device_touchscreen_set_state((enum touchscreen_state)TOUCHSCREEN::orig_state);
+ hal_device_touchscreen_set_state((hal_device_touchscreen_state_e)TOUCHSCREEN::orig_state);
}
TEST_F(TOUCHSCREEN, GetPowersavingP)
// restore
if (TOUCHSCREEN::orig_powersaving != -1)
- hal_device_touchscreen_set_powersaving((enum touchscreen_state)TOUCHSCREEN::orig_powersaving);
+ hal_device_touchscreen_set_powersaving((hal_device_touchscreen_state_e)TOUCHSCREEN::orig_powersaving);
}
TEST_F(TOUCHSCREEN, GetGloveModeStateP)
return;
}
- ret_val = hal_device_touchscreen_glove_mode_set_state((int)GLOVE_MODE_OFF);
+ ret_val = hal_device_touchscreen_glove_mode_set_state((int)HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_OFF);
if (ret_val == -ENODEV) {
SKIP_MESSAGE("Not supported HAL");
return;
return;
}
EXPECT_EQ(ret_val, 0) << strerr("Failed to get glove mode", ret_val);
- EXPECT_EQ(glove_mode, (int)GLOVE_MODE_OFF) << "Failed to set glove mode";
+ EXPECT_EQ(glove_mode, (int)HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_OFF) << "Failed to set glove mode";
- ret_val = hal_device_touchscreen_glove_mode_set_state((int)GLOVE_MODE_ON);
+ ret_val = hal_device_touchscreen_glove_mode_set_state((int)HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_ON);
if (ret_val == -ENODEV) {
SKIP_MESSAGE("Not supported HAL");
return;
return;
}
EXPECT_EQ(ret_val, 0) << strerr("Failed to get glove mode", ret_val);
- EXPECT_EQ(glove_mode, (int)GLOVE_MODE_ON) << "Failed to set glove mode";
+ EXPECT_EQ(glove_mode, (int)HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_ON) << "Failed to set glove mode";
// restore
if (TOUCHSCREEN::orig_glove_mode != -1)
--- /dev/null
+/*
+ * Copyright (c) 2024 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_TOUCHSCREEN_INTERFACE_1_H__
+#define __HAL_DEVICE_TOUCHSCREEN_INTERFACE_1_H__
+
+#include "hal-device-touchscreen-types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _hal_backend_device_touchscreen_funcs {
+ /* Control touchscreen state */
+ int (*get_state)(hal_device_touchscreen_state_e *state);
+ int (*set_state)(hal_device_touchscreen_state_e 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_device_touchscreen_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_TOUCHSCREEN_INTERFACE_H__1_ */
--- /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_TOUCHSCREEN_INTERFACE_H__
+#define __HAL_DEVICE_TOUCHSCREEN_INTERFACE_H__
+
+#include "hal-device-touchscreen-types.h"
+#include "hal-device-touchscreen-interface-1.h"
+
+#endif /* __HAL_DEVICE_TOUCHSCREEN_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2024 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_TOUCHSCREEN_TYPES_H__
+#define __HAL_DEVICE_TOUCHSCREEN_TYPES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* FIXME: These macros should be changed to enum type */
+#define TOUCHSENSITIVITY_GLOVE_MODE_OFF 0 /* Disable glove mode */
+#define TOUCHSENSITIVITY_GLOVE_MODE_ON 1 /* Enable glove mode */
+
+/**
+ * @brief Enumeration for touchscreen state.
+ * @since HAL_MODULE_DEVICE_TOUCHSCREEN 1.0
+ */
+typedef enum {
+ HAL_DEVICE_TOUCHSCREEN_OFF, /* Disable touchscreen (Since HAL_MODULE_DEVICE_TOUCHSCREEN 1.0) */
+ HAL_DEVICE_TOUCHSCREEN_ON, /* Enable touchscreen (Since HAL_MODULE_DEVICE_TOUCHSCREEN 1.0) */
+} hal_device_touchscreen_state_e;
+
+/**
+ * @brief Enumeration for touchscreen sensitivity state.
+ * @since HAL_MODULE_DEVICE_TOUCHSCREEN 1.0
+ */
+typedef enum {
+ HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_OFF, /* Disable glove mode (Since HAL_MODULE_DEVICE_TOUCHSCREEN 1.0) */
+ HAL_DEVICE_TOUCHSCREEN_GLOVE_MODE_ON, /* Enable glove mode (Since HAL_MODULE_DEVICE_TOUCHSCREEN 1.0) */
+} hal_device_touchscreen_sensitivity_state_e;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_TOUCHSCREEN_TYPES_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_TOUCHSCREEN_H__
+#define __HAL_DEVICE_TOUCHSCREEN_H__
+
+#include <hal/hal-common.h>
+#include "hal-device-touchscreen-interface.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int hal_device_touchscreen_get_backend(void);
+int hal_device_touchscreen_put_backend(void);
+int hal_device_touchscreen_get_state(hal_device_touchscreen_state_e *state);
+int hal_device_touchscreen_set_state(hal_device_touchscreen_state_e state);
+int hal_device_touchscreen_get_powersaving(int *state);
+int hal_device_touchscreen_set_powersaving(int state);
+int hal_device_touchscreen_glove_mode_get_state(int *state);
+int hal_device_touchscreen_glove_mode_set_state(int state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __HAL_DEVICE_TOUCHSCREEN_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_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__ */
+++ /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_TOUCHSCREEN_H__
-#define __HAL_TOUCHSCREEN_H__
-
-#include <hal/hal-common.h>
-#include "hal-touchscreen-interface.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int hal_device_touchscreen_get_backend(void);
-int hal_device_touchscreen_put_backend(void);
-int hal_device_touchscreen_get_state(enum touchscreen_state *state);
-int hal_device_touchscreen_set_state(enum touchscreen_state state);
-int hal_device_touchscreen_get_powersaving(int *state);
-int hal_device_touchscreen_set_powersaving(int state);
-int hal_device_touchscreen_glove_mode_get_state(int *state);
-int hal_device_touchscreen_glove_mode_set_state(int state);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __HAL_TOUCHSCREEN_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.
+ */
+#include <stdlib.h>
+
+#include <stdio.h>
+#include <hal/hal-common.h>
+
+#include "hal-device-touchscreen-interface.h"
+#include "common.h"
+
+static hal_backend_device_touchscreen_funcs *hal_device_touchscreen_funcs = NULL;
+
+int hal_device_touchscreen_get_backend(void)
+{
+ int ret;
+
+ if (hal_device_touchscreen_funcs)
+ return 0;
+
+ hal_device_touchscreen_funcs = calloc(1, sizeof(hal_backend_device_touchscreen_funcs));
+ if (!hal_device_touchscreen_funcs)
+ return -ENOMEM;
+
+ ret = hal_common_get_backend(HAL_MODULE_DEVICE_TOUCHSCREEN, (void **)&hal_device_touchscreen_funcs);
+ if (ret < 0) {
+ _E("Failed to get device-touchscreen backend");
+ free(hal_device_touchscreen_funcs);
+ hal_device_touchscreen_funcs = NULL;
+ return -ENOTSUP;
+ }
+
+ return 0;
+}
+
+int hal_device_touchscreen_put_backend(void)
+{
+ int ret = 0;
+
+ if (!hal_device_touchscreen_funcs)
+ return 0;
+
+ ret = hal_common_put_backend(HAL_MODULE_DEVICE_TOUCHSCREEN, (void *)hal_device_touchscreen_funcs);
+ if (ret < 0) {
+ _E("Failed to put device-touchscreen backend");
+ return ret;
+ }
+
+ free(hal_device_touchscreen_funcs);
+ hal_device_touchscreen_funcs = NULL;
+
+ return 0;
+}
+
+
+int hal_device_touchscreen_get_state(hal_device_touchscreen_state_e *state)
+{
+ int ret;
+
+ if (!state)
+ return -EINVAL;
+
+ if (!hal_device_touchscreen_funcs) {
+ if ((ret = hal_device_touchscreen_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_device_touchscreen_funcs ||
+ !hal_device_touchscreen_funcs->get_state)
+ return -ENOTSUP;
+
+ return hal_device_touchscreen_funcs->get_state(state);
+}
+
+int hal_device_touchscreen_set_state(hal_device_touchscreen_state_e state)
+{
+ int ret;
+
+ if (!hal_device_touchscreen_funcs) {
+ if ((ret = hal_device_touchscreen_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_device_touchscreen_funcs ||
+ !hal_device_touchscreen_funcs->set_state)
+ return -ENOTSUP;
+
+ return hal_device_touchscreen_funcs->set_state(state);
+}
+
+int hal_device_touchscreen_get_powersaving(int *state)
+{
+ int ret;
+
+ if (!state)
+ return -EINVAL;
+
+ if (!hal_device_touchscreen_funcs) {
+ if ((ret = hal_device_touchscreen_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_device_touchscreen_funcs ||
+ !hal_device_touchscreen_funcs->get_powersaving)
+ return -ENOTSUP;
+
+ return hal_device_touchscreen_funcs->get_powersaving(state);
+}
+
+int hal_device_touchscreen_set_powersaving(int state)
+{
+ int ret;
+
+ if (!hal_device_touchscreen_funcs) {
+ if ((ret = hal_device_touchscreen_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_device_touchscreen_funcs ||
+ !hal_device_touchscreen_funcs->set_powersaving)
+ return -ENOTSUP;
+
+ return hal_device_touchscreen_funcs->set_powersaving(state);
+}
+
+int hal_device_touchscreen_glove_mode_get_state(int *state)
+{
+ int ret;
+
+ if (!state)
+ return -EINVAL;
+
+ if (!hal_device_touchscreen_funcs) {
+ if ((ret = hal_device_touchscreen_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_device_touchscreen_funcs ||
+ !hal_device_touchscreen_funcs->glove_mode_get_state)
+ return -ENOTSUP;
+
+ return hal_device_touchscreen_funcs->glove_mode_get_state(state);
+}
+
+int hal_device_touchscreen_glove_mode_set_state(int state)
+{
+ int ret;
+
+ if (!hal_device_touchscreen_funcs) {
+ if ((ret = hal_device_touchscreen_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_device_touchscreen_funcs ||
+ !hal_device_touchscreen_funcs->glove_mode_set_state)
+ return -ENOTSUP;
+
+ return hal_device_touchscreen_funcs->glove_mode_set_state(state);
+}
+++ /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.
- */
-
-
-#include <stdio.h>
-#include <hal/hal-common.h>
-
-#include "hal-touchscreen-interface.h"
-#include "common.h"
-
-static hal_backend_touchscreen_funcs *hal_touchscreen_funcs = NULL;
-
-int hal_device_touchscreen_get_backend(void)
-{
- int ret;
-
- if (hal_touchscreen_funcs)
- return 0;
-
- ret = hal_common_get_backend(HAL_MODULE_DEVICE_TOUCHSCREEN, (void **)&hal_touchscreen_funcs);
- if (ret < 0) {
- _E("Failed to get touchscreen backend");
- return -EINVAL;
- }
-
- return 0;
-}
-
-int hal_device_touchscreen_put_backend(void)
-{
- if (!hal_touchscreen_funcs)
- return 0;
-
- hal_common_put_backend(HAL_MODULE_DEVICE_TOUCHSCREEN, (void *)hal_touchscreen_funcs);
- hal_touchscreen_funcs = NULL;
-
- return 0;
-}
-
-
-int hal_device_touchscreen_get_state(enum touchscreen_state *state)
-{
- int ret;
-
- if (!hal_touchscreen_funcs) {
- if ((ret = hal_device_touchscreen_get_backend()) < 0)
- return ret;
- }
-
- if (!hal_touchscreen_funcs ||
- !hal_touchscreen_funcs->get_state)
- return -ENODEV;
-
- return hal_touchscreen_funcs->get_state(state);
-}
-
-int hal_device_touchscreen_set_state(enum touchscreen_state state)
-{
- int ret;
-
- if (!hal_touchscreen_funcs) {
- if ((ret = hal_device_touchscreen_get_backend()) < 0)
- return ret;
- }
-
- if (!hal_touchscreen_funcs ||
- !hal_touchscreen_funcs->set_state)
- return -ENODEV;
-
- return hal_touchscreen_funcs->set_state(state);
-}
-
-int hal_device_touchscreen_get_powersaving(int *state)
-{
- int ret;
-
- if (!hal_touchscreen_funcs) {
- if ((ret = hal_device_touchscreen_get_backend()) < 0)
- return ret;
- }
-
- if (!hal_touchscreen_funcs ||
- !hal_touchscreen_funcs->get_powersaving)
- return -ENODEV;
-
- return hal_touchscreen_funcs->get_powersaving(state);
-}
-
-int hal_device_touchscreen_set_powersaving(int state)
-{
- int ret;
-
- if (!hal_touchscreen_funcs) {
- if ((ret = hal_device_touchscreen_get_backend()) < 0)
- return ret;
- }
-
- if (!hal_touchscreen_funcs ||
- !hal_touchscreen_funcs->set_powersaving)
- return -ENODEV;
-
- return hal_touchscreen_funcs->set_powersaving(state);
-}
-
-int hal_device_touchscreen_glove_mode_get_state(int *state)
-{
- int ret;
-
- if (!hal_touchscreen_funcs) {
- if ((ret = hal_device_touchscreen_get_backend()) < 0)
- return ret;
- }
-
- if (!hal_touchscreen_funcs ||
- !hal_touchscreen_funcs->glove_mode_get_state)
- return -ENODEV;
-
- return hal_touchscreen_funcs->glove_mode_get_state(state);
-}
-
-int hal_device_touchscreen_glove_mode_set_state(int state)
-{
- int ret;
-
- if (!hal_touchscreen_funcs) {
- if ((ret = hal_device_touchscreen_get_backend()) < 0)
- return ret;
- }
-
- if (!hal_touchscreen_funcs ||
- !hal_touchscreen_funcs->glove_mode_set_state)
- return -ENODEV;
-
- return hal_touchscreen_funcs->glove_mode_set_state(state);
-}