1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef HDMI_EVENT_H 10 #define HDMI_EVENT_H 11 12 #include "hdf_base.h" 13 #include "hdmi_if.h" 14 #include "platform_core.h" 15 16 #ifdef __cplusplus 17 #if __cplusplus 18 extern "C" { 19 #endif 20 #endif /* __cplusplus */ 21 22 /* HPD(hot plug detect) */ 23 #define HDMI_READ_HPD_STATUS_DELAY 110 /* ms */ 24 25 enum HdmiEventType { 26 HDMI_EVENT_HOTPLUG = 0, 27 HDMI_EVENT_HOTUNPLUG = 1, 28 HDMI_EVENT_DETECT_SINK = 2, 29 HDMI_EVENT_CEC_MSG = 3, 30 HDMI_EVENT_HDCP_MSG = 4, 31 HDMI_EVENT_ZERO_DRMIF_TIMEOUT = 5, 32 HDMI_EVENT_SWITCH_TO_HDRMODE_TIMEOUT = 6, 33 HDMI_EVENT_BUTT, 34 }; 35 36 struct HdmiEventMsg { 37 struct PlatformMsg msg; 38 struct OsalSem sem; 39 bool block; 40 void *priv; 41 }; 42 43 struct HdmiEvent { 44 bool plugged; 45 bool hpdDetected; 46 struct HdmiHpdCallbackInfo callback; 47 }; 48 49 #ifdef __cplusplus 50 #if __cplusplus 51 } 52 #endif 53 #endif /* __cplusplus */ 54 55 #endif /* HDMI_EVENT_H */ 56