mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 05:36:47 +00:00
projects: remove WeTek_Core project
This commit is contained in:
parent
f729718f3f
commit
2a84e74d8d
@ -1,40 +0,0 @@
|
||||
#*********************************************************************************************************
|
||||
#this file is configuration for each factory remote device
|
||||
# work_mode 0 :software mode 1 :hardware mode
|
||||
# repeat_enable 0 :disable repeat 1 :enable repeat
|
||||
#
|
||||
# factory_code each device has it's unique factory code.
|
||||
# pattern:custom_code(16bit)+index_code(16bit)
|
||||
# examble: 0xff000001 = 0xff00(custom cod) 0001 (index)
|
||||
#
|
||||
# release_delay unit:ms.release will report from kernel to user layer after this period of time
|
||||
# from press or repeat triggered.
|
||||
#
|
||||
# debug_enable 0 :debug disable 1 :debug disable
|
||||
#
|
||||
# SW MODE:
|
||||
# bit_count how many bits in each frame
|
||||
# tw_leader_act time window for leader active
|
||||
# tw_bit0 time window for bit0 time.
|
||||
# tw_bit1 time window for bit1 time
|
||||
# tw_repeat_leader time window for repeat leader
|
||||
# REG
|
||||
# reg_base_gen set value for PREG_IR_DEC_BASE_GEN
|
||||
# reg_control set value for PREG_IR_DEC_CONTROL
|
||||
# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE
|
||||
# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE
|
||||
# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
|
||||
# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME
|
||||
#*************************************************************************************************************
|
||||
#Amlogic NEC remote
|
||||
factory_code = 0xbc430001
|
||||
work_mode = 0
|
||||
repeat_enable = 1
|
||||
repeat_delay = 40
|
||||
repeat_peroid = 39
|
||||
release_delay = 121
|
||||
debug_enable = 1
|
||||
|
||||
key_begin
|
||||
0xca 116 ;POWER
|
||||
key_end
|
@ -1,11 +0,0 @@
|
||||
pcm.!default {
|
||||
type hw
|
||||
card 0
|
||||
device 1
|
||||
format S16_LE
|
||||
}
|
||||
|
||||
ctl.!default {
|
||||
type hw
|
||||
card 0
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
|
||||
echo "$(( $TEMP / 1000 )) C"
|
@ -1 +0,0 @@
|
||||
cputemp
|
@ -1 +0,0 @@
|
||||
amlvideodri
|
@ -1 +0,0 @@
|
||||
mali
|
@ -1 +0,0 @@
|
||||
dhd
|
@ -1,3 +0,0 @@
|
||||
[Sleep]
|
||||
SuspendMode=false
|
||||
HibernateMode=false
|
@ -1,22 +0,0 @@
|
||||
[Unit]
|
||||
Description=Debug Shell on /dev/ttyS0
|
||||
DefaultDependencies=no
|
||||
ConditionKernelCommandLine=|console=ttyS0,115200
|
||||
ConditionKernelCommandLine=|console=ttyS0,115200n8
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/storage
|
||||
Environment="ENV=/etc/profile"
|
||||
ExecStartPre=/bin/sh -c 'echo -en "\033[?25h"'
|
||||
ExecStart=/bin/sh
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
StandardInput=tty
|
||||
TTYPath=/dev/ttyS0
|
||||
KillMode=process
|
||||
IgnoreSIGPIPE=no
|
||||
# bash ignores SIGTERM
|
||||
KillSignal=SIGHUP
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<keymap>
|
||||
<global>
|
||||
<keyboard>
|
||||
<f7>ContextMenu</f7>
|
||||
<f1>AspectRatio</f1>
|
||||
<home>XBMC.ActivateWindow(Home)</home>
|
||||
<f2>ActivateWindowAndFocus(MyPVR, 31,0, 10,0)</f2>
|
||||
<f6>FullScreen</f6>
|
||||
<key id="61952">Screenshot</key> <!-- KEY_RECORD -->
|
||||
</keyboard>
|
||||
</global>
|
||||
</keymap>
|
@ -1,95 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
||||
|
||||
hdmimode="720p"
|
||||
|
||||
# Parse command line arguments
|
||||
for arg in $(cat /proc/cmdline); do
|
||||
case $arg in
|
||||
hdmimode=*)
|
||||
hdmimode="${arg#*=}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "$hdmimode" > /sys/class/display/mode
|
||||
|
||||
# Enable first framebuffer
|
||||
echo 0 > /sys/class/graphics/fb0/blank
|
||||
|
||||
# Disable second framebuffer
|
||||
echo 1 > /sys/class/graphics/fb1/blank
|
||||
|
||||
# Disable framebuffer scaling
|
||||
echo 0 > /sys/class/graphics/fb0/free_scale
|
||||
|
||||
# set initial video state
|
||||
echo 1 > /sys/class/video/disable_video
|
||||
|
||||
# Set default resolution parameters
|
||||
bpp=32;
|
||||
xRes=1280;
|
||||
yRes=720;
|
||||
|
||||
# Get max supported display resolution by hdmi device
|
||||
maxRes=$(tail -n1 /sys/class/amhdmitx/amhdmitx0/disp_cap | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//');
|
||||
if [ -z "$maxRes" ]; then
|
||||
maxRes="$hdmimode";
|
||||
fi
|
||||
case "$maxRes" in
|
||||
480*)
|
||||
xRes=720; yRes=480;
|
||||
;;
|
||||
576*)
|
||||
xRes=720; yRes=576;
|
||||
;;
|
||||
1080*)
|
||||
xRes=1920; yRes=1080;
|
||||
;;
|
||||
4k2k*hz|2160p*)
|
||||
xRes=3840; yRes=2160;
|
||||
;;
|
||||
4k2ksmpte|smpte24hz)
|
||||
xRes=4096; yRes=2160;
|
||||
;;
|
||||
esac
|
||||
vXRes=$xRes;
|
||||
vYRes=$(( $yRes * 2 ));
|
||||
|
||||
# Choose boot resolution by hdmimode param
|
||||
case "$hdmimode" in
|
||||
480*)
|
||||
if [ "$vXRes" -ge 720 -a "$vYRes" -ge 960 ]; then
|
||||
xRes=720; yRes=480;
|
||||
fi
|
||||
;;
|
||||
576*)
|
||||
if [ "$vXRes" -ge 720 -a "$vYRes" -ge 1152 ]; then
|
||||
xRes=720; yRes=576;
|
||||
fi
|
||||
;;
|
||||
720*)
|
||||
if [ "$vXRes" -ge 1280 -a "$vYRes" -ge 1440 ]; then
|
||||
xRes=1280; yRes=720;
|
||||
fi
|
||||
;;
|
||||
1080*)
|
||||
if [ "$vXRes" -ge 1920 -a "$vYRes" -ge 2160 ]; then
|
||||
xRes=1920; yRes=1080;
|
||||
fi
|
||||
;;
|
||||
4k2k*hz|2160p*)
|
||||
if [ "$vXRes" -ge 3840 -a "$vYRes" -ge 4320 ]; then
|
||||
xRes=3840; yRes=2160;
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Set framebuffer geometry to match the resolution
|
||||
fbset -fb /dev/fb0 -g $xRes $yRes $vXRes $vYRes $bpp;
|
||||
|
||||
# Include deinterlacer into default VFM map
|
||||
echo rm default > /sys/class/vfm/map
|
||||
echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,39 +0,0 @@
|
||||
show_progress(0, 0);
|
||||
set_bootloader_env("upgrade_step", "3");
|
||||
|
||||
show_progress(0.200000, 12);
|
||||
# Format data partition if previous installation is Android
|
||||
mount("ext4", "EMMC", "/dev/block/system", "/system");
|
||||
if
|
||||
sha1_check(read_file("/system/build.prop"))
|
||||
then
|
||||
ui_print("Wiping data");
|
||||
format("ext4", "EMMC", "/dev/block/data", "0", "/data");
|
||||
endif;
|
||||
unmount("/system");
|
||||
|
||||
ui_print("Wiping system");
|
||||
format("ext4", "EMMC", "/dev/block/system", "0", "/system");
|
||||
|
||||
show_progress(0.700000, 160);
|
||||
ui_print("Writing kernel");
|
||||
write_raw_image(package_extract_file("KERNEL"), "boot");
|
||||
|
||||
ui_print("Writing system");
|
||||
mount("ext4", "EMMC", "/dev/block/system", "/system");
|
||||
package_extract_dir("system", "/system");
|
||||
unmount("/system");
|
||||
|
||||
show_progress(0.100000, 6);
|
||||
ui_print("Writing recovery");
|
||||
write_raw_image(package_extract_file("recovery.img"), "recovery");
|
||||
|
||||
ui_print("Writing bootloader");
|
||||
write_raw_image(package_extract_file("bootloader.img"), "bootloader");
|
||||
|
||||
ui_print("Writing logo");
|
||||
write_raw_image(package_extract_file("logo.img"), "logo");
|
||||
|
||||
set_bootloader_env("upgrade_step", "1");
|
||||
set_progress(1);
|
||||
ui_print("LibreELEC Installed Successfully");
|
File diff suppressed because it is too large
Load Diff
@ -1,149 +0,0 @@
|
||||
################################################################################
|
||||
# setup system defaults
|
||||
################################################################################
|
||||
|
||||
# The TARGET_CPU variable controls which processor should be targeted for
|
||||
# generated code.
|
||||
case $TARGET_ARCH in
|
||||
arm)
|
||||
# TARGET_CPU:
|
||||
# arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm7m arm7d
|
||||
# arm7dm arm7di arm7dmi arm70 arm700 arm700i arm710 arm710c
|
||||
# arm7100 arm720 arm7500 arm7500fe arm7tdmi arm7tdmi-s arm710t
|
||||
# arm720t arm740t strongarm strongarm110 strongarm1100
|
||||
# strongarm1110 arm8 arm810 arm9 arm9e arm920 arm920t arm922t
|
||||
# arm946e-s arm966e-s arm968e-s arm926ej-s arm940t arm9tdmi
|
||||
# arm10tdmi arm1020t arm1026ej-s arm10e arm1020e arm1022e
|
||||
# arm1136j-s arm1136jf-s mpcore mpcorenovfp arm1156t2-s
|
||||
# arm1176jz-s arm1176jzf-s cortex-a8 cortex-a9 cortex-r4
|
||||
# cortex-r4f cortex-m3 cortex-m1 xscale iwmmxt iwmmxt2 ep9312.
|
||||
#
|
||||
TARGET_CPU="cortex-a9"
|
||||
|
||||
# TARGET_FLOAT:
|
||||
# Specifies which floating-point ABI to use. Permissible values are:
|
||||
# soft softfp hard
|
||||
TARGET_FLOAT="hard"
|
||||
|
||||
# TARGET_FPU:
|
||||
# This specifies what floating point hardware (or hardware emulation) is
|
||||
# available on the target. Permissible names are:
|
||||
# fpa fpe2 fpe3 maverick vfp vfpv3 vfpv3-fp16 vfpv3-d16 vfpv3-d16-fp16
|
||||
# vfpv3xd vfpv3xd-fp16 neon neon-fp16 vfpv4 vfpv4-d16 fpv4-sp-d16
|
||||
# neon-vfpv4.
|
||||
TARGET_FPU="neon-fp16"
|
||||
TARGET_FEATURES="32bit"
|
||||
|
||||
# Use linaro toolchain to build kernel
|
||||
KERNEL_LINARO_TOOLCHAIN="arm-linux-gnueabihf"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Bootloader to use (syslinux / u-boot / atv-bootloader / bcm2835-bootloader)
|
||||
BOOTLOADER="u-boot"
|
||||
|
||||
# u-boot version to use (default)
|
||||
UBOOT_VERSION="vendor"
|
||||
|
||||
# Configuration for u-boot
|
||||
UBOOT_CONFIG=""
|
||||
|
||||
# Target Configfile for u-boot
|
||||
UBOOT_CONFIGFILE=""
|
||||
|
||||
# Kernel target
|
||||
KERNEL_TARGET="uImage-dtb"
|
||||
|
||||
# Kernel extra targets to build
|
||||
KERNEL_UBOOT_EXTRA_TARGET="meson8m2_wetek_core.dtd meson8m2_wetek_core.dtb"
|
||||
|
||||
# Build Android kernel image using mkbootimg
|
||||
BUILD_ANDROID_BOOTIMG="yes"
|
||||
|
||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||
KERNEL_MAKE_EXTRACMD=""
|
||||
|
||||
# Additional kernel dependencies
|
||||
KERNEL_EXTRA_DEPENDS_TARGET=""
|
||||
|
||||
# Kernel to use. values can be:
|
||||
# default: default mainline kernel
|
||||
LINUX="amlogic-3.10"
|
||||
|
||||
|
||||
################################################################################
|
||||
# setup build defaults
|
||||
################################################################################
|
||||
|
||||
# Project CFLAGS
|
||||
PROJECT_CFLAGS=""
|
||||
|
||||
# SquashFS compression method (gzip / lzo / xz)
|
||||
SQUASHFS_COMPRESSION="lzo"
|
||||
|
||||
################################################################################
|
||||
# setup project defaults
|
||||
################################################################################
|
||||
|
||||
# build and install ALSA Audio support (yes / no)
|
||||
ALSA_SUPPORT="yes"
|
||||
|
||||
# OpenGL(X) implementation to use (no / Mesa)
|
||||
OPENGL="no"
|
||||
|
||||
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson)
|
||||
OPENGLES="opengl-meson"
|
||||
|
||||
# Amlogic Meson SOC family (8 / 6 / gxbb)
|
||||
MESON_FAMILY="8"
|
||||
|
||||
# include uvesafb support (yes / no)
|
||||
UVESAFB_SUPPORT="no"
|
||||
|
||||
# Displayserver to use (x11 / no)
|
||||
DISPLAYSERVER="no"
|
||||
|
||||
# Windowmanager to use (fluxbox / none)
|
||||
WINDOWMANAGER="none"
|
||||
|
||||
# Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia,nouveau)
|
||||
# Space separated list is supported,
|
||||
# e.g. GRAPHIC_DRIVERS="i915 i965 r300 r600 radeonsi nvidia nouveau"
|
||||
GRAPHIC_DRIVERS=""
|
||||
|
||||
# KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap / libamcodec)
|
||||
KODIPLAYER_DRIVER="libamcodec"
|
||||
|
||||
# Modules to install in initramfs for early boot
|
||||
INITRAMFS_MODULES=""
|
||||
|
||||
# additional drivers to install:
|
||||
# for a list of additinoal drivers see packages/linux-drivers
|
||||
# Space separated list is supported,
|
||||
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
|
||||
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS"
|
||||
|
||||
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
|
||||
# Space separated list is supported,
|
||||
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
|
||||
FIRMWARE="misc-firmware wlan-firmware wlan-firmware-aml dvb-firmware brcmfmac_sdio-firmware-aml"
|
||||
|
||||
# build and install ATV IR remote support (yes / no)
|
||||
ATVCLIENT_SUPPORT="no"
|
||||
|
||||
# Amlogic IR remote support (yes / no)
|
||||
AMREMOTE_SUPPORT="yes"
|
||||
|
||||
# build with installer (yes / no)
|
||||
INSTALLER_SUPPORT="no"
|
||||
|
||||
# kernel image name
|
||||
KERNEL_NAME="kernel.img"
|
||||
|
||||
# build and install driver addons (yes / no)
|
||||
DRIVER_ADDONS_SUPPORT="no"
|
||||
|
||||
# driver addons to install:
|
||||
# for a list of additinoal drivers see packages/linux-driver-addons
|
||||
# Space separated list is supported,
|
||||
DRIVER_ADDONS="crazycat"
|
@ -1,13 +0,0 @@
|
||||
fixes broken audio at WP1 and WC
|
||||
Fill audio packets completely when resampling to prevent 'audio data unaligned' kernel warnings
|
||||
|
||||
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp
|
||||
@@ -143,6 +143,7 @@
|
||||
m_inputFormat.m_channelLayout.Reset();
|
||||
m_inputFormat.m_channelLayout += AE_CH_FC;
|
||||
}
|
||||
+ m_fillPackets = true;
|
||||
m_resampleQuality = quality;
|
||||
}
|
||||
|
@ -1,759 +0,0 @@
|
||||
From bd56646f065c5952266adc28ed569be29159d818 Mon Sep 17 00:00:00 2001
|
||||
From: Gerald Dachs <gda@dachsweb.de>
|
||||
Date: Tue, 6 Dec 2016 11:06:49 +0100
|
||||
Subject: [PATCH] Amlogic CEC adapter
|
||||
|
||||
---
|
||||
include/cectypes.h | 13 +-
|
||||
src/libcec/CMakeLists.txt | 3 +
|
||||
src/libcec/adapter/AdapterFactory.cpp | 22 ++
|
||||
src/libcec/adapter/Amlogic/AmlogicCEC.h | 41 +++
|
||||
.../Amlogic/AmlogicCECAdapterCommunication.cpp | 306 +++++++++++++++++++++
|
||||
.../Amlogic/AmlogicCECAdapterCommunication.h | 106 +++++++
|
||||
.../adapter/Amlogic/AmlogicCECAdapterDetection.cpp | 50 ++++
|
||||
.../adapter/Amlogic/AmlogicCECAdapterDetection.h | 46 ++++
|
||||
src/libcec/cmake/CheckPlatformSupport.cmake | 13 +
|
||||
src/libcec/cmake/DisplayPlatformSupport.cmake | 6 +
|
||||
src/libcec/env.h.in | 3 +
|
||||
11 files changed, 608 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/libcec/adapter/Amlogic/AmlogicCEC.h
|
||||
create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp
|
||||
create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.cpp
|
||||
create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.h
|
||||
|
||||
diff --git a/include/cectypes.h b/include/cectypes.h
|
||||
index 9c91842..3af93ca 100644
|
||||
--- a/include/cectypes.h
|
||||
+++ b/include/cectypes.h
|
||||
@@ -276,6 +276,16 @@ namespace CEC {
|
||||
*/
|
||||
#define CEC_EXYNOS_VIRTUAL_COM "Exynos"
|
||||
|
||||
+/*!
|
||||
+ * the path to use for the Amlogic HDMI CEC device
|
||||
+ */
|
||||
+#define CEC_AMLOGIC_PATH "/dev/AmlogicCEC"
|
||||
+
|
||||
+/*!
|
||||
+ * the name of the virtual COM port to use for the AMLOGIC' CEC wire
|
||||
+ */
|
||||
+#define CEC_AMLOGIC_VIRTUAL_COM "Amlogic"
|
||||
+
|
||||
/**
|
||||
* Maximum size of a data packet
|
||||
*/
|
||||
@@ -861,7 +871,8 @@ typedef enum cec_adapter_type
|
||||
ADAPTERTYPE_RPI = 0x100,
|
||||
ADAPTERTYPE_TDA995x = 0x200,
|
||||
ADAPTERTYPE_EXYNOS = 0x300,
|
||||
- ADAPTERTYPE_AOCEC = 0x500
|
||||
+ ADAPTERTYPE_AOCEC = 0x500,
|
||||
+ ADAPTERTYPE_AMLOGIC = 0x600
|
||||
} cec_adapter_type;
|
||||
|
||||
/** force exporting through swig */
|
||||
diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt
|
||||
index 6baee69..a537825 100644
|
||||
--- a/src/libcec/CMakeLists.txt
|
||||
+++ b/src/libcec/CMakeLists.txt
|
||||
@@ -89,6 +89,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h
|
||||
adapter/Exynos/ExynosCEC.h
|
||||
adapter/Exynos/ExynosCECAdapterDetection.h
|
||||
adapter/Exynos/ExynosCECAdapterCommunication.h
|
||||
+ adapter/Amlogic/AmlogicCEC.h
|
||||
+ adapter/Amlogic/AmlogicCECAdapterDetection.h
|
||||
+ adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
adapter/AOCEC/AOCEC.h
|
||||
adapter/AOCEC/AOCECAdapterDetection.h
|
||||
adapter/AOCEC/AOCECAdapterCommunication.h
|
||||
diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp
|
||||
index 91195ea..3344516 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_AMLOGIC_API)
|
||||
+#include "Amlogic/AmlogicCECAdapterDetection.h"
|
||||
+#include "Amlogic/AmlogicCECAdapterCommunication.h"
|
||||
+#endif
|
||||
+
|
||||
#if defined(HAVE_AOCEC_API)
|
||||
#include "AOCEC/AOCECAdapterDetection.h"
|
||||
#include "AOCEC/AOCECAdapterCommunication.h"
|
||||
@@ -143,6 +148,18 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_AMLOGIC_API)
|
||||
+ if (iAdaptersFound < iBufSize && CAmlogicCECAdapterDetection::FindAdapter())
|
||||
+ {
|
||||
+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_AMLOGIC_PATH);
|
||||
+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_AMLOGIC_VIRTUAL_COM);
|
||||
+ deviceList[iAdaptersFound].iVendorId = 0;
|
||||
+ deviceList[iAdaptersFound].iProductId = 0;
|
||||
+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_AMLOGIC;
|
||||
+ iAdaptersFound++;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
|
||||
#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"
|
||||
@@ -173,6 +190,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
|
||||
return new CRPiCECAdapterCommunication(m_lib->m_cec);
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_AMLOGIC_API)
|
||||
+ if (!strcmp(strPort, CEC_AMLOGIC_VIRTUAL_COM))
|
||||
+ return new CAmlogicCECAdapterCommunication(m_lib->m_cec);
|
||||
+#endif
|
||||
+
|
||||
#if defined(HAVE_P8_USB)
|
||||
return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate);
|
||||
#endif
|
||||
diff --git a/src/libcec/adapter/Amlogic/AmlogicCEC.h b/src/libcec/adapter/Amlogic/AmlogicCEC.h
|
||||
new file mode 100644
|
||||
index 0000000..7b86982
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCEC.h
|
||||
@@ -0,0 +1,41 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC Amlogic 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_SETLADDR _IOW('c', 0, unsigned int)
|
||||
+#define CEC_IOC_GETPADDR _IO('c', 1)
|
||||
+#define CEC_MAX_FRAME_SIZE 16
|
||||
diff --git a/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp
|
||||
new file mode 100644
|
||||
index 0000000..88d19db
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp
|
||||
@@ -0,0 +1,306 @@
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC Amlogic 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_AMLOGIC_API)
|
||||
+#include "AmlogicCEC.h"
|
||||
+#include "AmlogicCECAdapterCommunication.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()
|
||||
+
|
||||
+
|
||||
+CAmlogicCECAdapterCommunication::CAmlogicCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
|
||||
+ IAdapterCommunication(callback),
|
||||
+ m_bLogicalAddressChanged(false)
|
||||
+{
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ m_logicalAddresses.Clear();
|
||||
+ m_fd = INVALID_SOCKET_VALUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+CAmlogicCECAdapterCommunication::~CAmlogicCECAdapterCommunication(void)
|
||||
+{
|
||||
+ Close();
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool CAmlogicCECAdapterCommunication::IsOpen(void)
|
||||
+{
|
||||
+ CLockObject lock(m_mutex);
|
||||
+ return IsInitialised() && m_fd != INVALID_SOCKET_VALUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool CAmlogicCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening)
|
||||
+{
|
||||
+ if (IsOpen())
|
||||
+ Close();
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if ((m_fd = open(CEC_AMLOGIC_PATH, O_RDWR)) > 0)
|
||||
+ {
|
||||
+ if (!bStartListening || CreateThread()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ close(m_fd);
|
||||
+ m_fd = INVALID_SOCKET_VALUE;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void CAmlogicCECAdapterCommunication::Close(void)
|
||||
+{
|
||||
+ StopThread(0);
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ close(m_fd);
|
||||
+ m_fd = INVALID_SOCKET_VALUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+std::string CAmlogicCECAdapterCommunication::GetError(void) const
|
||||
+{
|
||||
+ std::string strError(m_strError);
|
||||
+ return strError;
|
||||
+}
|
||||
+
|
||||
+int CAmlogicCECAdapterCommunication::getFileDescriptor(void)
|
||||
+{
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ return m_fd;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+cec_adapter_message_state CAmlogicCECAdapterCommunication::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 CAmlogicCECAdapterCommunication::GetFirmwareVersion(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+cec_vendor_id CAmlogicCECAdapterCommunication::GetVendorId(void)
|
||||
+{
|
||||
+ return cec_vendor_id(CEC_VENDOR_UNKNOWN);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+uint16_t CAmlogicCECAdapterCommunication::GetPhysicalAddress(void)
|
||||
+{
|
||||
+ int phys_addr = CEC_DEFAULT_PADDR;
|
||||
+
|
||||
+ if (!IsOpen())
|
||||
+ return (uint16_t)phys_addr;
|
||||
+
|
||||
+ CLockObject lock(m_mutex);
|
||||
+
|
||||
+ if ((phys_addr = ioctl(m_fd, CEC_IOC_GETPADDR)) < 0)
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL GetPhysicalAddr failed !", __func__);
|
||||
+ phys_addr = CEC_DEFAULT_PADDR;
|
||||
+ }
|
||||
+ return (uint16_t)phys_addr;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+cec_logical_addresses CAmlogicCECAdapterCommunication::GetLogicalAddresses(void)
|
||||
+{
|
||||
+ return m_logicalAddresses;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool CAmlogicCECAdapterCommunication::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_SETLADDR, &log_addr))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL SetLogicalAddr failed !", __func__);
|
||||
+ return false;
|
||||
+ }
|
||||
+ m_logicalAddresses = addresses;
|
||||
+ m_bLogicalAddressChanged = true;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void CAmlogicCECAdapterCommunication::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_SETLADDR, &log_addr))
|
||||
+ {
|
||||
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL SetLogicalAddr failed !", __func__);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void *CAmlogicCECAdapterCommunication::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)
|
||||
+ {
|
||||
+ Sleep(250);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ 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 (buffer[0] == 0xff) // driver wants us to reread the physical address
|
||||
+ {
|
||||
+ if (!IsStopped())
|
||||
+ {
|
||||
+ uint16_t iNewAddress = GetPhysicalAddress();
|
||||
+ m_callback->HandlePhysicalAddressChanged(iNewAddress);
|
||||
+ }
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ 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_AMLOGIC_API
|
||||
diff --git a/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
new file mode 100644
|
||||
index 0000000..a8e6fce
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
@@ -0,0 +1,106 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC Amlogic 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_AMLOGIC_API)
|
||||
+
|
||||
+#include <p8-platform/threads/mutex.h>
|
||||
+#include <p8-platform/threads/threads.h>
|
||||
+#include "../AdapterCommunication.h"
|
||||
+#include <map>
|
||||
+
|
||||
+namespace CEC
|
||||
+{
|
||||
+ class CAmlogicCECAdapterCommunication : 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.
|
||||
+ */
|
||||
+ CAmlogicCECAdapterCommunication(IAdapterCommunicationCallback *callback);
|
||||
+ virtual ~CAmlogicCECAdapterCommunication(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 SetAutoMode(bool UNUSED(automode)) override { return false; }
|
||||
+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; }
|
||||
+ std::string GetPortName(void) { return std::string("AMLOGIC"); }
|
||||
+ 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_AMLOGIC; }
|
||||
+ 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/Amlogic/AmlogicCECAdapterDetection.cpp b/src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.cpp
|
||||
new file mode 100644
|
||||
index 0000000..2247346
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.cpp
|
||||
@@ -0,0 +1,50 @@
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC Amlogic 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_AMLOGIC_API)
|
||||
+#include "AmlogicCECAdapterDetection.h"
|
||||
+#include "AmlogicCEC.h"
|
||||
+
|
||||
+using namespace CEC;
|
||||
+
|
||||
+bool CAmlogicCECAdapterDetection::FindAdapter(void)
|
||||
+{
|
||||
+ return access(CEC_AMLOGIC_PATH, 0) == 0;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
diff --git a/src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.h b/src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.h
|
||||
new file mode 100644
|
||||
index 0000000..8a7418d
|
||||
--- /dev/null
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.h
|
||||
@@ -0,0 +1,46 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * This file is part of the libCEC(R) library.
|
||||
+ *
|
||||
+ * libCEC Amlogic 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 CAmlogicCECAdapterDetection
|
||||
+ {
|
||||
+ public:
|
||||
+ static bool FindAdapter(void);
|
||||
+ };
|
||||
+}
|
||||
diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake
|
||||
index b7773ee..58ba8f1 100644
|
||||
--- a/src/libcec/cmake/CheckPlatformSupport.cmake
|
||||
+++ b/src/libcec/cmake/CheckPlatformSupport.cmake
|
||||
@@ -11,6 +11,7 @@
|
||||
# HAVE_EXYNOS_API ON if Exynos is supported
|
||||
# HAVE_AOCEC_API ON if AOCEC is supported
|
||||
# HAVE_P8_USB ON if Pulse-Eight devices are supported
|
||||
+# HAVE_AMLOGIC_API ON if AMLOGIC is supported
|
||||
# HAVE_P8_USB_DETECT ON if Pulse-Eight devices can be auto-detected
|
||||
# HAVE_DRM_EDID_PARSER ON if DRM EDID parsing is supported
|
||||
#
|
||||
@@ -139,6 +140,18 @@ else()
|
||||
list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_EXYNOS})
|
||||
endif()
|
||||
|
||||
+ # Amlogic
|
||||
+ if (${HAVE_AMLOGIC_API})
|
||||
+ set(LIB_INFO "${LIB_INFO}, Amlogic")
|
||||
+ set(HAVE_AMLOGIC_API 1)
|
||||
+ set(CEC_SOURCES_ADAPTER_AMLOGIC adapter/Amlogic/AmlogicCECAdapterDetection.cpp
|
||||
+ adapter/Amlogic/AmlogicCECAdapterCommunication.cpp)
|
||||
+ source_group("Source Files\\adapter\\Amlogic" FILES ${CEC_SOURCES_ADAPTER_AMLOGIC})
|
||||
+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_AMLOGIC})
|
||||
+ else()
|
||||
+ set(HAVE_AMLOGIC_API 0)
|
||||
+ endif()
|
||||
+
|
||||
# AOCEC
|
||||
if (${HAVE_AOCEC_API})
|
||||
set(LIB_INFO "${LIB_INFO}, AOCEC")
|
||||
diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake
|
||||
index 83a778a..c7088f3 100644
|
||||
--- a/src/libcec/cmake/DisplayPlatformSupport.cmake
|
||||
+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake
|
||||
@@ -56,5 +56,11 @@ else()
|
||||
message(STATUS "Python support: no")
|
||||
endif()
|
||||
|
||||
+if (HAVE_AMLOGIC_API)
|
||||
+ message(STATUS "Amlogic support: yes")
|
||||
+else()
|
||||
+ message(STATUS "Amlogic support: no")
|
||||
+endif()
|
||||
+
|
||||
message(STATUS "lib info: ${LIB_INFO}")
|
||||
|
||||
diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in
|
||||
index 456a2e7..a40f931 100644
|
||||
--- a/src/libcec/env.h.in
|
||||
+++ b/src/libcec/env.h.in
|
||||
@@ -82,6 +82,9 @@
|
||||
/* Define to 1 for nVidia EDID parsing support (on selected models) */
|
||||
#cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@
|
||||
|
||||
+/* Define to 1 for Amlogic support */
|
||||
+#cmakedefine HAVE_AMLOGIC_API @HAVE_AMLOGIC_API@
|
||||
+
|
||||
/* Define to 1 for DRM EDID parsing support */
|
||||
#cmakedefine HAVE_DRM_EDID_PARSER @HAVE_DRM_EDID_PARSER@
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 2b29cb0830548d4957f1d5ca86640831d224670e Mon Sep 17 00:00:00 2001
|
||||
From: Sam Nazarko <email@samnazarko.co.uk>
|
||||
Date: Sun, 9 Apr 2017 17:34:36 +0100
|
||||
Subject: [PATCH] Make p8platform mutex mutable without changing libplatform
|
||||
|
||||
Signed-off-by: Sam Nazarko <email@samnazarko.co.uk>
|
||||
---
|
||||
src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp | 2 +-
|
||||
src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp
|
||||
index 60813ed..798454e 100644
|
||||
--- a/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp
|
||||
@@ -193,7 +193,7 @@ uint16_t CAmlogicCECAdapterCommunication::GetPhysicalAddress(void)
|
||||
}
|
||||
|
||||
|
||||
-cec_logical_addresses CAmlogicCECAdapterCommunication::GetLogicalAddresses(void)
|
||||
+cec_logical_addresses CAmlogicCECAdapterCommunication::GetLogicalAddresses(void) const
|
||||
{
|
||||
CLockObject lock(m_mutex);
|
||||
return m_logicalAddresses;
|
||||
diff --git a/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
index 0e99cf8..635bb81 100644
|
||||
--- a/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
+++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h
|
||||
@@ -66,7 +66,7 @@ namespace CEC
|
||||
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);
|
||||
+ cec_logical_addresses GetLogicalAddresses(void) const;
|
||||
bool PingAdapter(void) { return IsInitialised(); }
|
||||
uint16_t GetFirmwareVersion(void);
|
||||
uint32_t GetFirmwareBuildDate(void) { return 0; }
|
||||
@@ -98,7 +98,7 @@ namespace CEC
|
||||
|
||||
bool m_bLogicalAddressChanged;
|
||||
cec_logical_addresses m_logicalAddresses;
|
||||
- P8PLATFORM::CMutex m_mutex;
|
||||
+ mutable P8PLATFORM::CMutex m_mutex;
|
||||
int m_fd;
|
||||
};
|
||||
};
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,12 +0,0 @@
|
||||
diff --git a/arch/arm/mach-meson8/pm.c b/arch/arm/mach-meson8/pm.c
|
||||
index 754f7274b2e..9bda172c450 100755
|
||||
--- a/arch/arm/mach-meson8/pm.c
|
||||
+++ b/arch/arm/mach-meson8/pm.c
|
||||
@@ -421,6 +421,7 @@ static struct platform_driver meson_pm_driver = {
|
||||
static int __init meson_pm_init(void)
|
||||
{
|
||||
printk("enter %s\n",__func__);
|
||||
+ pm_power_off = meson_pm_suspend;
|
||||
return platform_driver_probe(&meson_pm_driver, meson_pm_probe);
|
||||
}
|
||||
late_initcall(meson_pm_init);
|
@ -1,106 +0,0 @@
|
||||
diff -Naur a/drivers/amlogic/wifi/wifi_dt.c b/drivers/amlogic/wifi/wifi_dt.c
|
||||
--- a/drivers/amlogic/wifi/wifi_dt.c 2015-02-14 20:42:24.000000000 +0100
|
||||
+++ b/drivers/amlogic/wifi/wifi_dt.c 2015-05-31 18:50:01.000000000 +0200
|
||||
@@ -162,11 +162,51 @@
|
||||
.of_match_table = wifi_match
|
||||
},
|
||||
};
|
||||
+//#ifdef CONFIG_ARCH_MESON6
|
||||
+struct pinctrl *bt_pinctrl = NULL;
|
||||
|
||||
+static int bt_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+#ifdef CONFIG_OF
|
||||
+ if (pdev->dev.of_node) {
|
||||
+ bt_pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
|
||||
+ }
|
||||
+#endif
|
||||
+ return 0;
|
||||
+}
|
||||
+static int bt_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ if (bt_pinctrl)
|
||||
+ devm_pinctrl_put(bt_pinctrl);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#ifdef CONFIG_OF
|
||||
+static const struct of_device_id bt_dev_dt_match[]={
|
||||
+ { .compatible = "amlogic,bt-dev",
|
||||
+ },
|
||||
+ {},
|
||||
+};
|
||||
+#else
|
||||
+#define bt_dev_dt_match NULL
|
||||
+#endif
|
||||
+
|
||||
+static struct platform_driver bt_driver = {
|
||||
+ .driver = {
|
||||
+ .name = "bt-dev",
|
||||
+ .of_match_table = bt_dev_dt_match,
|
||||
+ },
|
||||
+ .probe = bt_probe,
|
||||
+ .remove = bt_remove,
|
||||
+};
|
||||
+//#endif
|
||||
static int __init wifi_dt_init(void)
|
||||
{
|
||||
int ret;
|
||||
ret = platform_driver_register(&wifi_plat_driver);
|
||||
+//#ifdef CONFIG_ARCH_MESON6
|
||||
+ ret = platform_driver_register(&bt_driver);
|
||||
+//#endif
|
||||
return ret;
|
||||
}
|
||||
// module_init(wifi_dt_init);
|
||||
@@ -175,6 +215,9 @@
|
||||
static void __exit wifi_dt_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&wifi_plat_driver);
|
||||
+//#ifdef CONFIG_ARCH_MESON6
|
||||
+ platform_driver_unregister(&bt_driver);
|
||||
+//#endif
|
||||
}
|
||||
module_exit(wifi_dt_exit);
|
||||
|
||||
@@ -246,6 +289,40 @@
|
||||
CHECK_RET(ret);
|
||||
SHOW_PIN_OWN("power_on_pin2", wifi_info.power_on_pin2);
|
||||
}
|
||||
+#ifdef CONFIG_ARCH_MESON6
|
||||
+ if (bt_pinctrl) {
|
||||
+
|
||||
+ printk("bt_setup\n");
|
||||
+ ret = amlogic_gpio_request(GPIOX_10, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ ret = amlogic_gpio_direction_output(GPIOX_10, 1, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ msleep(50);
|
||||
+
|
||||
+
|
||||
+ ret = amlogic_gpio_request(GPIOE_11, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ ret = amlogic_gpio_direction_output(GPIOE_11, 0, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ret = amlogic_gpio_direction_output(GPIOE_11, 1, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ msleep(50);
|
||||
+
|
||||
+ }
|
||||
+#endif
|
||||
+#ifdef CONFIG_ARCH_MESON8
|
||||
+ ret = amlogic_gpio_request(GPIOX_20, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ ret = amlogic_gpio_direction_output(GPIOX_20, 0, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ret = amlogic_gpio_direction_output(GPIOX_20, 1, OWNER_NAME);
|
||||
+ CHECK_RET(ret);
|
||||
+ msleep(50);
|
||||
+#endif
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user