mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 05:36:47 +00:00
Merge pull request #723 from Kwiboo/hub-aocec
WeTek_Hub: Add libcec/aocec support
This commit is contained in:
commit
8c90403b4e
@ -43,7 +43,7 @@ else
|
||||
fi
|
||||
|
||||
if [ "$KODIPLAYER_DRIVER" = "libamcodec" ]; then
|
||||
if [ "$PROJECT" = "Odroid_C2" ]; then
|
||||
if [ "$TARGET_ARCH" = "aarch64" ]; then
|
||||
EXTRA_CMAKE_OPTS="$EXTRA_CMAKE_OPTS -DHAVE_AOCEC_API=1"
|
||||
else
|
||||
EXTRA_CMAKE_OPTS="$EXTRA_CMAKE_OPTS -DHAVE_AMLOGIC_API=1"
|
||||
|
@ -35,12 +35,14 @@ case "$LINUX" in
|
||||
PKG_URL="https://github.com/hardkernel/linux/archive/$PKG_VERSION.tar.gz"
|
||||
;;
|
||||
amlogic-3.10)
|
||||
PKG_VERSION="$LINUX-c8d5b2f"
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_VERSION="c8d5b2f"
|
||||
PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
|
||||
PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*"
|
||||
;;
|
||||
amlogic-3.14)
|
||||
PKG_VERSION="$LINUX-9c0ad98"
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_VERSION="c733661"
|
||||
PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
|
||||
PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*"
|
||||
;;
|
||||
imx6)
|
||||
PKG_VERSION="3.14-mx6-sr"
|
||||
|
@ -3,9 +3,14 @@
|
||||
# Linux/arm64 3.14.29 Kernel Configuration
|
||||
#
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_HAS_SG_CHAIN=y
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_MMU=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
|
||||
CONFIG_NO_IOPORT=y
|
||||
CONFIG_STACKTRACE_SUPPORT=y
|
||||
CONFIG_LOCKDEP_SUPPORT=y
|
||||
@ -179,6 +184,11 @@ CONFIG_HAVE_CONTEXT_TRACKING=y
|
||||
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
|
||||
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
|
||||
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_OLD_SIGSUSPEND3=y
|
||||
CONFIG_COMPAT_OLD_SIGACTION=y
|
||||
@ -775,7 +785,9 @@ CONFIG_RFKILL_LEDS=y
|
||||
#
|
||||
# Amlogic Device Drivers
|
||||
#
|
||||
# CONFIG_MESON_TIMER is not set
|
||||
CONFIG_MESON_TIMER=y
|
||||
# CONFIG_MESON_LOCAL_TIMER is not set
|
||||
CONFIG_MESON_BC_TIMER=y
|
||||
CONFIG_AM_UART=y
|
||||
CONFIG_SERIAL_MESON_CONSOLE=y
|
||||
# CONFIG_PRINTK_NOBLOCK_MODE is not set
|
||||
@ -1009,7 +1021,14 @@ CONFIG_V4L_AMLOGIC_VIDEO=y
|
||||
#
|
||||
# Amlogic TVIN Drivers
|
||||
#
|
||||
# CONFIG_TVIN is not set
|
||||
CONFIG_TVIN=y
|
||||
# CONFIG_TVIN_VDIN is not set
|
||||
# CONFIG_TVIN_AFE is not set
|
||||
CONFIG_TVIN_HDMI=y
|
||||
# CONFIG_TVIN_HDMI_CEC is not set
|
||||
# CONFIG_TVIN_BT656 is not set
|
||||
# CONFIG_VIUIN is not set
|
||||
# CONFIG_TVIN_ISP is not set
|
||||
|
||||
#
|
||||
# Amlogic VECM Drivers
|
||||
@ -1039,12 +1058,10 @@ CONFIG_GXBB_SUSPEND=y
|
||||
#
|
||||
# CONFIG_AM_DVB is not set
|
||||
# CONFIG_AM_ATVDEMOD is not set
|
||||
# CONFIG_AM_DTVDEMOD is not set
|
||||
|
||||
#
|
||||
# AMLOGIC CI Driver
|
||||
#
|
||||
# CONFIG_AM_CI is not set
|
||||
# CONFIG_AM_PCMCIA is not set
|
||||
# CONFIG_AM_IOBUS is not set
|
||||
# CONFIG_AML_SMARTCARD is not set
|
||||
@ -1089,7 +1106,7 @@ CONFIG_AML_CODEC_MM=y
|
||||
#
|
||||
# AO CEC Support
|
||||
#
|
||||
# CONFIG_AML_AO_CEC is not set
|
||||
CONFIG_AML_AO_CEC=y
|
||||
|
||||
#
|
||||
# Amlogic Crypto Support
|
||||
@ -2211,6 +2228,7 @@ CONFIG_RC_DEVICES=y
|
||||
CONFIG_RC_ATI_REMOTE=m
|
||||
CONFIG_IR_IMON=m
|
||||
CONFIG_IR_MCEUSB=m
|
||||
CONFIG_IR_MESON=m
|
||||
CONFIG_IR_REDRAT3=m
|
||||
CONFIG_IR_STREAMZAP=m
|
||||
CONFIG_IR_IGUANA=m
|
||||
@ -2646,6 +2664,8 @@ CONFIG_SND_SOC=y
|
||||
# CONFIG_SND_DESIGNWARE_I2S is not set
|
||||
CONFIG_SND_AML_M8_SOC=y
|
||||
CONFIG_SND_AML_M8=y
|
||||
CONFIG_SND_AML_SPLIT_MODE=y
|
||||
# CONFIG_SND_AML_SPLIT_MODE_MMAP is not set
|
||||
CONFIG_SND_SOC_I2C_AND_SPI=y
|
||||
CONFIG_SND_SOC_DUMMY_CODEC=y
|
||||
CONFIG_SND_SOC_TAS5707=y
|
||||
@ -2653,6 +2673,7 @@ CONFIG_SND_SOC_TAS5717=y
|
||||
CONFIG_SND_SOC_TAS5731=y
|
||||
CONFIG_SND_SOC_PCM2BT=y
|
||||
CONFIG_SND_SOC_AMLT9015=y
|
||||
CONFIG_SND_SOC_AMLT9015S=y
|
||||
# CONFIG_SND_SIMPLE_CARD is not set
|
||||
# CONFIG_SOUND_PRIME is not set
|
||||
|
||||
|
803
projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch
Normal file
803
projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch
Normal file
@ -0,0 +1,803 @@
|
||||
diff --git a/README.md b/README.md
|
||||
index dfaf4d6..87491ef 100644
|
||||
--- a/README.md
|
||||
+++ b/README.md
|
||||
@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E
|
||||
cmake -DHAVE_EXYNOS_API=1 ..
|
||||
```
|
||||
|
||||
+### AOCEC
|
||||
+To compile in support for AOCEC devices, you have to pass the argument -DHAVE_AOCEC_API=1 to cmake:
|
||||
+```
|
||||
+cmake -DHAVE_AOCEC_API=1 ..
|
||||
+```
|
||||
+
|
||||
### TDA995x
|
||||
To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake:
|
||||
```
|
||||
diff --git a/include/cectypes.h b/include/cectypes.h
|
||||
index 0fdd48e..881a805 100644
|
||||
--- a/include/cectypes.h
|
||||
+++ b/include/cectypes.h
|
||||
@@ -309,6 +309,16 @@ namespace CEC {
|
||||
#define CEC_EXYNOS_VIRTUAL_COM "Exynos"
|
||||
|
||||
/*!
|
||||
+ * the path to use for the AOCEC HDMI CEC device
|
||||
+ */
|
||||
+#define CEC_AOCEC_PATH "/dev/aocec"
|
||||
+
|
||||
+/*!
|
||||
+ * the name of the virtual COM port to use for the AOCEC' CEC wire
|
||||
+ */
|
||||
+#define CEC_AOCEC_VIRTUAL_COM "AOCEC"
|
||||
+
|
||||
+/*!
|
||||
* Mimimum client version
|
||||
*/
|
||||
#define CEC_MIN_LIB_VERSION 3
|
||||
@@ -877,7 +887,8 @@ typedef enum cec_adapter_type
|
||||
ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
|
||||
ADAPTERTYPE_RPI = 0x100,
|
||||
ADAPTERTYPE_TDA995x = 0x200,
|
||||
- ADAPTERTYPE_EXYNOS = 0x300
|
||||
+ ADAPTERTYPE_EXYNOS = 0x300,
|
||||
+ ADAPTERTYPE_AOCEC = 0x500
|
||||
} cec_adapter_type;
|
||||
|
||||
/** force exporting through swig */
|
||||
diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt
|
||||
index a494533..d3eefa3 100644
|
||||
--- a/src/libcec/CMakeLists.txt
|
||||
+++ b/src/libcec/CMakeLists.txt
|
||||
@@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h
|
||||
adapter/Exynos/ExynosCEC.h
|
||||
adapter/Exynos/ExynosCECAdapterDetection.h
|
||||
adapter/Exynos/ExynosCECAdapterCommunication.h
|
||||
+ adapter/AOCEC/AOCEC.h
|
||||
+ adapter/AOCEC/AOCECAdapterDetection.h
|
||||
+ adapter/AOCEC/AOCECAdapterCommunication.h
|
||||
adapter/Pulse-Eight/USBCECAdapterMessageQueue.h
|
||||
adapter/Pulse-Eight/USBCECAdapterCommunication.h
|
||||
adapter/Pulse-Eight/USBCECAdapterCommands.h
|
||||
diff --git a/src/libcec/adapter/AOCEC/AOCEC.h b/src/libcec/adapter/AOCEC/AOCEC.h
|
||||
new file mode 100644
|
||||
index 0000000..560fbdd
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/AOCEC/AOCEC.h
|
||||
@@ -0,0 +1,55 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
|
||||
+ * based heavily on:
|
||||
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
|
||||
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
|
||||
+ * libCEC(R) is an original work, containing original code.
|
||||
+ *
|
||||
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||
+ *
|
||||
+ * This program is dual-licensed; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ *
|
||||
+ * Alternatively, you can license this library under a commercial license,
|
||||
+ * please contact Pulse-Eight Licensing for more information.
|
||||
+ *
|
||||
+ * For more information contact:
|
||||
+ * Pulse-Eight Licensing <license@pulse-eight.com>
|
||||
+ * http://www.pulse-eight.com/
|
||||
+ * http://www.pulse-eight.net/
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#define CEC_DEFAULT_PADDR 0x1000
|
||||
+
|
||||
+#define CEC_IOC_MAGIC 'C'
|
||||
+#define CEC_IOC_GET_PHYSICAL_ADDR _IOR(CEC_IOC_MAGIC, 0x00, uint16_t)
|
||||
+#define CEC_IOC_GET_VERSION _IOR(CEC_IOC_MAGIC, 0x01, int)
|
||||
+#define CEC_IOC_GET_VENDOR_ID _IOR(CEC_IOC_MAGIC, 0x02, uint32_t)
|
||||
+#define CEC_IOC_GET_PORT_INFO _IOR(CEC_IOC_MAGIC, 0x03, int)
|
||||
+#define CEC_IOC_GET_PORT_NUM _IOR(CEC_IOC_MAGIC, 0x04, int)
|
||||
+#define CEC_IOC_GET_SEND_FAIL_REASON _IOR(CEC_IOC_MAGIC, 0x05, uint32_t)
|
||||
+#define CEC_IOC_SET_OPTION_WAKEUP _IOW(CEC_IOC_MAGIC, 0x06, uint32_t)
|
||||
+#define CEC_IOC_SET_OPTION_ENALBE_CEC _IOW(CEC_IOC_MAGIC, 0x07, uint32_t)
|
||||
+#define CEC_IOC_SET_OPTION_SYS_CTRL _IOW(CEC_IOC_MAGIC, 0x08, uint32_t)
|
||||
+#define CEC_IOC_SET_OPTION_SET_LANG _IOW(CEC_IOC_MAGIC, 0x09, uint32_t)
|
||||
+#define CEC_IOC_GET_CONNECT_STATUS _IOR(CEC_IOC_MAGIC, 0x0A, uint32_t)
|
||||
+#define CEC_IOC_ADD_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0B, uint32_t)
|
||||
+#define CEC_IOC_CLR_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0C, uint32_t)
|
||||
+
|
||||
+#define CEC_MAX_FRAME_SIZE 16
|
||||
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp
|
||||
new file mode 100644
|
||||
index 0000000..8edf981
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp
|
||||
@@ -0,0 +1,343 @@
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
|
||||
+ * based heavily on:
|
||||
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
|
||||
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
|
||||
+ * libCEC(R) is an original work, containing original code.
|
||||
+ *
|
||||
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||
+ *
|
||||
+ * This program is dual-licensed; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ *
|
||||
+ * Alternatively, you can license this library under a commercial license,
|
||||
+ * please contact Pulse-Eight Licensing for more information.
|
||||
+ *
|
||||
+ * For more information contact:
|
||||
+ * Pulse-Eight Licensing <license@pulse-eight.com>
|
||||
+ * http://www.pulse-eight.com/
|
||||
+ * http://www.pulse-eight.net/
|
||||
+ */
|
||||
+
|
||||
+#include "env.h"
|
||||
+#include <fcntl.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+
|
||||
+
|
||||
+#if defined(HAVE_AOCEC_API)
|
||||
+#include "AOCEC.h"
|
||||
+#include "AOCECAdapterCommunication.h"
|
||||
+
|
||||
+#include "CECTypeUtils.h"
|
||||
+#include "LibCEC.h"
|
||||
+#include <p8-platform/util/buffer.h>
|
||||
+
|
||||
+using namespace CEC;
|
||||
+using namespace P8PLATFORM;
|
||||
+
|
||||
+#define LIB_CEC m_callback->GetLib()
|
||||
+
|
||||
+
|
||||
+CAOCECAdapterCommunication::CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
|
||||
+ IAdapterCommunication(callback),
|
||||
+ m_bLogicalAddressChanged(false)
|
||||
+{
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ m_logicalAddresses.Clear();
|
||||
+ m_fd = INVALID_SOCKET_VALUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+CAOCECAdapterCommunication::~CAOCECAdapterCommunication(void)
|
||||
+{
|
||||
+ Close();
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool CAOCECAdapterCommunication::IsOpen(void)
|
||||
+{
|
||||
+ CLockObject lock(m_mutex);
|
||||
+ return IsInitialised() && m_fd != INVALID_SOCKET_VALUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool CAOCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening)
|
||||
+{
|
||||
+ if (IsOpen())
|
||||
+ Close();
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if ((m_fd = open(CEC_AOCEC_PATH, O_RDWR)) > 0)
|
||||
+ {
|
||||
+ uint32_t enable = true;
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (!bStartListening || CreateThread()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ close(m_fd);
|
||||
+ m_fd = INVALID_SOCKET_VALUE;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void CAOCECAdapterCommunication::Close(void)
|
||||
+{
|
||||
+ StopThread(0);
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ uint32_t enable = false;
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__);
|
||||
+ }
|
||||
+
|
||||
+ close(m_fd);
|
||||
+ m_fd = INVALID_SOCKET_VALUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+std::string CAOCECAdapterCommunication::GetError(void) const
|
||||
+{
|
||||
+ std::string strError(m_strError);
|
||||
+ return strError;
|
||||
+}
|
||||
+
|
||||
+int CAOCECAdapterCommunication::getFileDescriptor(void)
|
||||
+{
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ return m_fd;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+cec_adapter_message_state CAOCECAdapterCommunication::Write(
|
||||
+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply))
|
||||
+{
|
||||
+ uint8_t buffer[CEC_MAX_FRAME_SIZE];
|
||||
+ int32_t size = 1;
|
||||
+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return rc;
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if ((size_t)data.parameters.size + data.opcode_set > sizeof(buffer))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__);
|
||||
+ return ADAPTER_MESSAGE_STATE_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ buffer[0] = (data.initiator << 4) | (data.destination & 0x0f);
|
||||
+
|
||||
+ if (data.opcode_set)
|
||||
+ {
|
||||
+ buffer[1] = data.opcode;
|
||||
+ size++;
|
||||
+
|
||||
+ memcpy(&buffer[size], data.parameters.data, data.parameters.size);
|
||||
+ size += data.parameters.size;
|
||||
+ }
|
||||
+
|
||||
+ if (write(m_fd, (void *)buffer, size) == size)
|
||||
+ {
|
||||
+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: write failed !", __func__);
|
||||
+ }
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+uint16_t CAOCECAdapterCommunication::GetFirmwareVersion(void)
|
||||
+{
|
||||
+ int version = 0;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return version;
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_GET_VERSION, &version) < 0)
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VERSION failed !", __func__);
|
||||
+ }
|
||||
+ return (uint16_t)version;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+cec_vendor_id CAOCECAdapterCommunication::GetVendorId(void)
|
||||
+{
|
||||
+ int vendor_id = CEC_VENDOR_UNKNOWN;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return cec_vendor_id(vendor_id);
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_GET_VENDOR_ID, &vendor_id) < 0)
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VENDOR_ID failed !", __func__);
|
||||
+ }
|
||||
+ return cec_vendor_id(vendor_id);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+uint16_t CAOCECAdapterCommunication::GetPhysicalAddress(void)
|
||||
+{
|
||||
+ int phys_addr = CEC_DEFAULT_PADDR;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return (uint16_t)phys_addr;
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_GET_PHYSICAL_ADDR, &phys_addr) < 0)
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_PHYSICAL_ADDR failed !", __func__);
|
||||
+ phys_addr = CEC_DEFAULT_PADDR;
|
||||
+ }
|
||||
+ return (uint16_t)phys_addr;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+cec_logical_addresses CAOCECAdapterCommunication::GetLogicalAddresses(void)
|
||||
+{
|
||||
+ return m_logicalAddresses;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool CAOCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses)
|
||||
+{
|
||||
+ unsigned int log_addr = addresses.primary;
|
||||
+ if (!IsOpen())
|
||||
+ return false;
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__);
|
||||
+ return false;
|
||||
+ }
|
||||
+ m_logicalAddresses = addresses;
|
||||
+ m_bLogicalAddressChanged = true;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void CAOCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress))
|
||||
+{
|
||||
+ unsigned int log_addr = CECDEVICE_BROADCAST;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return;
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void *CAOCECAdapterCommunication::Process(void)
|
||||
+{
|
||||
+ uint8_t buffer[CEC_MAX_FRAME_SIZE];
|
||||
+ uint32_t size;
|
||||
+ fd_set rfds;
|
||||
+ cec_logical_address initiator, destination;
|
||||
+ struct timeval tv;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return 0;
|
||||
+
|
||||
+ while (!IsStopped())
|
||||
+ {
|
||||
+ int fd = getFileDescriptor();
|
||||
+
|
||||
+ if (fd == INVALID_SOCKET_VALUE)
|
||||
+ {
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ FD_ZERO(&rfds);
|
||||
+ FD_SET(fd, &rfds);
|
||||
+
|
||||
+ tv.tv_sec = 1;
|
||||
+ tv.tv_usec = 0;
|
||||
+
|
||||
+ if (select(fd + 1, &rfds, NULL, NULL, &tv) >= 0 )
|
||||
+ {
|
||||
+
|
||||
+ if (!FD_ISSET(fd, &rfds))
|
||||
+ continue;
|
||||
+
|
||||
+ size = read(fd, buffer, CEC_MAX_FRAME_SIZE);
|
||||
+
|
||||
+ if (size > 0)
|
||||
+ {
|
||||
+#if 0 // currently unused
|
||||
+ if (buffer[0] == 0xff) // driver wants us to reread the physical address
|
||||
+ {
|
||||
+ if (!IsStopped())
|
||||
+ {
|
||||
+ uint16_t iNewAddress = GetPhysicalAddress();
|
||||
+ m_callback->HandlePhysicalAddressChanged(iNewAddress);
|
||||
+ }
|
||||
+ continue;
|
||||
+ }
|
||||
+#endif
|
||||
+ initiator = cec_logical_address(buffer[0] >> 4);
|
||||
+ destination = cec_logical_address(buffer[0] & 0x0f);
|
||||
+
|
||||
+ cec_command cmd;
|
||||
+
|
||||
+ cec_command::Format(
|
||||
+ cmd, initiator, destination,
|
||||
+ ( size > 1 ) ? cec_opcode(buffer[1]) : CEC_OPCODE_NONE);
|
||||
+
|
||||
+ for( uint8_t i = 2; i < size; i++ )
|
||||
+ cmd.parameters.PushBack(buffer[i]);
|
||||
+
|
||||
+ if (!IsStopped())
|
||||
+ m_callback->OnCommandReceived(cmd);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#endif // HAVE_AOCEC_API
|
||||
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h
|
||||
new file mode 100644
|
||||
index 0000000..f6a8a4a
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h
|
||||
@@ -0,0 +1,105 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
|
||||
+ * based heavily on:
|
||||
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
|
||||
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
|
||||
+ * libCEC(R) is an original work, containing original code.
|
||||
+ *
|
||||
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||
+ *
|
||||
+ * This program is dual-licensed; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ *
|
||||
+ * Alternatively, you can license this library under a commercial license,
|
||||
+ * please contact Pulse-Eight Licensing for more information.
|
||||
+ *
|
||||
+ * For more information contact:
|
||||
+ * Pulse-Eight Licensing <license@pulse-eight.com>
|
||||
+ * http://www.pulse-eight.com/
|
||||
+ * http://www.pulse-eight.net/
|
||||
+ */
|
||||
+
|
||||
+#include "env.h"
|
||||
+
|
||||
+#if defined(HAVE_AOCEC_API)
|
||||
+
|
||||
+#include <p8-platform/threads/mutex.h>
|
||||
+#include <p8-platform/threads/threads.h>
|
||||
+#include "../AdapterCommunication.h"
|
||||
+#include <map>
|
||||
+
|
||||
+namespace CEC
|
||||
+{
|
||||
+ class CAOCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread
|
||||
+ {
|
||||
+ public:
|
||||
+ /*!
|
||||
+ * @brief Create a new Exynos HDMI CEC communication handler.
|
||||
+ * @param callback The callback to use for incoming CEC commands.
|
||||
+ */
|
||||
+ CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback);
|
||||
+ virtual ~CAOCECAdapterCommunication(void);
|
||||
+
|
||||
+ /** @name IAdapterCommunication implementation */
|
||||
+ ///{
|
||||
+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true);
|
||||
+ void Close(void);
|
||||
+ bool IsOpen(void);
|
||||
+ std::string GetError(void) const;
|
||||
+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply);
|
||||
+
|
||||
+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; }
|
||||
+ bool StartBootloader(void) { return false; }
|
||||
+ bool SetLogicalAddresses(const cec_logical_addresses &addresses);
|
||||
+ cec_logical_addresses GetLogicalAddresses(void);
|
||||
+ bool PingAdapter(void) { return IsInitialised(); }
|
||||
+ uint16_t GetFirmwareVersion(void);
|
||||
+ uint32_t GetFirmwareBuildDate(void) { return 0; }
|
||||
+ bool IsRunningLatestFirmware(void) { return true; }
|
||||
+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; }
|
||||
+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; }
|
||||
+ std::string GetPortName(void) { return std::string("AOCEC"); }
|
||||
+ uint16_t GetPhysicalAddress(void);
|
||||
+ bool SetControlledMode(bool UNUSED(controlled)) { return true; }
|
||||
+ cec_vendor_id GetVendorId(void);
|
||||
+ bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; }
|
||||
+ cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_AOCEC; }
|
||||
+ uint16_t GetAdapterVendorId(void) const { return 1; }
|
||||
+ uint16_t GetAdapterProductId(void) const { return 1; }
|
||||
+ void HandleLogicalAddressLost(cec_logical_address oldAddress);
|
||||
+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {}
|
||||
+ ///}
|
||||
+
|
||||
+ /** @name P8PLATFORM::CThread implementation */
|
||||
+ ///{
|
||||
+ void *Process(void);
|
||||
+ ///}
|
||||
+
|
||||
+ private:
|
||||
+ bool IsInitialised(void) const { return 1; };
|
||||
+ int getFileDescriptor(void);
|
||||
+
|
||||
+ std::string m_strError; /**< current error message */
|
||||
+
|
||||
+ bool m_bLogicalAddressChanged;
|
||||
+ cec_logical_addresses m_logicalAddresses;
|
||||
+ P8PLATFORM::CMutex m_mutex;
|
||||
+ int m_fd;
|
||||
+ };
|
||||
+};
|
||||
+#endif
|
||||
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp
|
||||
new file mode 100644
|
||||
index 0000000..55f3ee0
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp
|
||||
@@ -0,0 +1,50 @@
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
|
||||
+ * based heavily on:
|
||||
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
|
||||
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
|
||||
+ * libCEC(R) is an original work, containing original code.
|
||||
+ *
|
||||
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||
+ *
|
||||
+ * This program is dual-licensed; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ *
|
||||
+ * Alternatively, you can license this library under a commercial license,
|
||||
+ * please contact Pulse-Eight Licensing for more information.
|
||||
+ *
|
||||
+ * For more information contact:
|
||||
+ * Pulse-Eight Licensing <license@pulse-eight.com>
|
||||
+ * http://www.pulse-eight.com/
|
||||
+ * http://www.pulse-eight.net/
|
||||
+ */
|
||||
+
|
||||
+#include "env.h"
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+#if defined(HAVE_AOCEC_API)
|
||||
+#include "AOCECAdapterDetection.h"
|
||||
+#include "AOCEC.h"
|
||||
+
|
||||
+using namespace CEC;
|
||||
+
|
||||
+bool CAOCECAdapterDetection::FindAdapter(void)
|
||||
+{
|
||||
+ return access(CEC_AOCEC_PATH, 0) == 0;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h
|
||||
new file mode 100644
|
||||
index 0000000..cacaa19
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h
|
||||
@@ -0,0 +1,46 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
|
||||
+ * based heavily on:
|
||||
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
|
||||
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
|
||||
+ * libCEC(R) is an original work, containing original code.
|
||||
+ *
|
||||
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||
+ *
|
||||
+ * This program is dual-licensed; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ *
|
||||
+ * Alternatively, you can license this library under a commercial license,
|
||||
+ * please contact Pulse-Eight Licensing for more information.
|
||||
+ *
|
||||
+ * For more information contact:
|
||||
+ * Pulse-Eight Licensing <license@pulse-eight.com>
|
||||
+ * http://www.pulse-eight.com/
|
||||
+ * http://www.pulse-eight.net/
|
||||
+ */
|
||||
+
|
||||
+#include "env.h"
|
||||
+
|
||||
+namespace CEC
|
||||
+{
|
||||
+ class CAOCECAdapterDetection
|
||||
+ {
|
||||
+ public:
|
||||
+ static bool FindAdapter(void);
|
||||
+ };
|
||||
+}
|
||||
diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp
|
||||
index da05725..1e946e6 100644
|
||||
--- a/src/libcec/adapter/AdapterFactory.cpp
|
||||
+++ b/src/libcec/adapter/AdapterFactory.cpp
|
||||
@@ -58,6 +58,11 @@
|
||||
#include "Exynos/ExynosCECAdapterCommunication.h"
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_AOCEC_API)
|
||||
+#include "AOCEC/AOCECAdapterDetection.h"
|
||||
+#include "AOCEC/AOCECAdapterCommunication.h"
|
||||
+#endif
|
||||
+
|
||||
using namespace CEC;
|
||||
|
||||
int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */)
|
||||
@@ -126,8 +131,20 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_AOCEC_API)
|
||||
+ if (iAdaptersFound < iBufSize && CAOCECAdapterDetection::FindAdapter())
|
||||
+ {
|
||||
+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_AOCEC_PATH);
|
||||
+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_AOCEC_VIRTUAL_COM);
|
||||
+ deviceList[iAdaptersFound].iVendorId = 0;
|
||||
+ deviceList[iAdaptersFound].iProductId = 0;
|
||||
+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_AOCEC;
|
||||
+ iAdaptersFound++;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
|
||||
-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API)
|
||||
+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API)
|
||||
#error "libCEC doesn't have support for any type of adapter. please check your build system or configuration"
|
||||
#endif
|
||||
|
||||
@@ -146,6 +163,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
|
||||
return new CExynosCECAdapterCommunication(m_lib->m_cec);
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_AOCEC_API)
|
||||
+ if (!strcmp(strPort, CEC_AOCEC_VIRTUAL_COM))
|
||||
+ return new CAOCECAdapterCommunication(m_lib->m_cec);
|
||||
+#endif
|
||||
+
|
||||
#if defined(HAVE_RPI_API)
|
||||
if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM))
|
||||
return new CRPiCECAdapterCommunication(m_lib->m_cec);
|
||||
diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake
|
||||
index b8a16c8..93a97e6 100644
|
||||
--- a/src/libcec/cmake/CheckPlatformSupport.cmake
|
||||
+++ b/src/libcec/cmake/CheckPlatformSupport.cmake
|
||||
@@ -9,6 +9,7 @@
|
||||
# HAVE_RPI_API 1 if Raspberry Pi is supported
|
||||
# HAVE_TDA995X_API 1 if TDA995X is supported
|
||||
# HAVE_EXYNOS_API 1 if Exynos is supported
|
||||
+# HAVE_AOCEC_API 1 if AOCEC is supported
|
||||
# HAVE_P8_USB 1 if Pulse-Eight devices are supported
|
||||
# HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected
|
||||
# HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported
|
||||
@@ -132,6 +133,18 @@ else()
|
||||
else()
|
||||
set(HAVE_EXYNOS_API 0)
|
||||
endif()
|
||||
+
|
||||
+ # AOCEC
|
||||
+ if (${HAVE_AOCEC_API})
|
||||
+ set(LIB_INFO "${LIB_INFO}, AOCEC")
|
||||
+ set(HAVE_AOCEC_API 1)
|
||||
+ set(CEC_SOURCES_ADAPTER_AOCEC adapter/AOCEC/AOCECAdapterDetection.cpp
|
||||
+ adapter/AOCEC/AOCECAdapterCommunication.cpp)
|
||||
+ source_group("Source Files\\adapter\\AOCEC" FILES ${CEC_SOURCES_ADAPTER_AOCEC})
|
||||
+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_AOCEC})
|
||||
+ else()
|
||||
+ set(HAVE_AOCEC_API 0)
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
# rt
|
||||
diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake
|
||||
index 9dcaacf..7ec10f5 100644
|
||||
--- a/src/libcec/cmake/DisplayPlatformSupport.cmake
|
||||
+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake
|
||||
@@ -44,6 +44,12 @@ else()
|
||||
message(STATUS "DRM support: no")
|
||||
endif()
|
||||
|
||||
+if (HAVE_AOCEC_API)
|
||||
+ message(STATUS "AOCEC support: yes")
|
||||
+else()
|
||||
+ message(STATUS "AOCEC support: no")
|
||||
+endif()
|
||||
+
|
||||
if (HAVE_PYTHON)
|
||||
message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})")
|
||||
else()
|
||||
diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in
|
||||
index 0496aa0..fe6c83d 100644
|
||||
--- a/src/libcec/env.h.in
|
||||
+++ b/src/libcec/env.h.in
|
||||
@@ -72,6 +72,9 @@
|
||||
/* Define to 1 for Exynos support */
|
||||
#cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@
|
||||
|
||||
+/* Define to 1 for AOCEC support */
|
||||
+#cmakedefine HAVE_AOCEC_API @HAVE_AOCEC_API@
|
||||
+
|
||||
/* Define to 1 for nVidia EDID parsing support (on selected models) */
|
||||
#cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@
|
||||
|
@ -1,39 +1,46 @@
|
||||
diff --git a/drivers/amlogic/display/logo/logo.c b/drivers/amlogic/display/logo/logo.c
|
||||
index 9266be3..6803f10 100644
|
||||
--- a/drivers/amlogic/display/logo/logo.c
|
||||
+++ b/drivers/amlogic/display/logo/logo.c
|
||||
@@ -246,6 +246,7 @@ __setup("logo=", logo_setup);
|
||||
static int __init get_hdmi_mode(char *str)
|
||||
{
|
||||
hdmimode = vmode_name_to_mode(str);
|
||||
+ set_vout_init_vmode(str);
|
||||
|
||||
pr_info("get hdmimode: %s\n", str);
|
||||
return 1;
|
||||
diff --git a/drivers/amlogic/display/vout/vout_serve.c b/drivers/amlogic/display/vout/vout_serve.c
|
||||
index d91d40d..029b36d 100644
|
||||
index fae61b3..a248367 100644
|
||||
--- a/drivers/amlogic/display/vout/vout_serve.c
|
||||
+++ b/drivers/amlogic/display/vout/vout_serve.c
|
||||
@@ -596,10 +596,16 @@ static int __init get_vout_init_mode(char *str)
|
||||
char *option;
|
||||
int count = 3;
|
||||
char find = 0;
|
||||
+ char str2[1024];
|
||||
+ char *ptr2 = str2;
|
||||
|
||||
if (NULL == str)
|
||||
return -EINVAL;
|
||||
|
||||
+ strcpy(str2, str);
|
||||
+ strcat(str2, ",en"); // logo was already displayed by uboot
|
||||
+ ptr = ptr2 = str2;
|
||||
+
|
||||
do {
|
||||
if (!isalpha(*ptr) && !isdigit(*ptr)) {
|
||||
find = 1;
|
||||
@@ -611,7 +617,7 @@ static int __init get_vout_init_mode(char *str)
|
||||
|
||||
sep[0] = *ptr;
|
||||
sep[1] = '\0';
|
||||
- while ((count--) && (option = strsep(&str, sep))) {
|
||||
+ while ((count--) && (option = strsep(&ptr2, sep))) {
|
||||
/* vout_log_info("%s\n", option); */
|
||||
str2lower(option);
|
||||
vout_init_mode_parse(option);
|
||||
@@ -619,7 +625,7 @@ static int __init get_vout_init_mode(char *str)
|
||||
@@ -664,7 +664,16 @@ static int __init get_vout_init_mode(char *str)
|
||||
|
||||
return 0;
|
||||
}
|
||||
-__setup("vout=", get_vout_init_mode);
|
||||
+__setup("hdmimode=", get_vout_init_mode);
|
||||
+//__setup("vout=", get_vout_init_mode);
|
||||
+
|
||||
+void set_vout_init_vmode(char *str)
|
||||
+{
|
||||
+ char str2[1024];
|
||||
+ strcpy(str2, str);
|
||||
+ strcat(str2, ",en"); // logo was already displayed by uboot
|
||||
+ get_vout_init_mode(str2);
|
||||
+}
|
||||
+EXPORT_SYMBOL(set_vout_init_vmode);
|
||||
|
||||
MODULE_AUTHOR("Platform-BJ <platform.bj@amlogic.com>");
|
||||
MODULE_DESCRIPTION("VOUT Server Module");
|
||||
diff --git a/include/linux/amlogic/vout/vout_notify.h b/include/linux/amlogic/vout/vout_notify.h
|
||||
index 2e4922a..659da93 100644
|
||||
--- a/include/linux/amlogic/vout/vout_notify.h
|
||||
+++ b/include/linux/amlogic/vout/vout_notify.h
|
||||
@@ -102,6 +102,7 @@ extern enum vmode_e validate_vmode2(char *);
|
||||
extern void set_vout2_mode_internal(char *name);
|
||||
extern enum vmode_e get_logo_vmode(void);
|
||||
extern int set_logo_vmode(enum vmode_e);
|
||||
+extern void set_vout_init_vmode(char *);
|
||||
|
||||
extern int vout2_suspend(void);
|
||||
extern int vout2_resume(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user