display: Relocate poll.h header file from display to shared 03/325403/1
authorYunhee Seo <yuni.seo@samsung.com>
Mon, 9 Jun 2025 02:40:39 +0000 (11:40 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Tue, 10 Jun 2025 04:56:17 +0000 (13:56 +0900)
As poll.h is located under display module, it can cause header conflict.
This because display header modules are included to CMake path when they
are build, and poll.h is located under display module.
Since poll.h is used from several modules in the deviced,
this should be moved to shared.

Change-Id: If7c0339bb88fc8281ec4f02a450db9965ace5157
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
23 files changed:
plugins/mobile/display/core.c
plugins/tv/display/core.c
plugins/tv/display/key-filter.c
plugins/wearable/display/bezel.c
plugins/wearable/display/core.c
plugins/wearable/display/display-handler.c
plugins/wearable/display/key-filter.c
src/battery/lowbat-handler.c
src/battery/power-supply.c
src/display/core.h
src/display/display-lock.c
src/display/display-misc.c
src/display/display-signal.c
src/display/display-util.c
src/display/poll.h [deleted file]
src/display/slave-logging.c
src/extcon/earjack.c
src/power/power-boot.c
src/power/power-off.c
src/shared/apps.h
src/shared/poll.h [new file with mode: 0644]
src/time/time-handler.c
src/usb-gadget/usb-gadget.c

index f6e6802e299262c77608bb0d5402af00cc80542b..63fe564c79ba2133d3f710a0f595d14fc50fa7a0 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <libsyscommon/log.h>
 #include "core.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "lock-detector.h"
 #include "display-ops.h"
 #include "shared/devices.h"
index 905236a0f072740482aef0a79cb74a7f592bd235..5001fc8552a850df471419ede38b71bfc233034d 100644 (file)
@@ -45,7 +45,7 @@
 #include <hal/hal-device-power.h>
 
 #include "core.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "lock-detector.h"
 #include "display-ops.h"
 #include "shared/devices.h"
index 99c80b8a0a00e071b32b00ce607323c80e9268ae..328205ff36fcc3bea2d1197929fc440b0e3370fa 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/input.h>
 
 #include "core.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "device-interface.h"
 #include "display-actor.h"
 #include "display-panel.h"
index e70c725ed2e26c5af23be347a82f8c97198ef993..5c511e238e4bf17285f1555bc030f170bd399baf 100644 (file)
@@ -23,7 +23,7 @@
 #include "shared/devices.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "core.h"
 #include "display-lock.h"
 #include "display-ops.h"
index 2d4108d36e432c2a6f4d9e31a6c705bc11eefff2..af35b1045b6e9800abb5f7c064da5337537976c0 100644 (file)
@@ -47,7 +47,7 @@
 #include <libsyscommon/log.h>
 #include "auto-brightness-sensorhub.h"
 #include "core.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "lock-detector.h"
 #include "display-ops.h"
 #include "setting.h"
index c89af5a119a1b3f8bbbf6f41735951d0c7e53694..32bd3ef94914482eb03ade378479cd6527a61514 100644 (file)
@@ -26,7 +26,7 @@
 #include "shared/device-notifier.h"
 #include "core.h"
 #include "device-interface.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "shared/common.h"
 #include "shared/devices.h"
 #include <libsyscommon/log.h>
index 16ce9eb3f4249c14c0a9eb1863825a0ed28a04af..98aeca2c414e49a5eb21045b511117f4b1edb303 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/input.h>
 
 #include "core.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "device-interface.h"
 #include "display-actor.h"
 #include "display-info.h"
index 5c52c1c2d4db28e457cd95ca1b1011e065459314..a04a3e69ac762a24effb7b9e6a87eb514f7f3e31 100644 (file)
@@ -44,7 +44,7 @@
 #include "shared/eventsystem.h"
 #include "shared/plugin.h"
 #include "setting.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "display-lock.h"
 #include "display-ops.h"
 #include "display-state-transition.h"
index 20b977dfed30678b12f947d03bf799d29483e608..8740057fe6b161040d3ccb05962658af4fa2ebaa 100644 (file)
@@ -35,7 +35,7 @@
 #include "shared/device-notifier.h"
 #include "core/udev.h"
 #include "core/log.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "setting.h"
 #include "shared/eventsystem.h"
 #include "shared/plugin.h"
index 223e7a148487d1b242dadff9e10cb8650cf85c1c..ff641afcd779305eccd6b5f0836efefaab5ea7e0 100644 (file)
@@ -27,7 +27,7 @@
 #include <system/syscommon-plugin-deviced-common-interface.h>
 #include <system/syscommon-plugin-deviced-display.h>
 
-#include "poll.h"
+#include "shared/poll.h"
 #include "setting.h"
 #include "display.h"
 #include "display-config.h"
index fd6090ac8bceb74734de49179a817549fc03649e..88ec9ae04019585915ee27e07d4c9cc8c4d21c15 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "shared/common.h"
 #include "device-interface.h"
-#include "poll.h"
+#include "shared/poll.h"
 //#include "display.h"
 #include "display-signal.h"
 #include "lock-detector.h"
index ccfa8c102ca76ea18fc7dd7543f60d1398bfdaea..cda5d6d11cfac6b271984bd5ad7c5f479d61428e 100644 (file)
@@ -36,7 +36,7 @@
 #include "display-panel.h"
 #include "display-state-transition.h"
 #include "lock-detector.h"
-#include "poll.h"
+#include "shared/poll.h"
 
 static bool stay_touchscreen_off = false;
 static bool touch_event_blocked = false;
index ddeecf2ac52afcb47300550ecd2fa23e4e0603eb..b59ff7866ce5a24633a9dc641b06c6f42b777fb4 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "display-signal.h"
 #include "display-util.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "shared/log.h"
 #include "shared/plugin.h"
 #include "shared/time.h"
index a279a622ca4577c21327911a4cee38db5b08ca14..b4fec206b5ef3bb4af92964c0eb70d24ad22a06a 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <system/syscommon-plugin-deviced-display-interface.h>
 
-#include "poll.h"
+#include "shared/poll.h"
 #include "display-misc.h"
 #include "display-util.h"
 
diff --git a/src/display/poll.h b/src/display/poll.h
deleted file mode 100644 (file)
index e506e53..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2011 - 2013 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.
- */
-
-
-/**
- * @file       poll.h
- * @brief      Power Manager input device poll implementation
- *
- */
-
-#ifndef __PM_POLL_H__
-#define __PM_POLL_H__
-
-#include <libsyscommon/libgdbus.h>
-/**
- * @addtogroup POWER_MANAGER
- * @{
- */
-
-enum {
-       INPUT_POLL_EVENT = -9,
-       SIDEKEY_POLL_EVENT,
-       PWRKEY_POLL_EVENT,
-       PM_CONTROL_EVENT,
-};
-
-#define SIGNAL_NAME_LCD_CONTROL                "lcdcontol"
-
-#define LCD_NORMAL  0x01       /**< NORMAL state */
-#define LCD_DIM     0x02       /**< LCD dimming state */
-#define LCD_OFF     0x04       /**< LCD off state */
-#define SUSPEND     0x08       /**< Suspend state */
-#define POWER_OFF   0x10       /**< Sleep state */
-#define STANDBY     0x20       /**< Standby state */
-
-
-#define STAY_CUR_STATE 0x1
-#define GOTO_STATE_NOW 0x2
-
-#define PM_SLEEP_MARGIN        0x0     /**< keep guard time for unlock */
-#define PM_RESET_TIMER 0x1     /**< reset timer for unlock */
-#define PM_KEEP_TIMER          0x2     /**< keep timer for unlock */
-
-/**
- * display lock condition (unsigned integer)
- *
- *     xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
- *     reserved  flags   request   state
- *
- */
-
-enum cond_request_e {
-       PM_REQUEST_LOCK     = 1 << 0,
-       PM_REQUEST_UNLOCK   = 1 << 1,
-       PM_REQUEST_CHANGE   = 1 << 2,
-};
-
-enum cond_flags_e {
-       PM_FLAG_RESET_TIMER    = 1 << 1,
-       PM_FLAG_KEEP_TIMER     = 1 << 2,
-};
-
-#define SHIFT_STATE            0
-#define SHIFT_REQUEST          8
-#define SHIFT_FLAGS            16
-#define COND_MASK              0xff /* 11111111 */
-#define SET_COND_REQUEST(cond, req)      ((cond) | ((req) << SHIFT_REQUEST))
-#define SET_COND_FLAG(cond, flags)       ((cond) | ((flags) << SHIFT_FLAGS))
-#define IS_COND_REQUEST_LOCK(cond)       (((cond) >> SHIFT_REQUEST) & COND_MASK & PM_REQUEST_LOCK)
-#define IS_COND_REQUEST_UNLOCK(cond)     (((cond) >> SHIFT_REQUEST) & COND_MASK & PM_REQUEST_UNLOCK)
-#define IS_COND_REQUEST_CHANGE(cond)     (((cond) >> SHIFT_REQUEST) & COND_MASK & PM_REQUEST_CHANGE)
-#define GET_COND_STATE(cond)             ((cond) & COND_MASK)
-#define GET_COND_FLAG(cond)              (((cond) >> SHIFT_FLAGS) & COND_MASK)
-
-
-#define PM_LOCK_STR    "lock"
-#define PM_UNLOCK_STR  "unlock"
-#define PM_CHANGE_STR  "change"
-
-#define PM_LCDOFF_STR  "lcdoff"
-#define PM_LCDDIM_STR  "lcddim"
-#define PM_LCDON_STR   "lcdon"
-#define PM_STANDBY_STR "standby"
-#define PM_SUSPEND_STR "suspend"
-
-#define STAYCURSTATE_STR "staycurstate"
-#define GOTOSTATENOW_STR "gotostatenow"
-
-#define STANDBYMODE_STR  "standbymode"
-
-#define SLEEP_MARGIN_STR "sleepmargin"
-#define RESET_TIMER_STR  "resettimer"
-#define KEEP_TIMER_STR   "keeptimer"
-
-/**
- * @}
- */
-
-#endif                         /*__PM_POLL_H__ */
index c1e2966378f14b5251e67a1ea1453e386836ecbf..c4640fe09ea7769c25dce68e7163a2ac33def9f3 100644 (file)
@@ -22,7 +22,7 @@
 #include "shared/common.h"
 #include "core/log.h"
 #include "core.h"
-#include "poll.h"
+#include "shared/poll.h"
 
 #define BUFF_MAX       255
 #define LOCK_STR_MAX   20
index 2276ec4723d1ec73ceb6059684ae0ca155973f70..9b831e7124cab47503924a952e6988dc1789f3bd 100644 (file)
@@ -24,7 +24,7 @@
 #include <system/syscommon-plugin-deviced-common-interface.h>
 
 #include "core/log.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "display-ops.h"
 #include "display-state-transition.h"
 #include "extcon/extcon.h"
index 84d1f9f075aa3c1b7af5fd1bde7ec2282821d468..89b57a5bcb00aca420f3e0e70a7cf2c4f0925b85 100644 (file)
@@ -34,7 +34,7 @@
 #include "core/log.h"
 #include "shared/device-notifier.h"
 #include "shared/common.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "display-ops.h"
 #include "shared/plugin.h"
 #include "power-boot.h"
index 17f172cc2b8af1ce7cf2d487c07b636349426c22..6a668d002363dfe37b72b0f457b6116c46ae09df 100644 (file)
@@ -44,7 +44,7 @@
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/devices.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "setting.h"
 #include "core.h"
 #include "display-ops.h"
index 8becaf1180c5247683be651c1fcb9b6135b2b744..e9b1b97fbacaa62f5160982ea9297b1d17833634 100644 (file)
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <libsyscommon/libgdbus.h>
 #include "shared/common.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "display-ops.h"
 
 #define APP_POWERKEY "powerkey"
diff --git a/src/shared/poll.h b/src/shared/poll.h
new file mode 100644 (file)
index 0000000..e506e53
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * deviced
+ *
+ * Copyright (c) 2011 - 2013 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.
+ */
+
+
+/**
+ * @file       poll.h
+ * @brief      Power Manager input device poll implementation
+ *
+ */
+
+#ifndef __PM_POLL_H__
+#define __PM_POLL_H__
+
+#include <libsyscommon/libgdbus.h>
+/**
+ * @addtogroup POWER_MANAGER
+ * @{
+ */
+
+enum {
+       INPUT_POLL_EVENT = -9,
+       SIDEKEY_POLL_EVENT,
+       PWRKEY_POLL_EVENT,
+       PM_CONTROL_EVENT,
+};
+
+#define SIGNAL_NAME_LCD_CONTROL                "lcdcontol"
+
+#define LCD_NORMAL  0x01       /**< NORMAL state */
+#define LCD_DIM     0x02       /**< LCD dimming state */
+#define LCD_OFF     0x04       /**< LCD off state */
+#define SUSPEND     0x08       /**< Suspend state */
+#define POWER_OFF   0x10       /**< Sleep state */
+#define STANDBY     0x20       /**< Standby state */
+
+
+#define STAY_CUR_STATE 0x1
+#define GOTO_STATE_NOW 0x2
+
+#define PM_SLEEP_MARGIN        0x0     /**< keep guard time for unlock */
+#define PM_RESET_TIMER 0x1     /**< reset timer for unlock */
+#define PM_KEEP_TIMER          0x2     /**< keep timer for unlock */
+
+/**
+ * display lock condition (unsigned integer)
+ *
+ *     xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
+ *     reserved  flags   request   state
+ *
+ */
+
+enum cond_request_e {
+       PM_REQUEST_LOCK     = 1 << 0,
+       PM_REQUEST_UNLOCK   = 1 << 1,
+       PM_REQUEST_CHANGE   = 1 << 2,
+};
+
+enum cond_flags_e {
+       PM_FLAG_RESET_TIMER    = 1 << 1,
+       PM_FLAG_KEEP_TIMER     = 1 << 2,
+};
+
+#define SHIFT_STATE            0
+#define SHIFT_REQUEST          8
+#define SHIFT_FLAGS            16
+#define COND_MASK              0xff /* 11111111 */
+#define SET_COND_REQUEST(cond, req)      ((cond) | ((req) << SHIFT_REQUEST))
+#define SET_COND_FLAG(cond, flags)       ((cond) | ((flags) << SHIFT_FLAGS))
+#define IS_COND_REQUEST_LOCK(cond)       (((cond) >> SHIFT_REQUEST) & COND_MASK & PM_REQUEST_LOCK)
+#define IS_COND_REQUEST_UNLOCK(cond)     (((cond) >> SHIFT_REQUEST) & COND_MASK & PM_REQUEST_UNLOCK)
+#define IS_COND_REQUEST_CHANGE(cond)     (((cond) >> SHIFT_REQUEST) & COND_MASK & PM_REQUEST_CHANGE)
+#define GET_COND_STATE(cond)             ((cond) & COND_MASK)
+#define GET_COND_FLAG(cond)              (((cond) >> SHIFT_FLAGS) & COND_MASK)
+
+
+#define PM_LOCK_STR    "lock"
+#define PM_UNLOCK_STR  "unlock"
+#define PM_CHANGE_STR  "change"
+
+#define PM_LCDOFF_STR  "lcdoff"
+#define PM_LCDDIM_STR  "lcddim"
+#define PM_LCDON_STR   "lcdon"
+#define PM_STANDBY_STR "standby"
+#define PM_SUSPEND_STR "suspend"
+
+#define STAYCURSTATE_STR "staycurstate"
+#define GOTOSTATENOW_STR "gotostatenow"
+
+#define STANDBYMODE_STR  "standbymode"
+
+#define SLEEP_MARGIN_STR "sleepmargin"
+#define RESET_TIMER_STR  "resettimer"
+#define KEEP_TIMER_STR   "keeptimer"
+
+/**
+ * @}
+ */
+
+#endif                         /*__PM_POLL_H__ */
index 4c209847061f266cd124d0f23a02bade6ba33647..e864e02a193ee50d1bd9b0263b824c63cdfe3be7 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "core/log.h"
 #include "shared/devices.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "core.h"
 #include "display-ops.h"
 #include "shared/common.h"
index 849440dac5394a77b12ccb62edb965d798050b49..0f483f45b701e3e5a11df83ffe432cbf65af961a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "core/log.h"
 #include "core/udev.h"
-#include "poll.h"
+#include "shared/poll.h"
 #include "display-lock.h"
 #include "display-ops.h"
 #include "shared/plugin.h"