diff --git a/hardware/rockchip/hdmicec/hdmi_cec.cpp b/hardware/rockchip/hdmicec/hdmi_cec.cpp index 967df651ff4..3f9d9ec13d6 100644 --- a/hardware/rockchip/hdmicec/hdmi_cec.cpp +++ b/hardware/rockchip/hdmicec/hdmi_cec.cpp @@ -510,13 +510,14 @@ int rk_hdmi_cec_init(struct hdmi_cec_context_t *dev) dev->phy_addr = 0; dev->en_mask = CEC_WAKE | CEC_ENABLE; + dev->fd = open(HDMI_DEV_PATH,O_RDWR | O_CLOEXEC,0); - ALOGD("%s open %s", __func__, HDMI_DEV_PATH); if (dev->fd < 0) { - ALOGE("%s open error!", __func__); - ALOGE("cec %s\n", strerror(errno)); + ALOGE("%s failed to open %s, %d", __func__, HDMI_DEV_PATH, errno); + } else { + ALOGI("%s dev->fd = %d", __func__, dev->fd); } - ALOGI("%s dev->fd = %d", __func__, dev->fd); + property_set("vendor.sys.hdmicec.version",HDMI_CEC_HAL_VERSION); init_uevent_thread(dev); diff --git a/hardware/rockchip/hdmicec/hdmicec_event.cpp b/hardware/rockchip/hdmicec/hdmicec_event.cpp index 13eecc0404e..79b4c9eb2b6 100644 --- a/hardware/rockchip/hdmicec/hdmicec_event.cpp +++ b/hardware/rockchip/hdmicec/hdmicec_event.cpp @@ -33,6 +33,7 @@ #include #include #include "rk_hdmi_cec.h" + #define HDMI_CEC_UEVENT_THREAD_NAME "HdmiCecThread" static int validcecmessage(hdmi_event_t cec_event) @@ -108,7 +109,7 @@ static void* uevent_loop(void* param) fd[0] = ctx->fd; if (fd[0] < 0) { - ALOGE("%s:not able to open cec state node", __func__); + ALOGE("%s: unable to open cec state node", __func__); return NULL; } @@ -117,8 +118,8 @@ static void* uevent_loop(void* param) pfd[0].events = POLLIN | POLLRDNORM | POLLPRI; while (true) { - usleep(1000); - int err = poll(&pfd[0], 1, 20); + // usleep(1000); + int err = poll(&pfd[0], 1, -1); if (!err) { continue;