mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #3263 from chewitt/drop_310
cleanup: remove WC/WP1 projects and 3.10 kernel target
This commit is contained in:
commit
1616a3d3f9
@ -15,14 +15,6 @@ PKG_IS_KERNEL_PKG="yes"
|
|||||||
PKG_PATCH_DIRS="$LINUX"
|
PKG_PATCH_DIRS="$LINUX"
|
||||||
|
|
||||||
case "$LINUX" in
|
case "$LINUX" in
|
||||||
amlogic-3.10)
|
|
||||||
PKG_VERSION="95ba9d626c0fce672caa296f5911ab9190881642"
|
|
||||||
PKG_SHA256="df34b086993fd3552efae92d84d28990a61a1ca79a8703a4b64241ab80e3b6db"
|
|
||||||
PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
|
|
||||||
PKG_SOURCE_NAME="linux-$LINUX-$PKG_VERSION.tar.gz"
|
|
||||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host u-boot-tools-aml:host"
|
|
||||||
PKG_BUILD_PERF="no"
|
|
||||||
;;
|
|
||||||
amlogic-3.14)
|
amlogic-3.14)
|
||||||
PKG_VERSION="6d8fbb4ee61a7779ac57b5961e076f0c63ff8b65"
|
PKG_VERSION="6d8fbb4ee61a7779ac57b5961e076f0c63ff8b65"
|
||||||
PKG_SHA256="ef05c88779c893f92e92e5315d0e5396f34c32289726c301fae7ffe8c4214227"
|
PKG_SHA256="ef05c88779c893f92e92e5315d0e5396f34c32289726c301fae7ffe8c4214227"
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -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 @@
|
|||||||
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,95 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
# Copyright (C) 2014 Alex Deryskyba (alex@codesnake.com)
|
|
||||||
|
|
||||||
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,29 +0,0 @@
|
|||||||
show_progress(0.500000, 3);
|
|
||||||
set_bootloader_env("upgrade_step", "3");
|
|
||||||
|
|
||||||
show_progress(0.020000, 0);
|
|
||||||
|
|
||||||
ui_print("Wiping System");
|
|
||||||
format("ubifs", "UBI", "system", "0", "/system");
|
|
||||||
mount("ubifs", "UBI", "system", "/system");
|
|
||||||
ui_print("Writing system files");
|
|
||||||
package_extract_file("KERNEL", "/system/KERNEL");
|
|
||||||
package_extract_dir("system", "/system");
|
|
||||||
unmount("/system");
|
|
||||||
|
|
||||||
show_progress(0.300000, 60);
|
|
||||||
|
|
||||||
ui_print("Writing recovery");
|
|
||||||
write_raw_image(package_extract_file("recovery.img"), "recovery");
|
|
||||||
|
|
||||||
show_progress(0.018000, 0);
|
|
||||||
|
|
||||||
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");
|
|
||||||
show_progress(0.100000, 0);
|
|
||||||
ui_print("LibreELEC Installed Successfully");
|
|
File diff suppressed because it is too large
Load Diff
@ -1,138 +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="wetek_play.dtd"
|
|
||||||
|
|
||||||
# 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="6"
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
# Space separated list is supported,
|
|
||||||
# e.g. GRAPHIC_DRIVERS="i915 i965 r300 r600 radeonsi nvidia"
|
|
||||||
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 wetekdvb"
|
|
||||||
|
|
||||||
# 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"
|
|
@ -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
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +0,0 @@
|
|||||||
diff --git a/arch/arm/mach-meson6/pm.c b/arch/arm/mach-meson6/pm.c
|
|
||||||
index 45c0500968f..c5de8f8ca3e 100755
|
|
||||||
--- a/arch/arm/mach-meson6/pm.c
|
|
||||||
+++ b/arch/arm/mach-meson6/pm.c
|
|
||||||
@@ -1143,6 +1143,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,28 +0,0 @@
|
|||||||
diff --git a/arch/arm/mach-meson6/pm.c b/arch/arm/mach-meson6/pm.c
|
|
||||||
index 2c08ec1..9b865e7 100755
|
|
||||||
--- a/arch/arm/mach-meson6/pm.c
|
|
||||||
+++ b/arch/arm/mach-meson6/pm.c
|
|
||||||
@@ -1056,7 +1056,22 @@ static void power_off_unused_pll(void)
|
|
||||||
}
|
|
||||||
static void m6ref_set_vccx2(int power_on)
|
|
||||||
{
|
|
||||||
-
|
|
||||||
+ if (power_on) {
|
|
||||||
+ printk(KERN_INFO "%s() Power ON\n", __FUNCTION__);
|
|
||||||
+ aml_clr_reg32_mask(P_PREG_PAD_GPIO0_EN_N,(1<<26));
|
|
||||||
+ aml_clr_reg32_mask(P_PREG_PAD_GPIO0_O,(1<<26));
|
|
||||||
+
|
|
||||||
+ aml_set_reg32_bits(SECBUS2_REG_ADDR(0), 1, 0, 1); // set TEST_n output mode
|
|
||||||
+ aml_set_reg32_bits(AOBUS_REG_ADDR(0x24), 1, 31, 1); // set TEST_n pin H
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ printk(KERN_INFO "%s() Power OFF\n", __FUNCTION__);
|
|
||||||
+ aml_clr_reg32_mask(P_PREG_PAD_GPIO0_EN_N,(1<<26));
|
|
||||||
+ aml_set_reg32_mask(P_PREG_PAD_GPIO0_O,(1<<26));
|
|
||||||
+
|
|
||||||
+ aml_set_reg32_bits(SECBUS2_REG_ADDR(0), 1, 0, 1); // set TEST_n output mode
|
|
||||||
+ aml_set_reg32_bits(AOBUS_REG_ADDR(0x24), 0, 31, 1); // set TEST_n pin H
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct meson_pm_config aml_pm_pdata = {
|
|
@ -1,55 +0,0 @@
|
|||||||
diff -Naur a/drivers/amlogic/amports/esparser.c b/drivers/amlogic/amports/esparser.c
|
|
||||||
--- a/drivers/amlogic/amports/esparser.c 2015-01-04 18:07:57.000000000 +0100
|
|
||||||
+++ b/drivers/amlogic/amports/esparser.c 2015-01-01 16:42:13.000000000 +0100
|
|
||||||
@@ -296,11 +296,14 @@
|
|
||||||
WRITE_MPEG_REG(RESET1_REGISTER, RESET_PARSER);
|
|
||||||
|
|
||||||
/* TS data path */
|
|
||||||
+ /* Ignore FEC control for WetekPlay */
|
|
||||||
+#ifndef CONFIG_WETEK
|
|
||||||
#ifndef CONFIG_AM_DVB
|
|
||||||
WRITE_MPEG_REG(FEC_INPUT_CONTROL, 0);
|
|
||||||
#else
|
|
||||||
tsdemux_set_reset_flag();
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL_2, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL_3, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
diff -Naur a/drivers/amlogic/amports/psparser.c b/drivers/amlogic/amports/psparser.c
|
|
||||||
--- a/drivers/amlogic/amports/psparser.c 2015-01-04 18:07:58.000000000 +0100
|
|
||||||
+++ b/drivers/amlogic/amports/psparser.c 2015-01-01 16:43:58.000000000 +0100
|
|
||||||
@@ -833,11 +833,15 @@
|
|
||||||
WRITE_MPEG_REG(RESET1_REGISTER, RESET_PARSER);
|
|
||||||
|
|
||||||
/* TS data path */
|
|
||||||
+ /* Ignore FEC control for WetekPlay */
|
|
||||||
+#ifndef CONFIG_WETEK
|
|
||||||
#ifndef CONFIG_AM_DVB
|
|
||||||
WRITE_MPEG_REG(FEC_INPUT_CONTROL, 0);
|
|
||||||
#else
|
|
||||||
tsdemux_set_reset_flag();
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL_2, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL_3, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
diff -Naur a/drivers/amlogic/amports/rmparser.c b/drivers/amlogic/amports/rmparser.c
|
|
||||||
--- a/drivers/amlogic/amports/rmparser.c 2015-01-04 18:07:58.000000000 +0100
|
|
||||||
+++ b/drivers/amlogic/amports/rmparser.c 2015-01-01 16:44:39.000000000 +0100
|
|
||||||
@@ -80,11 +80,14 @@
|
|
||||||
WRITE_MPEG_REG(RESET1_REGISTER, RESET_PARSER);
|
|
||||||
|
|
||||||
/* TS data path */
|
|
||||||
+ /* Ignore FEC control for WetekPlay */
|
|
||||||
+#ifndef CONFIG_WETEK
|
|
||||||
#ifndef CONFIG_AM_DVB
|
|
||||||
WRITE_MPEG_REG(FEC_INPUT_CONTROL, 0);
|
|
||||||
#else
|
|
||||||
tsdemux_set_reset_flag();
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL_2, 1 << USE_HI_BSF_INTERFACE);
|
|
||||||
CLEAR_MPEG_REG_MASK(TS_HIU_CTL_3, 1 << USE_HI_BSF_INTERFACE);
|
|
@ -1,51 +0,0 @@
|
|||||||
diff --git a/arch/arm/boot/dts/amlogic/wetek_play.dtd b/arch/arm/boot/dts/amlogic/wetek_play.dtd
|
|
||||||
index efc7f22..9994d09 100755
|
|
||||||
--- a/arch/arm/boot/dts/amlogic/wetek_play.dtd
|
|
||||||
+++ b/arch/arm/boot/dts/amlogic/wetek_play.dtd
|
|
||||||
@@ -794,45 +794,9 @@ void root_func(){
|
|
||||||
t_rea = <20>;
|
|
||||||
t_rhoh = <15>;
|
|
||||||
chip_num = <2>;
|
|
||||||
- part_num = <9>;
|
|
||||||
- partition = <&nand_partitions>;
|
|
||||||
+ part_num = <0>;
|
|
||||||
rb_detect = <1>;
|
|
||||||
};
|
|
||||||
-
|
|
||||||
- nand_partitions:nand_partition{
|
|
||||||
- logo{
|
|
||||||
- offset=<0x0 0x4800000>;
|
|
||||||
- size=<0x0 0x800000>;
|
|
||||||
- };
|
|
||||||
- aml_logo{
|
|
||||||
- offset=<0x0 0x5800000>;
|
|
||||||
- size=<0x0 0x800000>;
|
|
||||||
- };
|
|
||||||
- recovery{
|
|
||||||
- offset=<0x0 0x6800000>;
|
|
||||||
- size=<0x0 0x800000>;
|
|
||||||
- };
|
|
||||||
- boot{
|
|
||||||
- offset=<0x0 0x8800000>;
|
|
||||||
- size=<0x0 0x800000>;
|
|
||||||
- };
|
|
||||||
- system{
|
|
||||||
- offset=<0x0 0xa800000>;
|
|
||||||
- size=<0x0 0x40000000>;
|
|
||||||
- };
|
|
||||||
- cache{
|
|
||||||
- offset=<0x0 0x4a800000>;
|
|
||||||
- size=<0x0 0x20000000>;
|
|
||||||
- };
|
|
||||||
- backup{
|
|
||||||
- offset=<0x0 0x6a800000>;
|
|
||||||
- size=<0x0 0x10000000>;
|
|
||||||
- };
|
|
||||||
- userdata{
|
|
||||||
- offset=<0xffffffff 0xffffffff>;
|
|
||||||
- size=<0x0 0x0>;
|
|
||||||
- };
|
|
||||||
- };
|
|
||||||
};
|
|
||||||
|
|
||||||
/// ***************************************************************************************
|
|
@ -1,159 +0,0 @@
|
|||||||
diff -Naur linux-amlogic-3.10-9df7905/drivers/hid/hid-core.c linux-amlogic-3.10-9df7905.patch/drivers/hid/hid-core.c
|
|
||||||
--- linux-amlogic-3.10-9df7905/drivers/hid/hid-core.c 2015-10-06 22:39:16.000000000 +0200
|
|
||||||
+++ linux-amlogic-3.10-9df7905.patch/drivers/hid/hid-core.c 2015-10-15 17:00:49.982041731 +0200
|
|
||||||
@@ -1678,6 +1678,7 @@
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
|
|
||||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_HBGIC, USB_DEVICE_ID_HBGIC_KEYBOARD) },
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
|
|
||||||
diff -Naur linux-amlogic-3.10-9df7905/drivers/hid/hid-hbgic-kbd.c linux-amlogic-3.10-9df7905.patch/drivers/hid/hid-hbgic-kbd.c
|
|
||||||
--- linux-amlogic-3.10-9df7905/drivers/hid/hid-hbgic-kbd.c 1970-01-01 01:00:00.000000000 +0100
|
|
||||||
+++ linux-amlogic-3.10-9df7905.patch/drivers/hid/hid-hbgic-kbd.c 2015-10-15 16:57:28.067700413 +0200
|
|
||||||
@@ -0,0 +1,103 @@
|
|
||||||
+/*
|
|
||||||
+ * HID driver for "HBGIC Technology Co., Ltd. USB Keyboard Mouse" remotes
|
|
||||||
+ *
|
|
||||||
+ * Copyright (c) 2015 Stephan Raue
|
|
||||||
+ *
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ * This program is free software; 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.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#include <linux/device.h>
|
|
||||||
+#include <linux/input.h>
|
|
||||||
+#include <linux/hid.h>
|
|
||||||
+#include <linux/module.h>
|
|
||||||
+
|
|
||||||
+#include "hid-ids.h"
|
|
||||||
+
|
|
||||||
+#define hbgic_map_key(c) set_bit(EV_REP, hi->input->evbit); \
|
|
||||||
+ hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
|
|
||||||
+
|
|
||||||
+static int hbgic_input_mapping(struct hid_device *hdev,
|
|
||||||
+ struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
|
|
||||||
+ unsigned long **bit, int *max)
|
|
||||||
+{
|
|
||||||
+ switch (usage->hid) {
|
|
||||||
+ case 0x00070029: hbgic_map_key(KEY_ESC); break;
|
|
||||||
+ case 0x0007002a: hbgic_map_key(KEY_BACK); break;
|
|
||||||
+ case 0x0007003a: hbgic_map_key(KEY_ZOOM); break;
|
|
||||||
+ case 0x0007003b: hbgic_map_key(KEY_EPG); break;
|
|
||||||
+ case 0x0007003c: hbgic_map_key(KEY_HOMEPAGE); break;
|
|
||||||
+ case 0x0007003d: hbgic_map_key(KEY_MENU); break;
|
|
||||||
+ case 0x0007003e: hbgic_map_key(KEY_ZOOM); break;
|
|
||||||
+ case 0x0007003f: hbgic_map_key(KEY_FAVORITES); break;
|
|
||||||
+ case 0x00070040: hbgic_map_key(KEY_MENU); break;
|
|
||||||
+ case 0x00070041: hbgic_map_key(KEY_RED); break;
|
|
||||||
+ case 0x00070042: hbgic_map_key(KEY_GREEN); break;
|
|
||||||
+ case 0x00070043: hbgic_map_key(KEY_YELLOW); break;
|
|
||||||
+ case 0x00070044: hbgic_map_key(KEY_TEXT); break;
|
|
||||||
+ case 0x0007004a: hbgic_map_key(KEY_HOMEPAGE); break;
|
|
||||||
+ case 0x000700f1: hbgic_map_key(KEY_ESC); break;
|
|
||||||
+ case 0x000c00e2: hbgic_map_key(KEY_MUTE); break;
|
|
||||||
+ case 0x000c019e: hbgic_map_key(KEY_MUTE); break;
|
|
||||||
+ case 0x000c01c2: hbgic_map_key(KEY_BLUE); break;
|
|
||||||
+ case 0x000c0204: hbgic_map_key(KEY_FAVORITES); break;
|
|
||||||
+ default:
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ return 1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int hbgic_probe(struct hid_device *hdev,
|
|
||||||
+ const struct hid_device_id *id)
|
|
||||||
+{
|
|
||||||
+ int ret;
|
|
||||||
+ /* Connect only to hid input (not hiddev & hidraw)*/
|
|
||||||
+ unsigned int cmask = HID_CONNECT_HIDINPUT;
|
|
||||||
+
|
|
||||||
+ ret = hid_parse(hdev);
|
|
||||||
+ if (ret) {
|
|
||||||
+ dev_err(&hdev->dev, "parse failed\n");
|
|
||||||
+ goto err_free;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ ret = hid_hw_start(hdev, cmask);
|
|
||||||
+ if (ret) {
|
|
||||||
+ dev_err(&hdev->dev, "hw start failed\n");
|
|
||||||
+ goto err_free;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+err_free:
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static const struct hid_device_id hbgic_devices[] = {
|
|
||||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_HBGIC,USB_DEVICE_ID_HBGIC_KEYBOARD) },
|
|
||||||
+ { }
|
|
||||||
+};
|
|
||||||
+MODULE_DEVICE_TABLE(hid, hbgic_devices);
|
|
||||||
+
|
|
||||||
+static struct hid_driver hbgic_driver = {
|
|
||||||
+ .name = "hbgic",
|
|
||||||
+ .id_table = hbgic_devices,
|
|
||||||
+ .input_mapping = hbgic_input_mapping,
|
|
||||||
+ .probe = hbgic_probe,
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static int __init hbgic_init(void)
|
|
||||||
+{
|
|
||||||
+ return hid_register_driver(&hbgic_driver);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void __exit hbgic_exit(void)
|
|
||||||
+{
|
|
||||||
+ hid_unregister_driver(&hbgic_driver);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+module_init(hbgic_init);
|
|
||||||
+module_exit(hbgic_exit);
|
|
||||||
+MODULE_LICENSE("GPL");
|
|
||||||
diff -Naur linux-amlogic-3.10-9df7905/drivers/hid/hid-ids.h linux-amlogic-3.10-9df7905.patch/drivers/hid/hid-ids.h
|
|
||||||
--- linux-amlogic-3.10-9df7905/drivers/hid/hid-ids.h 2015-10-15 14:26:12.536907873 +0200
|
|
||||||
+++ linux-amlogic-3.10-9df7905.patch/drivers/hid/hid-ids.h 2015-10-15 16:57:28.068700414 +0200
|
|
||||||
@@ -443,6 +443,9 @@
|
|
||||||
#define USB_VENDOR_ID_ION 0x15e4
|
|
||||||
#define USB_DEVICE_ID_ICADE 0x0132
|
|
||||||
|
|
||||||
+#define USB_VENDOR_ID_HBGIC 0x2252
|
|
||||||
+#define USB_DEVICE_ID_HBGIC_KEYBOARD 0x0106
|
|
||||||
+
|
|
||||||
#define USB_VENDOR_ID_HOLTEK 0x1241
|
|
||||||
#define USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP 0x5015
|
|
||||||
|
|
||||||
diff -Naur linux-amlogic-3.10-9df7905/drivers/hid/Kconfig linux-amlogic-3.10-9df7905.patch/drivers/hid/Kconfig
|
|
||||||
--- linux-amlogic-3.10-9df7905/drivers/hid/Kconfig 2015-10-15 14:26:12.537907875 +0200
|
|
||||||
+++ linux-amlogic-3.10-9df7905.patch/drivers/hid/Kconfig 2015-10-15 16:57:28.457701048 +0200
|
|
||||||
@@ -224,6 +224,12 @@
|
|
||||||
---help---
|
|
||||||
Support for Ezkey BTC 8193 keyboard.
|
|
||||||
|
|
||||||
+config HID_HBGIC
|
|
||||||
+ tristate "HBGIC Technology remote control"
|
|
||||||
+ depends on USB_HID
|
|
||||||
+ ---help---
|
|
||||||
+ Say Y here if you have a HBGIC Technology (2252:0106) remote
|
|
||||||
+
|
|
||||||
config HID_HOLTEK
|
|
||||||
tristate "Holtek HID devices"
|
|
||||||
depends on USB_HID
|
|
||||||
diff -Naur linux-amlogic-3.10-9df7905/drivers/hid/Makefile linux-amlogic-3.10-9df7905.patch/drivers/hid/Makefile
|
|
||||||
--- linux-amlogic-3.10-9df7905/drivers/hid/Makefile 2015-10-15 14:26:12.538907876 +0200
|
|
||||||
+++ linux-amlogic-3.10-9df7905.patch/drivers/hid/Makefile 2015-10-15 16:57:28.458701050 +0200
|
|
||||||
@@ -50,6 +50,7 @@
|
|
||||||
obj-$(CONFIG_HID_ELECOM) += hid-elecom.o
|
|
||||||
obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
|
|
||||||
obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
|
|
||||||
+obj-$(CONFIG_HID_HBGIC) += hid-hbgic-kbd.o
|
|
||||||
obj-$(CONFIG_HID_HOLTEK) += hid-holtek-kbd.o
|
|
||||||
obj-$(CONFIG_HID_HOLTEK) += hid-holtekff.o
|
|
||||||
obj-$(CONFIG_HID_HYPERV_MOUSE) += hid-hyperv.o
|
|
Loading…
x
Reference in New Issue
Block a user