mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
projects: add initial project 'Cuboxi'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
1c1d33300a
commit
24a0183d55
3
projects/Cuboxi/bootloader/boot.cfg
Normal file
3
projects/Cuboxi/bootloader/boot.cfg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
setenv bootargs 'console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32'
|
||||||
|
fatload mmc 0:1 0x10800000 /KERNEL
|
||||||
|
bootm 0x10800000
|
3075
projects/Cuboxi/linux/linux.arm.conf
Normal file
3075
projects/Cuboxi/linux/linux.arm.conf
Normal file
File diff suppressed because it is too large
Load Diff
353
projects/Cuboxi/options
Normal file
353
projects/Cuboxi/options
Normal file
@ -0,0 +1,353 @@
|
|||||||
|
# Name of the Distro to build (full name, without special charcters)
|
||||||
|
DISTRONAME="OpenELEC"
|
||||||
|
|
||||||
|
# short project description
|
||||||
|
DESCRIPTION="OpenELEC is a fast and userfriendly XBMC Mediacenter distribution."
|
||||||
|
|
||||||
|
# Welcome Message for e.g. SSH Server (up to 5 Lines)
|
||||||
|
GREETING0="##############################################"
|
||||||
|
GREETING1="# OpenELEC - The living room PC for everyone #"
|
||||||
|
GREETING2="# ...... visit http://www.openelec.tv ...... #"
|
||||||
|
GREETING3="##############################################"
|
||||||
|
GREETING4=""
|
||||||
|
|
||||||
|
# Hostname for target system (openelec)
|
||||||
|
HOSTNAME="openelec"
|
||||||
|
|
||||||
|
# Root password to integrate in the target system
|
||||||
|
ROOT_PASSWORD="openelec"
|
||||||
|
|
||||||
|
# The TARGET_CPU variable controls which processor should be targeted for
|
||||||
|
# generated code.
|
||||||
|
case $TARGET_ARCH in
|
||||||
|
i386)
|
||||||
|
# (AMD CPUs) k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3
|
||||||
|
# athlon-fx athlon-mp athlon-xp athlon-4
|
||||||
|
# athlon-tbird athlon k6-3 k6-2 k6 geode
|
||||||
|
# (Intel CPUs) atom core2 nocona prescott pentium4[m] pentium3[m]
|
||||||
|
# pentium-m pentium2 pentiumpro pentium-mmx pentium
|
||||||
|
# i686 i586 i486 i386
|
||||||
|
# (VIA CPUs) c3 c3-2
|
||||||
|
#
|
||||||
|
TARGET_CPU="atom"
|
||||||
|
;;
|
||||||
|
|
||||||
|
x86_64)
|
||||||
|
# (AMD CPUs) k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3
|
||||||
|
# athlon-fx amdfam10 barcelona
|
||||||
|
# (Intel CPUs) atom core2 nocona
|
||||||
|
#
|
||||||
|
TARGET_CPU="atom"
|
||||||
|
;;
|
||||||
|
|
||||||
|
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"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Build optimizations (size/normal/speed)
|
||||||
|
OPTIMIZATIONS="size"
|
||||||
|
|
||||||
|
# Project CFLAGS
|
||||||
|
PROJECT_CFLAGS=""
|
||||||
|
|
||||||
|
# LTO (Link Time Optimization) support
|
||||||
|
LTO_SUPPORT="yes"
|
||||||
|
|
||||||
|
# GOLD (Google Linker) support
|
||||||
|
GOLD_SUPPORT="yes"
|
||||||
|
|
||||||
|
# Bootloader to use (syslinux / u-boot / atv-bootloader / bcm2835-bootloader)
|
||||||
|
BOOTLOADER="u-boot"
|
||||||
|
|
||||||
|
# u-boot version to use (default)
|
||||||
|
UBOOT_VERSION="imx6-cuboxi"
|
||||||
|
|
||||||
|
# Configuration for u-boot
|
||||||
|
UBOOT_CONFIG="mx6_cubox-i_config"
|
||||||
|
|
||||||
|
# Target Configfile for u-boot
|
||||||
|
UBOOT_CONFIGFILE=""
|
||||||
|
|
||||||
|
# GCC to use. values can be:
|
||||||
|
# default: default mainline gcc
|
||||||
|
GCC_VERSION="4.7"
|
||||||
|
|
||||||
|
# Kernel to use. values can be:
|
||||||
|
# default: default mainline kernel
|
||||||
|
LINUX="imx6"
|
||||||
|
|
||||||
|
# use linux-next (latest rc) instead latest released version
|
||||||
|
LINUX_NEXT="no"
|
||||||
|
|
||||||
|
# SquashFS compression method (gzip / lzo / xz)
|
||||||
|
SQUASHFS_COMPRESSION="gzip"
|
||||||
|
|
||||||
|
# Mediacenter to use (xbmc / no)
|
||||||
|
MEDIACENTER="xbmc"
|
||||||
|
|
||||||
|
# Skins to install (Confluence)
|
||||||
|
# Space separated list is supported,
|
||||||
|
# e.g. SKINS="Confluence"
|
||||||
|
SKINS="Confluence"
|
||||||
|
|
||||||
|
# Default Skin (Confluence)
|
||||||
|
SKIN_DEFAULT="Confluence"
|
||||||
|
|
||||||
|
# install extra subtitle Fonts for XBMC (yes / no)
|
||||||
|
XBMC_EXTRA_FONTS="yes"
|
||||||
|
|
||||||
|
# build and install 'RSXS' Screensaver (yes / no)
|
||||||
|
XBMC_SCR_RSXS="no"
|
||||||
|
|
||||||
|
# build and install 'ProjectM' Visualization (yes / no)
|
||||||
|
XBMC_VIS_PROJECTM="no"
|
||||||
|
|
||||||
|
# build and install 'GOOM' Visualization (yes / no)
|
||||||
|
XBMC_VIS_GOOM="no"
|
||||||
|
|
||||||
|
# build and install 'Waveform' Visualization (yes / no)
|
||||||
|
XBMC_VIS_WAVEFORM="yes"
|
||||||
|
|
||||||
|
# build and install 'Spectrum' Visualization (yes / no)
|
||||||
|
XBMC_VIS_SPECTRUM="yes"
|
||||||
|
|
||||||
|
# build and install 'FishBMC' Visualization (yes / no)
|
||||||
|
# does not work on RPi
|
||||||
|
XBMC_VIS_FISHBMC="no"
|
||||||
|
|
||||||
|
# build and install ALSA Audio support (yes / no)
|
||||||
|
ALSA_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install PulseAudio support (yes / no)
|
||||||
|
PULSEAUDIO_SUPPORT="no"
|
||||||
|
|
||||||
|
# build and install with non-free support
|
||||||
|
# (RAR compression support in XBMC) (yes / no)
|
||||||
|
NONFREE_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install with DVDCSS support
|
||||||
|
# (DVD decryption support in XBMC) (yes / no)
|
||||||
|
DVDCSS_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install with LAME cdrip encoder support
|
||||||
|
ENCODER_LAME="yes"
|
||||||
|
|
||||||
|
# build and install with VORBIS cdrip encoder support
|
||||||
|
ENCODER_VORBIS="yes"
|
||||||
|
|
||||||
|
# build and install with BluRay support (yes / no)
|
||||||
|
BLURAY_SUPPORT="yes"
|
||||||
|
|
||||||
|
# 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="RTL8192CU RTL8188EU dvbhdhomerun"
|
||||||
|
ADDITIONAL_DRIVERS="RTL8188EU"
|
||||||
|
|
||||||
|
# build with network support (yes / no)
|
||||||
|
NETWORK="yes"
|
||||||
|
|
||||||
|
# build and install bluetooth support (yes / no)
|
||||||
|
BLUETOOTH_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install with XBMC webfrontend (yes / no)
|
||||||
|
WEBSERVER="yes"
|
||||||
|
|
||||||
|
# build and install Avahi (Zeroconf) daemon (yes / no)
|
||||||
|
AVAHI_DAEMON="yes"
|
||||||
|
|
||||||
|
# build with UPnP support (yes / no)
|
||||||
|
UPNP_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build with MySQL support (yes / no)
|
||||||
|
MYSQL_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build xbmc with sshlib support (yes / no)
|
||||||
|
SSHLIB_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build xbmc with optical drive support (yes / no)
|
||||||
|
OPTICAL_DRIVE_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build with AirPlay support (stream videos from iDevices to XBMC) (yes / no)
|
||||||
|
AIRPLAY_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build with AirTunes support (stream music from iDevices to XBMC) (yes / no)
|
||||||
|
AIRTUNES_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build with libnfs support (mounting nfs shares with XBMC) (yes / no)
|
||||||
|
NFS_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build with afpfs-ng support (mounting AFP shares with XBMC) (yes / no)
|
||||||
|
AFP_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install Samba Client support (yes / no)
|
||||||
|
SAMBA_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install Samba Server (yes / no)
|
||||||
|
SAMBA_SERVER="yes"
|
||||||
|
|
||||||
|
# build and install SFTP Server (yes / no)
|
||||||
|
SFTP_SERVER="yes"
|
||||||
|
|
||||||
|
# build and install PPP support (yes / no)
|
||||||
|
PPTP_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install OpenVPN support (yes / no)
|
||||||
|
OPENVPN_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install diskmounter support (udevil)
|
||||||
|
# this service provide auto mounting support for external drives in the
|
||||||
|
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||||
|
UDEVIL="yes"
|
||||||
|
|
||||||
|
# build and install exFAT fuse support (yes / no)
|
||||||
|
EXFAT="yes"
|
||||||
|
|
||||||
|
# build and install NTFS-3G fuse support (yes / no)
|
||||||
|
NTFS3G="yes"
|
||||||
|
|
||||||
|
# build and install hfs filesystem utilities (yes / no)
|
||||||
|
HFSTOOLS="yes"
|
||||||
|
|
||||||
|
# OpenGL(X) implementation to use (no / Mesa)
|
||||||
|
OPENGL="no"
|
||||||
|
|
||||||
|
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q)
|
||||||
|
OPENGLES="gpu-viv-bin-mx6q"
|
||||||
|
|
||||||
|
# Windowmanager to use (ratpoison / none)
|
||||||
|
WINDOWMANAGER="none"
|
||||||
|
|
||||||
|
# include uvesafb support (yes / no)
|
||||||
|
UVESAFB_SUPPORT="no"
|
||||||
|
|
||||||
|
# Displayserver to use (xorg-server / no)
|
||||||
|
DISPLAYSERVER="no"
|
||||||
|
|
||||||
|
# Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia,nouveau,vmware)
|
||||||
|
# Space separated list is supported,
|
||||||
|
# e.g. GRAPHIC_DRIVERS="i915 i965 r300 r600 radeon nvidia nouveau"
|
||||||
|
GRAPHIC_DRIVERS=""
|
||||||
|
|
||||||
|
# XBMC Player implementation to use (default / bcm2835-driver)
|
||||||
|
XBMCPLAYER_DRIVER="libfslvpuwrap"
|
||||||
|
|
||||||
|
# Use VDPAU video acceleration (needs nVidia driver and a supported card)
|
||||||
|
VDPAU="no"
|
||||||
|
|
||||||
|
# Use VAAPI video acceleration (needs intel i965 driver and a supported card)
|
||||||
|
VAAPI="no"
|
||||||
|
|
||||||
|
# Use Broadcom CrystalHD Decoder Card for video acceleration
|
||||||
|
# (needs Kernelsupport for Broadcom Decoder Card and a supported card)
|
||||||
|
CRYSTALHD="no"
|
||||||
|
|
||||||
|
# build and install remote support (yes / no)
|
||||||
|
REMOTE_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install ATV IR remote support (yes / no)
|
||||||
|
ATVCLIENT_SUPPORT="no"
|
||||||
|
|
||||||
|
# build and install IRServer IR/LCD support (yes / no)
|
||||||
|
IRSERVER_SUPPORT="no"
|
||||||
|
|
||||||
|
# build and install Joystick support (yes / no)
|
||||||
|
JOYSTICK_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install CEC adapter support (yes / no)
|
||||||
|
CEC_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build and install iSCSI support - iscsistart (yes / no)
|
||||||
|
ISCSI_SUPPORT="yes"
|
||||||
|
|
||||||
|
# LCD driver to Use - Possible drivers are ( Comma seperated:
|
||||||
|
# bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,dm140,
|
||||||
|
# ea65,EyeboxOne,g15,glcdlib,glk,hd44780,i2500vfd,
|
||||||
|
# icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,
|
||||||
|
# joy,lb216,lcdm001,lcterm,lirc,lis,MD8800,mdm166a,
|
||||||
|
# ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,
|
||||||
|
# picolcd,pyramid,sed1330,sed1520,serialPOS,
|
||||||
|
# serialVFD,shuttleVFD,sli,stv5730,SureElec,svga,vlsys_m428
|
||||||
|
# 'all' compiles all drivers;
|
||||||
|
# 'all,!xxx,!yyy' de-selects previously selected drivers
|
||||||
|
# "none" for disable LCD support
|
||||||
|
LCD_DRIVER="irtrans,imon,imonlcd,mdm166a,MtxOrb,lis,dm140,hd44780,CFontz,SureElec,vlsys_m428"
|
||||||
|
|
||||||
|
# Modules to install in initramfs for early boot
|
||||||
|
INITRAMFS_MODULES=""
|
||||||
|
|
||||||
|
# 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="firmware-imx misc-firmware wlan-firmware dvb-firmware"
|
||||||
|
|
||||||
|
# build with lm_sensors hardware monitoring support (yes / no)
|
||||||
|
SENSOR_SUPPORT="yes"
|
||||||
|
|
||||||
|
# build with swap support (yes / no)
|
||||||
|
SWAP_SUPPORT="no"
|
||||||
|
|
||||||
|
# swap support enabled per default (yes / no)
|
||||||
|
SWAP_ENABLED_DEFAULT="no"
|
||||||
|
|
||||||
|
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||||
|
SWAPFILESIZE="128"
|
||||||
|
|
||||||
|
# build with installer (yes / no)
|
||||||
|
INSTALLER_SUPPORT="no"
|
||||||
|
|
||||||
|
# Testpackages for development (yes / no)
|
||||||
|
TESTING="no"
|
||||||
|
|
||||||
|
# OEM packages for OEM's (yes / no)
|
||||||
|
OEM_SUPPORT="no"
|
||||||
|
|
||||||
|
# build and install nano text editor (yes / no)
|
||||||
|
NANO_EDITOR="yes"
|
||||||
|
|
||||||
|
# cron support (yes / no)
|
||||||
|
CRON_SUPPORT="yes"
|
||||||
|
|
||||||
|
# Perf support in development builds (yes / no)
|
||||||
|
PERF_SUPPORT="yes"
|
||||||
|
|
||||||
|
# Coreboot support (yes / no)
|
||||||
|
COREBOOT="no"
|
||||||
|
|
||||||
|
# Distribution Specific source location
|
||||||
|
DISTRO_MIRROR="http://sources.openelec.tv/mirror"
|
||||||
|
DISTRO_SRC="http://sources.openelec.tv/$OPENELEC_VERSION"
|
||||||
|
|
||||||
|
# Addon Server Url
|
||||||
|
ADDON_SERVER_URL="http://addons.openelec.tv"
|
||||||
|
|
||||||
|
# set the addon dirs
|
||||||
|
ADDON_PATH="$ADDON_VERSION/$PROJECT/$TARGET_ARCH"
|
||||||
|
ADDON_URL="$ADDON_SERVER_URL/$ADDON_PATH"
|
@ -0,0 +1,817 @@
|
|||||||
|
From 90b994705ee2492afa00f914e0a070a0f0929f21 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wolfgar <stephan.rafin@laposte.net>
|
||||||
|
Date: Sat, 28 Sep 2013 13:31:13 +0200
|
||||||
|
Subject: [PATCH] Early support for i.MX6
|
||||||
|
|
||||||
|
---
|
||||||
|
configure.ac | 19 ++
|
||||||
|
include/cectypes.h | 14 +-
|
||||||
|
src/lib/CECTypeUtils.h | 2 +
|
||||||
|
src/lib/Makefile.am | 5 +
|
||||||
|
src/lib/adapter/AdapterFactory.cpp | 28 +-
|
||||||
|
src/lib/adapter/IMX/AdapterMessageQueue.h | 134 ++++++++++
|
||||||
|
src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp | 281 +++++++++++++++++++++
|
||||||
|
src/lib/adapter/IMX/IMXCECAdapterCommunication.h | 114 +++++++++
|
||||||
|
src/lib/adapter/IMX/IMXCECAdapterDetection.cpp | 42 +++
|
||||||
|
src/lib/adapter/IMX/IMXCECAdapterDetection.h | 36 +++
|
||||||
|
10 files changed, 672 insertions(+), 3 deletions(-)
|
||||||
|
create mode 100644 src/lib/adapter/IMX/AdapterMessageQueue.h
|
||||||
|
create mode 100644 src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp
|
||||||
|
create mode 100644 src/lib/adapter/IMX/IMXCECAdapterCommunication.h
|
||||||
|
create mode 100644 src/lib/adapter/IMX/IMXCECAdapterDetection.cpp
|
||||||
|
create mode 100644 src/lib/adapter/IMX/IMXCECAdapterDetection.h
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 9b2ac34..7875155 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -93,6 +93,14 @@ if test "x$use_rpi" != "xno"; then
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
+## i.MX6 support
|
||||||
|
+AC_ARG_ENABLE([imx6],
|
||||||
|
+ [AS_HELP_STRING([--enable-imx6],
|
||||||
|
+ [enable support for freescale i.MX6 (default is no)])],
|
||||||
|
+ [use_imx6=$enableval],
|
||||||
|
+ [use_imx6=no])
|
||||||
|
+
|
||||||
|
+
|
||||||
|
## add the top dir and include to the include path, so we can include config.h and cec.h
|
||||||
|
CPPFLAGS="$CPPFLAGS -I\$(abs_top_srcdir)/src -I\$(abs_top_srcdir)/include"
|
||||||
|
|
||||||
|
@@ -268,6 +276,17 @@ else
|
||||||
|
features="$features\n TDA995x support :\t\t\tno"
|
||||||
|
fi
|
||||||
|
|
||||||
|
+## mark i.MX6 support as available
|
||||||
|
+if test "x$use_imx6" != "xno"; then
|
||||||
|
+ AC_DEFINE([HAVE_IMX_API],[1],[Define to 1 to include i.MX6 support])
|
||||||
|
+ AM_CONDITIONAL(USE_IMX_API, true)
|
||||||
|
+ features="$features\n i.MX6 support :\t\t\tyes"
|
||||||
|
+ LIB_INFO="$LIB_INFO 'i.MX6'"
|
||||||
|
+else
|
||||||
|
+ AM_CONDITIONAL(USE_IMX_API, false)
|
||||||
|
+ features="$features\n i.MX6 support :\t\t\tno"
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
## check if our build system is complete
|
||||||
|
AC_CHECK_HEADER(algorithm,,AC_MSG_ERROR($msg_required_header_missing))
|
||||||
|
AC_CHECK_HEADER(ctype.h,,AC_MSG_ERROR($msg_required_header_missing))
|
||||||
|
diff --git a/include/cectypes.h b/include/cectypes.h
|
||||||
|
index a95243c..5c55283 100644
|
||||||
|
--- a/include/cectypes.h
|
||||||
|
+++ b/include/cectypes.h
|
||||||
|
@@ -295,6 +295,17 @@
|
||||||
|
#define CEC_TDA995x_VIRTUAL_COM "CuBox"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
+ * the path to use for the i.MX CEC wire
|
||||||
|
+ */
|
||||||
|
+#define CEC_IMX_PATH "/dev/mxc_hdmi_cec"
|
||||||
|
+
|
||||||
|
+/*!
|
||||||
|
+ * the name of the virtual COM port to use for the i.MX CEC wire
|
||||||
|
+ */
|
||||||
|
+#define CEC_IMX_VIRTUAL_COM "i.MX"
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/*!
|
||||||
|
* Mimimum client version
|
||||||
|
*/
|
||||||
|
#define CEC_MIN_LIB_VERSION 2
|
||||||
|
@@ -857,7 +868,8 @@
|
||||||
|
ADAPTERTYPE_P8_EXTERNAL = 0x1,
|
||||||
|
ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
|
||||||
|
ADAPTERTYPE_RPI = 0x100,
|
||||||
|
- ADAPTERTYPE_TDA995x = 0x200
|
||||||
|
+ ADAPTERTYPE_TDA995x = 0x200,
|
||||||
|
+ ADAPTERTYPE_IMX = 0x300,
|
||||||
|
} cec_adapter_type;
|
||||||
|
|
||||||
|
typedef struct cec_menu_language
|
||||||
|
diff --git a/src/lib/CECTypeUtils.h b/src/lib/CECTypeUtils.h
|
||||||
|
index 20e318b..dbb72b2 100644
|
||||||
|
--- a/src/lib/CECTypeUtils.h
|
||||||
|
+++ b/src/lib/CECTypeUtils.h
|
||||||
|
@@ -852,6 +852,8 @@
|
||||||
|
return "Raspberry Pi";
|
||||||
|
case ADAPTERTYPE_TDA995x:
|
||||||
|
return "TDA995x";
|
||||||
|
+ case ADAPTERTYPE_IMX:
|
||||||
|
+ return "i.MX";
|
||||||
|
default:
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
|
||||||
|
index 35166f2..fbae7ad 100644
|
||||||
|
--- a/src/lib/Makefile.am
|
||||||
|
+++ b/src/lib/Makefile.am
|
||||||
|
@@ -57,5 +57,10 @@ libcec_la_SOURCES += adapter/TDA995x/TDA995xCECAdapterDetection.cpp \
|
||||||
|
adapter/TDA995x/TDA995xCECAdapterCommunication.cpp
|
||||||
|
endif
|
||||||
|
|
||||||
|
+## i.MX6 support
|
||||||
|
+if USE_IMX_API
|
||||||
|
+libcec_la_SOURCES += adapter/IMX/IMXCECAdapterDetection.cpp \
|
||||||
|
+ adapter/IMX/IMXCECAdapterCommunication.cpp
|
||||||
|
+endif
|
||||||
|
|
||||||
|
libcec_la_LDFLAGS = @LIBS_LIBCEC@ -version-info @VERSION@
|
||||||
|
diff --git a/src/lib/adapter/AdapterFactory.cpp b/src/lib/adapter/AdapterFactory.cpp
|
||||||
|
index 42cdd0b..3c83805 100644
|
||||||
|
--- a/src/lib/adapter/AdapterFactory.cpp
|
||||||
|
+++ b/src/lib/adapter/AdapterFactory.cpp
|
||||||
|
@@ -52,6 +52,11 @@
|
||||||
|
#include "TDA995x/TDA995xCECAdapterCommunication.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if defined(HAVE_IMX_API)
|
||||||
|
+#include "IMX/IMXCECAdapterDetection.h"
|
||||||
|
+#include "IMX/IMXCECAdapterCommunication.h"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
using namespace std;
|
||||||
|
using namespace CEC;
|
||||||
|
|
||||||
|
@@ -109,7 +114,22 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API)
|
||||||
|
+
|
||||||
|
+#if defined(HAVE_IMX_API)
|
||||||
|
+ if (iAdaptersFound < iBufSize && CIMXCECAdapterDetection::FindAdapter() &&
|
||||||
|
+ (!strDevicePath || !strcmp(strDevicePath, CEC_IMX_VIRTUAL_COM)))
|
||||||
|
+ {
|
||||||
|
+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_IMX_PATH);
|
||||||
|
+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_IMX_VIRTUAL_COM);
|
||||||
|
+ deviceList[iAdaptersFound].iVendorId = IMX_ADAPTER_VID;
|
||||||
|
+ deviceList[iAdaptersFound].iProductId = IMX_ADAPTER_PID;
|
||||||
|
+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_IMX;
|
||||||
|
+ iAdaptersFound++;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_IMX_API)
|
||||||
|
#error "libCEC doesn't have support for any type of adapter. please check your build system or configuration"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -128,11 +148,15 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
|
||||||
|
return new CRPiCECAdapterCommunication(m_lib->m_cec);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if defined(HAVE_IMX_API)
|
||||||
|
+ return new CIMXCECAdapterCommunication(m_lib->m_cec);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#if defined(HAVE_P8_USB)
|
||||||
|
return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API)
|
||||||
|
+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_IMX_API)
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
diff --git a/src/lib/adapter/IMX/AdapterMessageQueue.h b/src/lib/adapter/IMX/AdapterMessageQueue.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..c8bcf71
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/lib/adapter/IMX/AdapterMessageQueue.h
|
||||||
|
@@ -0,0 +1,134 @@
|
||||||
|
+#pragma once
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the libCEC(R) library.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is Copyright (C) 2011-2013 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 "lib/platform/threads/mutex.h"
|
||||||
|
+
|
||||||
|
+namespace CEC
|
||||||
|
+{
|
||||||
|
+ using namespace PLATFORM;
|
||||||
|
+
|
||||||
|
+ class CAdapterMessageQueueEntry
|
||||||
|
+ {
|
||||||
|
+ public:
|
||||||
|
+ CAdapterMessageQueueEntry(const cec_command &command)
|
||||||
|
+ : m_bWaiting(true), m_retval((uint32_t)-1), m_bSucceeded(false)
|
||||||
|
+ {
|
||||||
|
+ m_hash = hashValue(
|
||||||
|
+ uint32_t(command.opcode_set ? command.opcode : CEC_OPCODE_NONE),
|
||||||
|
+ command.initiator, command.destination);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ virtual ~CAdapterMessageQueueEntry(void) {}
|
||||||
|
+
|
||||||
|
+ /*!
|
||||||
|
+ * @brief Query result from worker thread
|
||||||
|
+ */
|
||||||
|
+ uint32_t Result() const
|
||||||
|
+ {
|
||||||
|
+ return m_retval;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /*!
|
||||||
|
+ * @brief Signal waiting threads
|
||||||
|
+ */
|
||||||
|
+ void Broadcast(void)
|
||||||
|
+ {
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+ m_condition.Broadcast();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /*!
|
||||||
|
+ * @brief Signal waiting thread(s) when message matches this entry
|
||||||
|
+ */
|
||||||
|
+ bool CheckMatch(uint32_t opcode, cec_logical_address initiator,
|
||||||
|
+ cec_logical_address destination, uint32_t response)
|
||||||
|
+ {
|
||||||
|
+ uint32_t hash = hashValue(opcode, initiator, destination);
|
||||||
|
+
|
||||||
|
+ if (hash == m_hash)
|
||||||
|
+ {
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+
|
||||||
|
+ m_retval = response;
|
||||||
|
+ m_bSucceeded = true;
|
||||||
|
+ m_condition.Signal();
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /*!
|
||||||
|
+ * @brief Wait for a response to this command.
|
||||||
|
+ * @param iTimeout The timeout to use while waiting.
|
||||||
|
+ * @return True when a response was received before the timeout passed, false otherwise.
|
||||||
|
+ */
|
||||||
|
+ bool Wait(uint32_t iTimeout)
|
||||||
|
+ {
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+
|
||||||
|
+ bool bReturn = m_bSucceeded ? true : m_condition.Wait(m_mutex, m_bSucceeded, iTimeout);
|
||||||
|
+ m_bWaiting = false;
|
||||||
|
+ return bReturn;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /*!
|
||||||
|
+ * @return True while a thread is waiting for a signal or isn't waiting yet, false otherwise.
|
||||||
|
+ */
|
||||||
|
+ bool IsWaiting(void)
|
||||||
|
+ {
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+ return m_bWaiting;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /*!
|
||||||
|
+ * @return Hash value for given cec_command
|
||||||
|
+ */
|
||||||
|
+ static uint32_t hashValue(uint32_t opcode,
|
||||||
|
+ cec_logical_address initiator,
|
||||||
|
+ cec_logical_address destination)
|
||||||
|
+ {
|
||||||
|
+ return 1 | ((uint32_t)initiator << 8) |
|
||||||
|
+ ((uint32_t)destination << 16) | ((uint32_t)opcode << 16);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private:
|
||||||
|
+ bool m_bWaiting; /**< true while a thread is waiting or when it hasn't started waiting yet */
|
||||||
|
+ PLATFORM::CCondition<bool> m_condition; /**< the condition to wait on */
|
||||||
|
+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this class */
|
||||||
|
+ uint32_t m_hash;
|
||||||
|
+ uint32_t m_retval;
|
||||||
|
+ bool m_bSucceeded;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+};
|
||||||
|
diff --git a/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp b/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..f4783df
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp
|
||||||
|
@@ -0,0 +1,281 @@
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the libCEC(R) library.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
|
||||||
|
+ * libCEC(R) is an original work, containing original code.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||||
|
+ *
|
||||||
|
+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
|
||||||
|
+ *
|
||||||
|
+ * You can redistribute this file 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.
|
||||||
|
+ *
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "env.h"
|
||||||
|
+
|
||||||
|
+#if defined(HAVE_IMX_API)
|
||||||
|
+#include "IMXCECAdapterCommunication.h"
|
||||||
|
+
|
||||||
|
+#include "lib/CECTypeUtils.h"
|
||||||
|
+#include "lib/LibCEC.h"
|
||||||
|
+#include "lib/platform/sockets/cdevsocket.h"
|
||||||
|
+#include "lib/platform/util/StdString.h"
|
||||||
|
+#include "lib/platform/util/buffer.h"
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Ioctl definitions from kernel header
|
||||||
|
+ */
|
||||||
|
+#define HDMICEC_IOC_MAGIC 'H'
|
||||||
|
+#define HDMICEC_IOC_SETLOGICALADDRESS _IOW(HDMICEC_IOC_MAGIC, 1, unsigned char)
|
||||||
|
+#define HDMICEC_IOC_STARTDEVICE _IO(HDMICEC_IOC_MAGIC, 2)
|
||||||
|
+#define HDMICEC_IOC_STOPDEVICE _IO(HDMICEC_IOC_MAGIC, 3)
|
||||||
|
+#define HDMICEC_IOC_GETPHYADDRESS _IOR(HDMICEC_IOC_MAGIC, 4, unsigned char[4])
|
||||||
|
+
|
||||||
|
+#define MAX_CEC_MESSAGE_LEN 17
|
||||||
|
+
|
||||||
|
+#define MESSAGE_TYPE_RECEIVE_SUCCESS 1
|
||||||
|
+#define MESSAGE_TYPE_NOACK 2
|
||||||
|
+#define MESSAGE_TYPE_DISCONNECTED 3
|
||||||
|
+#define MESSAGE_TYPE_CONNECTED 4
|
||||||
|
+#define MESSAGE_TYPE_SEND_SUCCESS 5
|
||||||
|
+
|
||||||
|
+typedef struct hdmi_cec_event{
|
||||||
|
+ int event_type;
|
||||||
|
+ int msg_len;
|
||||||
|
+ unsigned char msg[MAX_CEC_MESSAGE_LEN];
|
||||||
|
+}hdmi_cec_event;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+using namespace std;
|
||||||
|
+using namespace CEC;
|
||||||
|
+using namespace PLATFORM;
|
||||||
|
+
|
||||||
|
+#include "AdapterMessageQueue.h"
|
||||||
|
+
|
||||||
|
+#define LIB_CEC m_callback->GetLib()
|
||||||
|
+
|
||||||
|
+// these are defined in nxp private header file
|
||||||
|
+#define CEC_MSG_SUCCESS 0x00 /*Message transmisson Succeed*/
|
||||||
|
+#define CEC_CSP_OFF_STATE 0x80 /*CSP in Off State*/
|
||||||
|
+#define CEC_BAD_REQ_SERVICE 0x81 /*Bad .req service*/
|
||||||
|
+#define CEC_MSG_FAIL_UNABLE_TO_ACCESS 0x82 /*Message transmisson failed: Unable to access CEC line*/
|
||||||
|
+#define CEC_MSG_FAIL_ARBITRATION_ERROR 0x83 /*Message transmisson failed: Arbitration error*/
|
||||||
|
+#define CEC_MSG_FAIL_BIT_TIMMING_ERROR 0x84 /*Message transmisson failed: Bit timming error*/
|
||||||
|
+#define CEC_MSG_FAIL_DEST_NOT_ACK 0x85 /*Message transmisson failed: Destination Address not aknowledged*/
|
||||||
|
+#define CEC_MSG_FAIL_DATA_NOT_ACK 0x86 /*Message transmisson failed: Databyte not acknowledged*/
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+CIMXCECAdapterCommunication::CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
|
||||||
|
+ IAdapterCommunication(callback)/*,
|
||||||
|
+ m_bLogicalAddressChanged(false)*/
|
||||||
|
+{
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+
|
||||||
|
+ m_iNextMessage = 0;
|
||||||
|
+ //m_logicalAddresses.Clear();
|
||||||
|
+ m_logicalAddress = CECDEVICE_UNKNOWN;
|
||||||
|
+ m_dev = new CCDevSocket(CEC_IMX_PATH);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+CIMXCECAdapterCommunication::~CIMXCECAdapterCommunication(void)
|
||||||
|
+{
|
||||||
|
+ Close();
|
||||||
|
+
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+ delete m_dev;
|
||||||
|
+ m_dev = 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+bool CIMXCECAdapterCommunication::IsOpen(void)
|
||||||
|
+{
|
||||||
|
+ return IsInitialised() && m_dev->IsOpen();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+bool CIMXCECAdapterCommunication::Open(uint32_t iTimeoutMs, bool UNUSED(bSkipChecks), bool bStartListening)
|
||||||
|
+{
|
||||||
|
+ if (m_dev->Open(iTimeoutMs))
|
||||||
|
+ {
|
||||||
|
+ if (!bStartListening || CreateThread()) {
|
||||||
|
+ if (m_dev->Ioctl(HDMICEC_IOC_STARTDEVICE, NULL) != 0) {
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to start device\n", __func__);
|
||||||
|
+ }
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ m_dev->Close();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void CIMXCECAdapterCommunication::Close(void)
|
||||||
|
+{
|
||||||
|
+ StopThread(0);
|
||||||
|
+ if (m_dev->Ioctl(HDMICEC_IOC_STOPDEVICE, NULL) != 0) {
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to stop device\n", __func__);
|
||||||
|
+ }
|
||||||
|
+ m_dev->Close();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+std::string CIMXCECAdapterCommunication::GetError(void) const
|
||||||
|
+{
|
||||||
|
+ std::string strError(m_strError);
|
||||||
|
+ return strError;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+cec_adapter_message_state CIMXCECAdapterCommunication::Write(
|
||||||
|
+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply))
|
||||||
|
+{
|
||||||
|
+ //cec_frame frame;
|
||||||
|
+ unsigned char message[MAX_CEC_MESSAGE_LEN];
|
||||||
|
+ int msg_len = 1;
|
||||||
|
+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR;
|
||||||
|
+
|
||||||
|
+ if ((size_t)data.parameters.size + data.opcode_set + 1 > sizeof(message))
|
||||||
|
+ {
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__);
|
||||||
|
+ return ADAPTER_MESSAGE_STATE_ERROR;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ message[0] = (data.initiator << 4) | (data.destination & 0x0f);
|
||||||
|
+ if (data.opcode_set)
|
||||||
|
+ {
|
||||||
|
+ message[1] = data.opcode;
|
||||||
|
+ msg_len++;
|
||||||
|
+ memcpy(&message[2], data.parameters.data, data.parameters.size);
|
||||||
|
+ msg_len+=data.parameters.size;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (m_dev->Write(message, msg_len) == msg_len)
|
||||||
|
+ {
|
||||||
|
+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED;
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: sent command error !", __func__);
|
||||||
|
+
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+uint16_t CIMXCECAdapterCommunication::GetFirmwareVersion(void)
|
||||||
|
+{
|
||||||
|
+ /* FIXME add ioctl ? */
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+cec_vendor_id CIMXCECAdapterCommunication::GetVendorId(void)
|
||||||
|
+{
|
||||||
|
+ /* FIXME TO be implemented : check how */
|
||||||
|
+ return CEC_VENDOR_PANASONIC;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+uint16_t CIMXCECAdapterCommunication::GetPhysicalAddress(void)
|
||||||
|
+{
|
||||||
|
+ uint32_t info;
|
||||||
|
+
|
||||||
|
+ if (m_dev->Ioctl(HDMICEC_IOC_GETPHYADDRESS, &info) != 0)
|
||||||
|
+ {
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_GETPHYADDRESS failed !", __func__);
|
||||||
|
+ return CEC_INVALID_PHYSICAL_ADDRESS;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return info;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+cec_logical_addresses CIMXCECAdapterCommunication::GetLogicalAddresses(void)
|
||||||
|
+{
|
||||||
|
+ cec_logical_addresses addresses;
|
||||||
|
+ addresses.Clear();
|
||||||
|
+
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+ if ( m_logicalAddress != CECDEVICE_UNKNOWN)
|
||||||
|
+ addresses.Set(m_logicalAddress);
|
||||||
|
+
|
||||||
|
+ return addresses;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+bool CIMXCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses)
|
||||||
|
+{
|
||||||
|
+ int log_addr = addresses.primary;
|
||||||
|
+
|
||||||
|
+ CLockObject lock(m_mutex);
|
||||||
|
+ if (m_logicalAddress == log_addr)
|
||||||
|
+ return true;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, log_addr) != 0)
|
||||||
|
+ {
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__);
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ m_logicalAddress = (cec_logical_address)log_addr;
|
||||||
|
+ return true;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void *CIMXCECAdapterCommunication::Process(void)
|
||||||
|
+{
|
||||||
|
+ bool bHandled;
|
||||||
|
+ hdmi_cec_event event;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ uint32_t opcode, status;
|
||||||
|
+ cec_logical_address initiator, destination;
|
||||||
|
+
|
||||||
|
+ while (!IsStopped())
|
||||||
|
+ {
|
||||||
|
+ ret = m_dev->Read((char *)&event, sizeof(event), 5000);
|
||||||
|
+ if (ret > 0)
|
||||||
|
+ {
|
||||||
|
+
|
||||||
|
+ initiator = cec_logical_address(event.msg[0] >> 4);
|
||||||
|
+ destination = cec_logical_address(event.msg[0] & 0x0f);
|
||||||
|
+
|
||||||
|
+ //LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: Read data : type : %d initiator %d dest %d", __func__, event.event_type, initiator, destination);
|
||||||
|
+ if (event.event_type == MESSAGE_TYPE_RECEIVE_SUCCESS)
|
||||||
|
+ /* Message received */
|
||||||
|
+ {
|
||||||
|
+ cec_command cmd;
|
||||||
|
+
|
||||||
|
+ cec_command::Format(
|
||||||
|
+ cmd, initiator, destination,
|
||||||
|
+ ( event.msg_len > 1 ) ? cec_opcode(event.msg[1]) : CEC_OPCODE_NONE);
|
||||||
|
+
|
||||||
|
+ for( uint8_t i = 2; i < event.msg_len; i++ )
|
||||||
|
+ cmd.parameters.PushBack(event.msg[i]);
|
||||||
|
+
|
||||||
|
+ if (!IsStopped())
|
||||||
|
+ m_callback->OnCommandReceived(cmd);
|
||||||
|
+ }
|
||||||
|
+ /* We are not interested in other events */
|
||||||
|
+ } /*else {
|
||||||
|
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: Read returned %d", __func__, ret);
|
||||||
|
+ }*/
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#endif // HAVE_IMX_API
|
||||||
|
diff --git a/src/lib/adapter/IMX/IMXCECAdapterCommunication.h b/src/lib/adapter/IMX/IMXCECAdapterCommunication.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..910dd39
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/lib/adapter/IMX/IMXCECAdapterCommunication.h
|
||||||
|
@@ -0,0 +1,114 @@
|
||||||
|
+#pragma once
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the libCEC(R) library.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
|
||||||
|
+ * libCEC(R) is an original work, containing original code.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||||
|
+ *
|
||||||
|
+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
|
||||||
|
+ *
|
||||||
|
+ * You can redistribute this file 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.
|
||||||
|
+ *
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#if defined(HAVE_IMX_API)
|
||||||
|
+
|
||||||
|
+#include "lib/platform/threads/mutex.h"
|
||||||
|
+#include "lib/platform/threads/threads.h"
|
||||||
|
+#include "lib/platform/sockets/socket.h"
|
||||||
|
+#include "lib/adapter/AdapterCommunication.h"
|
||||||
|
+#include <map>
|
||||||
|
+
|
||||||
|
+#define IMX_ADAPTER_VID 0x0471 /*FIXME TBD*/
|
||||||
|
+#define IMX_ADAPTER_PID 0x1001
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+namespace PLATFORM
|
||||||
|
+{
|
||||||
|
+ class CCDevSocket;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+namespace CEC
|
||||||
|
+{
|
||||||
|
+ class CAdapterMessageQueueEntry;
|
||||||
|
+
|
||||||
|
+ class CIMXCECAdapterCommunication : public IAdapterCommunication, public PLATFORM::CThread
|
||||||
|
+ {
|
||||||
|
+ public:
|
||||||
|
+ /*!
|
||||||
|
+ * @brief Create a new USB-CEC communication handler.
|
||||||
|
+ * @param callback The callback to use for incoming CEC commands.
|
||||||
|
+ */
|
||||||
|
+ CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback);
|
||||||
|
+ virtual ~CIMXCECAdapterCommunication(void);
|
||||||
|
+
|
||||||
|
+ /** @name IAdapterCommunication implementation */
|
||||||
|
+ ///{
|
||||||
|
+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true);
|
||||||
|
+ void Close(void);
|
||||||
|
+ bool IsOpen(void);
|
||||||
|
+ std::string GetError(void) const;
|
||||||
|
+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply);
|
||||||
|
+
|
||||||
|
+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; }
|
||||||
|
+ bool StartBootloader(void) { return false; }
|
||||||
|
+ bool SetLogicalAddresses(const cec_logical_addresses &addresses);
|
||||||
|
+ cec_logical_addresses GetLogicalAddresses(void);
|
||||||
|
+ bool PingAdapter(void) { return IsInitialised(); }
|
||||||
|
+ uint16_t GetFirmwareVersion(void);
|
||||||
|
+ uint32_t GetFirmwareBuildDate(void) { return 0; }
|
||||||
|
+ bool IsRunningLatestFirmware(void) { return true; }
|
||||||
|
+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; }
|
||||||
|
+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; }
|
||||||
|
+ std::string GetPortName(void) { return std::string("IMX"); }
|
||||||
|
+ 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_IMX; }
|
||||||
|
+ uint16_t GetAdapterVendorId(void) const { return IMX_ADAPTER_VID; }
|
||||||
|
+ uint16_t GetAdapterProductId(void) const { return IMX_ADAPTER_PID; }
|
||||||
|
+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {}
|
||||||
|
+ ///}
|
||||||
|
+
|
||||||
|
+ /** @name PLATFORM::CThread implementation */
|
||||||
|
+ ///{
|
||||||
|
+ void *Process(void);
|
||||||
|
+ ///}
|
||||||
|
+
|
||||||
|
+ private:
|
||||||
|
+ bool IsInitialised(void) const { return m_dev != 0; };
|
||||||
|
+
|
||||||
|
+ std::string m_strError; /**< current error message */
|
||||||
|
+
|
||||||
|
+ //cec_logical_addresses m_logicalAddresses;
|
||||||
|
+ cec_logical_address m_logicalAddress;
|
||||||
|
+
|
||||||
|
+ PLATFORM::CMutex m_mutex;
|
||||||
|
+ PLATFORM::CCDevSocket *m_dev; /**< the device connection */
|
||||||
|
+
|
||||||
|
+ PLATFORM::CMutex m_messageMutex;
|
||||||
|
+ uint32_t m_iNextMessage;
|
||||||
|
+ std::map<uint32_t, CAdapterMessageQueueEntry *> m_messages;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
diff --git a/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp b/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..6c93c45
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp
|
||||||
|
@@ -0,0 +1,42 @@
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the libCEC(R) library.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
|
||||||
|
+ * libCEC(R) is an original work, containing original code.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||||
|
+ *
|
||||||
|
+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
|
||||||
|
+ *
|
||||||
|
+ * You can redistribute this file 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.
|
||||||
|
+ *
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "env.h"
|
||||||
|
+#include <stdio.h>
|
||||||
|
+
|
||||||
|
+#if defined(HAVE_IMX_API)
|
||||||
|
+#include "IMXCECAdapterDetection.h"
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+using namespace CEC;
|
||||||
|
+
|
||||||
|
+bool CIMXCECAdapterDetection::FindAdapter(void)
|
||||||
|
+{
|
||||||
|
+ return access(CEC_IMX_PATH, 0) == 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
diff --git a/src/lib/adapter/IMX/IMXCECAdapterDetection.h b/src/lib/adapter/IMX/IMXCECAdapterDetection.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..d54891d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/lib/adapter/IMX/IMXCECAdapterDetection.h
|
||||||
|
@@ -0,0 +1,36 @@
|
||||||
|
+#pragma once
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the libCEC(R) library.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
|
||||||
|
+ * libCEC(R) is an original work, containing original code.
|
||||||
|
+ *
|
||||||
|
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
|
||||||
|
+ *
|
||||||
|
+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
|
||||||
|
+ *
|
||||||
|
+ * You can redistribute this file 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.
|
||||||
|
+ *
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+namespace CEC
|
||||||
|
+{
|
||||||
|
+ class CIMXCECAdapterDetection
|
||||||
|
+ {
|
||||||
|
+ public:
|
||||||
|
+ static bool FindAdapter(void);
|
||||||
|
+ };
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
1.8.5.1
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
--- a/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 2013-10-02 18:39:38.933364683 +0200
|
||||||
|
+++ b/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 2013-10-02 18:39:38.945364681 +0200
|
||||||
|
@@ -223,7 +223,7 @@
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
- if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, log_addr) != 0)
|
||||||
|
+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, (void *)log_addr) != 0)
|
||||||
|
{
|
||||||
|
LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__);
|
||||||
|
return false;
|
20
projects/Cuboxi/patches/linux/linux-003-no_dev_console.patch
Normal file
20
projects/Cuboxi/patches/linux/linux-003-no_dev_console.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
diff -Naur linux-2.6.34-rc7/init/main.c linux-2.6.34-rc7.patch/init/main.c
|
||||||
|
--- linux-2.6.34-rc7/init/main.c 2010-05-10 03:36:28.000000000 +0200
|
||||||
|
+++ linux-2.6.34-rc7.patch/init/main.c 2010-05-15 12:28:34.767241760 +0200
|
||||||
|
@@ -886,8 +886,14 @@
|
||||||
|
do_basic_setup();
|
||||||
|
|
||||||
|
/* Open the /dev/console on the rootfs, this should never fail */
|
||||||
|
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
|
||||||
|
- printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
||||||
|
+ char *console = "/dev_console";
|
||||||
|
+
|
||||||
|
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
||||||
|
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
||||||
|
+ if (sys_open(console, O_RDWR, 0) < 0)
|
||||||
|
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
||||||
|
+ sys_unlink(console);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
(void) sys_dup(0);
|
||||||
|
(void) sys_dup(0);
|
@ -0,0 +1,113 @@
|
|||||||
|
diff -Naur linux-2.6.37/drivers/hid/hid-aureal.c linux-2.6.37.patch/drivers/hid/hid-aureal.c
|
||||||
|
--- linux-2.6.37/drivers/hid/hid-aureal.c 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ linux-2.6.37.patch/drivers/hid/hid-aureal.c 2011-01-07 22:35:31.413389936 +0100
|
||||||
|
@@ -0,0 +1,60 @@
|
||||||
|
+/*
|
||||||
|
+ * HID driver for some sunplus "special" devices
|
||||||
|
+ *
|
||||||
|
+ * Copyright (c) 1999 Andreas Gal
|
||||||
|
+ * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
|
||||||
|
+ * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
|
||||||
|
+ * Copyright (c) 2006-2007 Jiri Kosina
|
||||||
|
+ * Copyright (c) 2007 Paul Walmsley
|
||||||
|
+ * Copyright (c) 2008 Jiri Slaby
|
||||||
|
+ * Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com>
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * 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/hid.h>
|
||||||
|
+#include <linux/module.h>
|
||||||
|
+
|
||||||
|
+#include "hid-ids.h"
|
||||||
|
+
|
||||||
|
+static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||||
|
+ unsigned int *rsize)
|
||||||
|
+{
|
||||||
|
+ if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
|
||||||
|
+ dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 "
|
||||||
|
+ "report descriptor. Keyboard Logical Maximum = 101\n");
|
||||||
|
+ rdesc[53] = 0x65;
|
||||||
|
+ } return rdesc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static const struct hid_device_id aureal_devices[] = {
|
||||||
|
+ { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
|
||||||
|
+ { }
|
||||||
|
+};
|
||||||
|
+MODULE_DEVICE_TABLE(hid, aureal_devices);
|
||||||
|
+
|
||||||
|
+static struct hid_driver aureal_driver = {
|
||||||
|
+ .name = "aureal",
|
||||||
|
+ .id_table = aureal_devices,
|
||||||
|
+ .report_fixup = aureal_report_fixup,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static int __init aureal_init(void)
|
||||||
|
+{
|
||||||
|
+ return hid_register_driver(&aureal_driver);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void __exit aureal_exit(void)
|
||||||
|
+{
|
||||||
|
+ hid_unregister_driver(&aureal_driver);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+module_init(aureal_init);
|
||||||
|
+module_exit(aureal_exit);
|
||||||
|
+MODULE_LICENSE("GPL");
|
||||||
|
diff -Naur linux-2.6.37/drivers/hid/hid-ids.h linux-2.6.37.patch/drivers/hid/hid-ids.h
|
||||||
|
--- linux-2.6.37/drivers/hid/hid-ids.h 2011-01-05 01:50:19.000000000 +0100
|
||||||
|
+++ linux-2.6.37.patch/drivers/hid/hid-ids.h 2011-01-07 22:35:31.414389949 +0100
|
||||||
|
@@ -6,6 +6,7 @@
|
||||||
|
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
|
||||||
|
* Copyright (c) 2006-2007 Jiri Kosina
|
||||||
|
* Copyright (c) 2007 Paul Walmsley
|
||||||
|
+ * Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -327,6 +328,9 @@
|
||||||
|
#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087
|
||||||
|
#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
|
||||||
|
|
||||||
|
+#define USB_VENDOR_ID_AUREAL 0x0755
|
||||||
|
+#define USB_DEVICE_ID_AUREAL_W01RN 0x2626
|
||||||
|
+
|
||||||
|
#define USB_VENDOR_ID_LABTEC 0x1020
|
||||||
|
#define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006
|
||||||
|
|
||||||
|
diff -Naur linux-2.6.37/drivers/hid/Kconfig linux-2.6.37.patch/drivers/hid/Kconfig
|
||||||
|
--- linux-2.6.37/drivers/hid/Kconfig 2011-01-05 01:50:19.000000000 +0100
|
||||||
|
+++ linux-2.6.37.patch/drivers/hid/Kconfig 2011-01-07 22:35:31.467390603 +0100
|
||||||
|
@@ -87,6 +87,13 @@
|
||||||
|
Say Y here if you want support for keyboards of Apple iBooks, PowerBooks,
|
||||||
|
MacBooks, MacBook Pros and Apple Aluminum.
|
||||||
|
|
||||||
|
+config HID_AUREAL
|
||||||
|
+ tristate "Aureal" if EMBEDDED
|
||||||
|
+ depends on USB_HID
|
||||||
|
+ default !EMBEDDED
|
||||||
|
+ ---help---
|
||||||
|
+ Support for Aureal Cy se W-01RN Remote Controller
|
||||||
|
+
|
||||||
|
config HID_BELKIN
|
||||||
|
tristate "Belkin Flip KVM and Wireless keyboard" if EMBEDDED
|
||||||
|
depends on USB_HID
|
||||||
|
diff -Naur linux-2.6.37/drivers/hid/Makefile linux-2.6.37.patch/drivers/hid/Makefile
|
||||||
|
--- linux-2.6.37/drivers/hid/Makefile 2011-01-05 01:50:19.000000000 +0100
|
||||||
|
+++ linux-2.6.37.patch/drivers/hid/Makefile 2011-01-07 22:35:31.547391590 +0100
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
|
||||||
|
obj-$(CONFIG_HID_ACRUX_FF) += hid-axff.o
|
||||||
|
obj-$(CONFIG_HID_APPLE) += hid-apple.o
|
||||||
|
+obj-$(CONFIG_HID_AUREAL) += hid-aureal.o
|
||||||
|
obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
|
||||||
|
obj-$(CONFIG_HID_CANDO) += hid-cando.o
|
||||||
|
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
|
@ -0,0 +1,148 @@
|
|||||||
|
diff -Naur linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/hid-ids.h linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/hid-ids.h
|
||||||
|
--- linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/hid-ids.h 2014-01-12 18:38:32.000000000 +0100
|
||||||
|
+++ linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/hid-ids.h 2014-01-22 14:43:36.570838160 +0100
|
||||||
|
@@ -561,6 +561,9 @@
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_PHILIPS 0x0471
|
||||||
|
#define USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE 0x0617
|
||||||
|
+#define USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_1 0x206c
|
||||||
|
+#define USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_2 0x20cc
|
||||||
|
+#define USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_3 0x0613
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_PI_ENGINEERING 0x05f3
|
||||||
|
#define USB_DEVICE_ID_PI_ENGINEERING_VEC_USB_FOOTPEDAL 0xff
|
||||||
|
diff -Naur linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/hid-spinelplus.c linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/hid-spinelplus.c
|
||||||
|
--- linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/hid-spinelplus.c 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/hid-spinelplus.c 2014-01-22 14:43:36.570838160 +0100
|
||||||
|
@@ -0,0 +1,104 @@
|
||||||
|
+/*
|
||||||
|
+ * HID driver for "PHILIPS MCE USB IR Receiver- Spinel plus" remotes
|
||||||
|
+ *
|
||||||
|
+ * Copyright (c) 2010 Panagiotis Skintzos
|
||||||
|
+ *
|
||||||
|
+ * Renamed to Spinel, cleanup and modified to also support
|
||||||
|
+ * Spinel Plus 0471:20CC by Stephan Raue 2012.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * 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 spinelplus_map_key(c) set_bit(EV_REP, hi->input->evbit); \
|
||||||
|
+ hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
|
||||||
|
+
|
||||||
|
+static int spinelplus_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 0xffbc000d: spinelplus_map_key(KEY_MEDIA); break;
|
||||||
|
+ case 0xffbc0024: spinelplus_map_key(KEY_MEDIA); break;
|
||||||
|
+ case 0xffbc0027: spinelplus_map_key(KEY_ZOOM); break;
|
||||||
|
+ case 0xffbc0033: spinelplus_map_key(KEY_HOME); break;
|
||||||
|
+ case 0xffbc0035: spinelplus_map_key(KEY_CAMERA); break;
|
||||||
|
+ case 0xffbc0036: spinelplus_map_key(KEY_EPG); break;
|
||||||
|
+ case 0xffbc0037: spinelplus_map_key(KEY_DVD); break;
|
||||||
|
+ case 0xffbc0038: spinelplus_map_key(KEY_HOME); break;
|
||||||
|
+ case 0xffbc0039: spinelplus_map_key(KEY_MP3); break;
|
||||||
|
+ case 0xffbc003a: spinelplus_map_key(KEY_VIDEO); break;
|
||||||
|
+ case 0xffbc005a: spinelplus_map_key(KEY_TEXT); break;
|
||||||
|
+ case 0xffbc005b: spinelplus_map_key(KEY_RED); break;
|
||||||
|
+ case 0xffbc005c: spinelplus_map_key(KEY_GREEN); break;
|
||||||
|
+ case 0xffbc005d: spinelplus_map_key(KEY_YELLOW); break;
|
||||||
|
+ case 0xffbc005e: spinelplus_map_key(KEY_BLUE); break;
|
||||||
|
+ default:
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int spinelplus_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 spinelplus_devices[] = {
|
||||||
|
+ { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS,USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_1) },
|
||||||
|
+ { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS,USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_2) },
|
||||||
|
+ { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS,USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_3) },
|
||||||
|
+ { }
|
||||||
|
+};
|
||||||
|
+MODULE_DEVICE_TABLE(hid, spinelplus_devices);
|
||||||
|
+
|
||||||
|
+static struct hid_driver spinelplus_driver = {
|
||||||
|
+ .name = "SpinelPlus",
|
||||||
|
+ .id_table = spinelplus_devices,
|
||||||
|
+ .input_mapping = spinelplus_input_mapping,
|
||||||
|
+ .probe = spinelplus_probe,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static int __init spinelplus_init(void)
|
||||||
|
+{
|
||||||
|
+ return hid_register_driver(&spinelplus_driver);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void __exit spinelplus_exit(void)
|
||||||
|
+{
|
||||||
|
+ hid_unregister_driver(&spinelplus_driver);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+module_init(spinelplus_init);
|
||||||
|
+module_exit(spinelplus_exit);
|
||||||
|
+MODULE_LICENSE("GPL");
|
||||||
|
diff -Naur linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/Kconfig linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/Kconfig
|
||||||
|
--- linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/Kconfig 2014-01-12 18:38:32.000000000 +0100
|
||||||
|
+++ linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/Kconfig 2014-01-22 14:43:36.571838106 +0100
|
||||||
|
@@ -496,6 +496,12 @@
|
||||||
|
---help---
|
||||||
|
Support for Sony PS3 controller.
|
||||||
|
|
||||||
|
+config HID_SPINELPLUS
|
||||||
|
+ tristate "Spinel Plus remote control"
|
||||||
|
+ depends on USB_HID
|
||||||
|
+ ---help---
|
||||||
|
+ Say Y here if you have a Spinel Plus (0471:206c/20cc/0613) remote
|
||||||
|
+
|
||||||
|
config HID_SUNPLUS
|
||||||
|
tristate "Sunplus wireless desktop"
|
||||||
|
depends on USB_HID
|
||||||
|
diff -Naur linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/Makefile linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/Makefile
|
||||||
|
--- linux-imx_3.0.35_4.1.0-0f2006c/drivers/hid/Makefile 2014-01-12 18:38:32.000000000 +0100
|
||||||
|
+++ linux-imx_3.0.35_4.1.0-0f2006c.patch/drivers/hid/Makefile 2014-01-22 14:44:22.868855680 +0100
|
||||||
|
@@ -63,6 +63,7 @@
|
||||||
|
obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
|
||||||
|
obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
|
||||||
|
obj-$(CONFIG_HID_SONY) += hid-sony.o
|
||||||
|
+obj-$(CONFIG_HID_SPINELPLUS) += hid-spinelplus.o
|
||||||
|
obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
|
||||||
|
obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
|
||||||
|
obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
|
12
projects/Cuboxi/patches/linux/linux-056-Formosa-IR606.patch
Normal file
12
projects/Cuboxi/patches/linux/linux-056-Formosa-IR606.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Naur linux-3.2.7/drivers/media/rc/mceusb.c linux-3.2.7.patch/drivers/media/rc/mceusb.c
|
||||||
|
--- linux-3.2.7/drivers/media/rc/mceusb.c 2012-02-20 22:42:16.000000000 +0100
|
||||||
|
+++ linux-3.2.7.patch/drivers/media/rc/mceusb.c 2012-02-27 04:47:29.210888244 +0100
|
||||||
|
@@ -361,6 +361,8 @@
|
||||||
|
{ USB_DEVICE(VENDOR_FORMOSA, 0xe03c) },
|
||||||
|
/* Formosa Industrial Computing */
|
||||||
|
{ USB_DEVICE(VENDOR_FORMOSA, 0xe03e) },
|
||||||
|
+ /* Formosa Industrial Computing AIM IR606 */
|
||||||
|
+ { USB_DEVICE(VENDOR_FORMOSA, 0xe042) },
|
||||||
|
/* Fintek eHome Infrared Transceiver (HP branded) */
|
||||||
|
{ USB_DEVICE(VENDOR_FINTEK, 0x5168) },
|
||||||
|
/* Fintek eHome Infrared Transceiver */
|
@ -0,0 +1,12 @@
|
|||||||
|
diff -Naur linux-3.2.1/drivers/media/dvb/frontends/stb0899_drv.c linux-3.2.1.patch/drivers/media/dvb/frontends/stb0899_drv.c
|
||||||
|
--- linux-3.2.1/drivers/media/dvb/frontends/stb0899_drv.c 2012-01-12 20:42:45.000000000 +0100
|
||||||
|
+++ linux-3.2.1.patch/drivers/media/dvb/frontends/stb0899_drv.c 2012-01-23 10:47:29.311211860 +0100
|
||||||
|
@@ -1614,7 +1614,7 @@
|
||||||
|
.frequency_max = 2150000,
|
||||||
|
.frequency_stepsize = 0,
|
||||||
|
.frequency_tolerance = 0,
|
||||||
|
- .symbol_rate_min = 5000000,
|
||||||
|
+ .symbol_rate_min = 1000000,
|
||||||
|
.symbol_rate_max = 45000000,
|
||||||
|
|
||||||
|
.caps = FE_CAN_INVERSION_AUTO |
|
@ -0,0 +1,11 @@
|
|||||||
|
--- linux-3.2.2.orig/drivers/media/rc/mceusb.c 2012-01-30 23:37:12.374473509 +0100
|
||||||
|
+++ linux-3.2.2/drivers/media/rc/mceusb.c 2012-01-30 23:40:57.989652931 +0100
|
||||||
|
@@ -350,6 +350,8 @@
|
||||||
|
{ USB_DEVICE(VENDOR_FORMOSA, 0xe015) },
|
||||||
|
/* Formosa21 / eHome Infrared Receiver */
|
||||||
|
{ USB_DEVICE(VENDOR_FORMOSA, 0xe016) },
|
||||||
|
+ /* Formosa21 / eHome Infrared Receiver */
|
||||||
|
+ { USB_DEVICE(VENDOR_FORMOSA, 0xe042) },
|
||||||
|
/* Formosa aim / Trust MCE Infrared Receiver */
|
||||||
|
{ USB_DEVICE(VENDOR_FORMOSA, 0xe017),
|
||||||
|
.driver_info = MCE_GEN2_NO_TX },
|
@ -0,0 +1,141 @@
|
|||||||
|
diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c
|
||||||
|
index 2da55ec..3efde1e 100644
|
||||||
|
--- a/drivers/media/dvb/frontends/stb0899_algo.c
|
||||||
|
+++ b/drivers/media/dvb/frontends/stb0899_algo.c
|
||||||
|
@@ -206,7 +206,6 @@ static enum stb0899_status stb0899_check_tmg(struct stb0899_state *state)
|
||||||
|
static enum stb0899_status stb0899_search_tmg(struct stb0899_state *state)
|
||||||
|
{
|
||||||
|
struct stb0899_internal *internal = &state->internal;
|
||||||
|
- struct stb0899_params *params = &state->params;
|
||||||
|
|
||||||
|
short int derot_step, derot_freq = 0, derot_limit, next_loop = 3;
|
||||||
|
int index = 0;
|
||||||
|
@@ -216,10 +215,9 @@ static enum stb0899_status stb0899_search_tmg(struct stb0899_state *state)
|
||||||
|
|
||||||
|
/* timing loop computation & symbol rate optimisation */
|
||||||
|
derot_limit = (internal->sub_range / 2L) / internal->mclk;
|
||||||
|
- derot_step = (params->srate / 2L) / internal->mclk;
|
||||||
|
+ derot_step = internal->derot_step * 4; /* dertot_step = decreasing delta */
|
||||||
|
|
||||||
|
while ((stb0899_check_tmg(state) != TIMINGOK) && next_loop) {
|
||||||
|
- index++;
|
||||||
|
derot_freq += index * internal->direction * derot_step; /* next derot zig zag position */
|
||||||
|
|
||||||
|
if (abs(derot_freq) > derot_limit)
|
||||||
|
@@ -230,6 +228,7 @@ static enum stb0899_status stb0899_search_tmg(struct stb0899_state *state)
|
||||||
|
STB0899_SETFIELD_VAL(CFRL, cfr[1], LSB(state->config->inversion * derot_freq));
|
||||||
|
stb0899_write_regs(state, STB0899_CFRM, cfr, 2); /* derotator frequency */
|
||||||
|
}
|
||||||
|
+ index++;
|
||||||
|
internal->direction = -internal->direction; /* Change zigzag direction */
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -278,14 +277,18 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
|
||||||
|
{
|
||||||
|
struct stb0899_internal *internal = &state->internal;
|
||||||
|
|
||||||
|
- short int derot_freq = 0, last_derot_freq = 0, derot_limit, next_loop = 3;
|
||||||
|
+ short int derot_freq = 0, last_derot_freq = 0, derot_limit, derot_step, next_loop = 3;
|
||||||
|
int index = 0;
|
||||||
|
+ int base_freq;
|
||||||
|
u8 cfr[2];
|
||||||
|
u8 reg;
|
||||||
|
|
||||||
|
internal->status = NOCARRIER;
|
||||||
|
derot_limit = (internal->sub_range / 2L) / internal->mclk;
|
||||||
|
derot_freq = internal->derot_freq;
|
||||||
|
+ derot_step = internal->derot_step * 2;
|
||||||
|
+ last_derot_freq = internal->derot_freq;
|
||||||
|
+ base_freq = internal->derot_freq;
|
||||||
|
|
||||||
|
reg = stb0899_read_reg(state, STB0899_CFD);
|
||||||
|
STB0899_SETFIELD_VAL(CFD_ON, reg, 1);
|
||||||
|
@@ -294,11 +297,10 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
|
||||||
|
do {
|
||||||
|
dprintk(state->verbose, FE_DEBUG, 1, "Derot Freq=%d, mclk=%d", derot_freq, internal->mclk);
|
||||||
|
if (stb0899_check_carrier(state) == NOCARRIER) {
|
||||||
|
- index++;
|
||||||
|
last_derot_freq = derot_freq;
|
||||||
|
- derot_freq += index * internal->direction * internal->derot_step; /* next zig zag derotator position */
|
||||||
|
+ derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */
|
||||||
|
|
||||||
|
- if(abs(derot_freq) > derot_limit)
|
||||||
|
+ if (derot_freq > base_freq + derot_limit || derot_freq < base_freq - derot_limit)
|
||||||
|
next_loop--;
|
||||||
|
|
||||||
|
if (next_loop) {
|
||||||
|
@@ -310,9 +312,10 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
|
||||||
|
STB0899_SETFIELD_VAL(CFRL, cfr[1], LSB(state->config->inversion * derot_freq));
|
||||||
|
stb0899_write_regs(state, STB0899_CFRM, cfr, 2); /* derotator frequency */
|
||||||
|
}
|
||||||
|
+ index++;
|
||||||
|
+ internal->direction = -internal->direction; /* Change zigzag direction */
|
||||||
|
}
|
||||||
|
|
||||||
|
- internal->direction = -internal->direction; /* Change zigzag direction */
|
||||||
|
} while ((internal->status != CARRIEROK) && next_loop);
|
||||||
|
|
||||||
|
if (internal->status == CARRIEROK) {
|
||||||
|
@@ -338,6 +341,7 @@ static enum stb0899_status stb0899_check_data(struct stb0899_state *state)
|
||||||
|
int lock = 0, index = 0, dataTime = 500, loop;
|
||||||
|
u8 reg;
|
||||||
|
|
||||||
|
+ msleep(1);
|
||||||
|
internal->status = NODATA;
|
||||||
|
|
||||||
|
/* RESET FEC */
|
||||||
|
@@ -348,6 +352,7 @@ static enum stb0899_status stb0899_check_data(struct stb0899_state *state)
|
||||||
|
reg = stb0899_read_reg(state, STB0899_TSTRES);
|
||||||
|
STB0899_SETFIELD_VAL(FRESACS, reg, 0);
|
||||||
|
stb0899_write_reg(state, STB0899_TSTRES, reg);
|
||||||
|
+ msleep(1);
|
||||||
|
|
||||||
|
if (params->srate <= 2000000)
|
||||||
|
dataTime = 2000;
|
||||||
|
@@ -360,6 +365,7 @@ static enum stb0899_status stb0899_check_data(struct stb0899_state *state)
|
||||||
|
|
||||||
|
stb0899_write_reg(state, STB0899_DSTATUS2, 0x00); /* force search loop */
|
||||||
|
while (1) {
|
||||||
|
+ msleep(1); // Alex: added 1 mSec
|
||||||
|
/* WARNING! VIT LOCKED has to be tested before VIT_END_LOOOP */
|
||||||
|
reg = stb0899_read_reg(state, STB0899_VSTATUS);
|
||||||
|
lock = STB0899_GETFIELD(VSTATUS_LOCKEDVIT, reg);
|
||||||
|
@@ -387,20 +393,21 @@ static enum stb0899_status stb0899_search_data(struct stb0899_state *state)
|
||||||
|
short int derot_freq, derot_step, derot_limit, next_loop = 3;
|
||||||
|
u8 cfr[2];
|
||||||
|
u8 reg;
|
||||||
|
- int index = 1;
|
||||||
|
+ int index = 0;
|
||||||
|
+ int base_freq;
|
||||||
|
|
||||||
|
struct stb0899_internal *internal = &state->internal;
|
||||||
|
- struct stb0899_params *params = &state->params;
|
||||||
|
|
||||||
|
- derot_step = (params->srate / 4L) / internal->mclk;
|
||||||
|
+ derot_step = internal->derot_step;
|
||||||
|
derot_limit = (internal->sub_range / 2L) / internal->mclk;
|
||||||
|
derot_freq = internal->derot_freq;
|
||||||
|
+ base_freq = internal->derot_freq;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if ((internal->status != CARRIEROK) || (stb0899_check_data(state) != DATAOK)) {
|
||||||
|
|
||||||
|
derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */
|
||||||
|
- if (abs(derot_freq) > derot_limit)
|
||||||
|
+ if (derot_freq > base_freq + derot_limit || derot_freq < base_freq - derot_limit)
|
||||||
|
next_loop--;
|
||||||
|
|
||||||
|
if (next_loop) {
|
||||||
|
@@ -414,9 +421,9 @@ static enum stb0899_status stb0899_search_data(struct stb0899_state *state)
|
||||||
|
stb0899_write_regs(state, STB0899_CFRM, cfr, 2); /* derotator frequency */
|
||||||
|
|
||||||
|
stb0899_check_carrier(state);
|
||||||
|
- index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ index++;
|
||||||
|
internal->direction = -internal->direction; /* change zig zag direction */
|
||||||
|
} while ((internal->status != DATAOK) && next_loop);
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.1
|
@ -0,0 +1,46 @@
|
|||||||
|
diff -Naur linux-3.2.21/drivers/media/dvb/dvb-usb/dw2102.c linux-3.2.21.patch/drivers/media/dvb/dvb-usb/dw2102.c
|
||||||
|
--- linux-3.2.21/drivers/media/dvb/dvb-usb/dw2102.c 2012-06-20 00:18:30.000000000 +0200
|
||||||
|
+++ linux-3.2.21.patch/drivers/media/dvb/dvb-usb/dw2102.c 2012-06-28 14:08:50.721691934 +0200
|
||||||
|
@@ -1181,6 +1181,14 @@
|
||||||
|
{
|
||||||
|
u8 obuf[3] = { 0xe, 0x80, 0 };
|
||||||
|
u8 ibuf[] = { 0 };
|
||||||
|
+
|
||||||
|
+ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
|
||||||
|
+ err("command 0x0e transfer failed.");
|
||||||
|
+
|
||||||
|
+ //power on su3000
|
||||||
|
+ obuf[0] = 0xe;
|
||||||
|
+ obuf[1] = 0x02;
|
||||||
|
+ obuf[2] = 1;
|
||||||
|
|
||||||
|
if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
|
||||||
|
err("command 0x0e transfer failed.");
|
||||||
|
@@ -1448,6 +1456,7 @@
|
||||||
|
{USB_DEVICE(0x3034, 0x7500)},
|
||||||
|
{USB_DEVICE(0x1f4d, 0x3000)},
|
||||||
|
{USB_DEVICE(USB_VID_TERRATEC, 0x00a8)},
|
||||||
|
+ {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)},
|
||||||
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)},
|
||||||
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
|
||||||
|
{USB_DEVICE(0x1f4d, 0x3100)},
|
||||||
|
@@ -1839,7 +1848,7 @@
|
||||||
|
}},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
- .num_device_descs = 3,
|
||||||
|
+ .num_device_descs = 4,
|
||||||
|
.devices = {
|
||||||
|
{ "SU3000HD DVB-S USB2.0",
|
||||||
|
{ &dw2102_table[10], NULL },
|
||||||
|
@@ -1853,6 +1862,10 @@
|
||||||
|
{ &dw2102_table[14], NULL },
|
||||||
|
{ NULL },
|
||||||
|
},
|
||||||
|
+ { "Terratec Cinergy S2 USB HD Rev.2",
|
||||||
|
+ { &dw2102_table[17], NULL },
|
||||||
|
+ { NULL },
|
||||||
|
+ },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
This patch adds a module-device-table-entry to the
|
||||||
|
technisat-usb2-driver which will help udev to on-demand load the
|
||||||
|
driver. This was obviously forgotten during initial commit.
|
||||||
|
|
||||||
|
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
|
||||||
|
---
|
||||||
|
drivers/media/dvb/dvb-usb/technisat-usb2.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/drivers/media/dvb/dvb-usb/technisat-usb2.c b/drivers/media/dvb/dvb-usb/technisat-usb2.c
|
||||||
|
index acefaa8..7a8c8c1 100644
|
||||||
|
--- a/drivers/media/dvb/dvb-usb/technisat-usb2.c
|
||||||
|
+++ b/drivers/media/dvb/dvb-usb/technisat-usb2.c
|
||||||
|
@@ -677,6 +677,7 @@ static struct usb_device_id technisat_usb2_id_table[] = {
|
||||||
|
{ USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_DVB_S2) },
|
||||||
|
{ 0 } /* Terminating entry */
|
||||||
|
};
|
||||||
|
+MODULE_DEVICE_TABLE(usb, technisat_usb2_id_table);
|
||||||
|
|
||||||
|
/* device description */
|
||||||
|
static struct dvb_usb_device_properties technisat_usb2_devices = {
|
||||||
|
--
|
||||||
|
1.7.9.5
|
||||||
|
|
||||||
|
--
|
19
projects/Cuboxi/patches/linux/linux-imx-RC6.patch
Normal file
19
projects/Cuboxi/patches/linux/linux-imx-RC6.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
diff -Naur linux-imx_3.0.35_4.1.0-0f2006c/arch/arm/mach-mx6/board-mx6q_cubox-i.c linux-imx_3.0.35_4.1.0-0f2006c.patch/arch/arm/mach-mx6/board-mx6q_cubox-i.c
|
||||||
|
--- linux-imx_3.0.35_4.1.0-0f2006c/arch/arm/mach-mx6/board-mx6q_cubox-i.c 2014-01-12 18:38:33.000000000 +0100
|
||||||
|
+++ linux-imx_3.0.35_4.1.0-0f2006c.patch/arch/arm/mach-mx6/board-mx6q_cubox-i.c 2014-01-22 22:28:14.749986987 +0100
|
||||||
|
@@ -53,6 +53,7 @@
|
||||||
|
#include <linux/regulator/fixed.h>
|
||||||
|
#ifdef CONFIG_IR_GPIO_CIR
|
||||||
|
#include <media/gpio-ir-recv.h>
|
||||||
|
+#include <media/rc-map.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <mach/common.h>
|
||||||
|
@@ -257,6 +258,7 @@
|
||||||
|
static struct gpio_ir_recv_platform_data cubox_i_ir_data = {
|
||||||
|
.gpio_nr = GPIO_IR_IN,
|
||||||
|
.active_low = 1,
|
||||||
|
+ .map_name = RC_MAP_RC6_MCE,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device cubox_i_ir = {
|
@ -0,0 +1,11 @@
|
|||||||
|
--- linux-linux-imx+bdde708ebf/drivers/mxc/ipu3/ipu_param_mem.h 2013-08-16 04:01:35.000000000 +0200
|
||||||
|
+++ linux-linux-imx+bdde708ebf/drivers/mxc/ipu3/ipu_param_mem.h-new 2013-10-16 07:49:35.916193147 +0200
|
||||||
|
@@ -382,7 +382,7 @@
|
||||||
|
ipu_ch_param_set_field(¶ms, 1, 78, 7, 15); /* burst size */
|
||||||
|
uv_stride = uv_stride*2;
|
||||||
|
} else {
|
||||||
|
- ipu_ch_param_set_field(¶ms, 1, 78, 7, 31); /* burst size */
|
||||||
|
+ ipu_ch_param_set_field(¶ms, 1, 78, 7, 63); /* burst size */
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case IPU_PIX_FMT_YVU420P:
|
@ -0,0 +1,14 @@
|
|||||||
|
diff -Naur linux-imx_3.0.35_4.1.0-0f2006c/include/linux/fsl_devices.h linux-imx_3.0.35_4.1.0-0f2006c.patch/include/linux/fsl_devices.h
|
||||||
|
--- linux-imx_3.0.35_4.1.0-0f2006c/include/linux/fsl_devices.h 2014-01-12 18:38:34.000000000 +0100
|
||||||
|
+++ linux-imx_3.0.35_4.1.0-0f2006c.patch/include/linux/fsl_devices.h 2014-01-13 03:49:09.472692153 +0100
|
||||||
|
@@ -18,7 +18,10 @@
|
||||||
|
#define _FSL_DEVICE_H_
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
+
|
||||||
|
+#ifdef __KERNEL__
|
||||||
|
#include <linux/cdev.h>
|
||||||
|
+#endif /* __KERNEL__ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some conventions on how we handle peripherals on Freescale chips
|
16
projects/Cuboxi/patches/u-boot/u-boot-SPL.patch.bk
Normal file
16
projects/Cuboxi/patches/u-boot/u-boot-SPL.patch.bk
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
diff -Naur u-boot-imx6-cuboxi-920ea0f/include/configs/imx6_spl.h u-boot-imx6-cuboxi-920ea0f.patch/include/configs/imx6_spl.h
|
||||||
|
--- u-boot-imx6-cuboxi-920ea0f/include/configs/imx6_spl.h 2014-01-13 17:11:41.000000000 +0100
|
||||||
|
+++ u-boot-imx6-cuboxi-920ea0f.patch/include/configs/imx6_spl.h 2014-01-22 18:48:21.331246468 +0100
|
||||||
|
@@ -41,9 +41,9 @@
|
||||||
|
#define CONFIG_SPL_BOARD_INIT
|
||||||
|
|
||||||
|
#define CONFIG_SPL_BSS_START_ADDR 0x18200000
|
||||||
|
-#define CONFIG_SPL_BSS_MAX_SIZE 0x100000 /* 1 MB */
|
||||||
|
-#define CONFIG_SYS_SPL_MALLOC_START 0x18300000
|
||||||
|
-#define CONFIG_SYS_SPL_MALLOC_SIZE 0x3200000 /* 50 MB */
|
||||||
|
+#define CONFIG_SPL_BSS_MAX_SIZE 0x200000 /* 1 MB */
|
||||||
|
+#define CONFIG_SYS_SPL_MALLOC_START 0x18400000
|
||||||
|
+#define CONFIG_SYS_SPL_MALLOC_SIZE 0x3100000 /* 50 MB */
|
||||||
|
#define CONFIG_SYS_TEXT_BASE 0x17800000
|
||||||
|
#endif
|
||||||
|
|
3660
projects/Cuboxi/patches/xbmc/xbmc-001-imx6_support.patch
Normal file
3660
projects/Cuboxi/patches/xbmc/xbmc-001-imx6_support.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,245 @@
|
|||||||
|
diff -u axbmc/cores/paplayer/FLACcodec.cpp b/xbmc/cores/paplayer/FLACcodec.cpp
|
||||||
|
--- a/xbmc/cores/paplayer/FLACcodec.cpp 2013-05-02 16:46:47.000000000 +0200
|
||||||
|
+++ b/xbmc/cores/paplayer/FLACcodec.cpp 2013-11-02 17:37:24.000000000 +0100
|
||||||
|
@@ -23,6 +23,8 @@
|
||||||
|
#include "cores/AudioEngine/Utils/AEUtil.h"
|
||||||
|
#include "music/tags/TagLoaderTagLib.h"
|
||||||
|
|
||||||
|
+#define NUM_FRAMES 3
|
||||||
|
+
|
||||||
|
FLACCodec::FLACCodec()
|
||||||
|
{
|
||||||
|
m_SampleRate = 0;
|
||||||
|
@@ -37,8 +39,9 @@
|
||||||
|
|
||||||
|
m_pBuffer=NULL;
|
||||||
|
m_BufferSize=0;
|
||||||
|
+ m_BufferHead=0;
|
||||||
|
+ m_BufferTail=0;
|
||||||
|
m_MaxFrameSize=0;
|
||||||
|
-
|
||||||
|
}
|
||||||
|
|
||||||
|
FLACCodec::~FLACCodec()
|
||||||
|
@@ -104,9 +107,13 @@
|
||||||
|
delete[] m_pBuffer;
|
||||||
|
m_pBuffer=NULL;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
// allocate the buffer to hold the audio data,
|
||||||
|
- // it is 5 times bigger then a single decoded frame
|
||||||
|
- m_pBuffer=new BYTE[m_MaxFrameSize*5];
|
||||||
|
+ // it is (NUM_FRAMES + 1) times bigger then a single decoded frame
|
||||||
|
+ m_BufferSize = m_MaxFrameSize * (NUM_FRAMES + 1);
|
||||||
|
+ m_pBuffer = new BYTE[m_BufferSize];
|
||||||
|
+ m_BufferHead = 0;
|
||||||
|
+ m_BufferTail = 0;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@@ -129,7 +136,7 @@
|
||||||
|
// set the buffer size to 0 first, as this invokes a WriteCallback which
|
||||||
|
// may be called when the buffer is almost full (resulting in a buffer
|
||||||
|
// overrun unless we reset m_BufferSize first).
|
||||||
|
- m_BufferSize=0;
|
||||||
|
+ m_BufferHead = m_BufferTail;
|
||||||
|
if(!m_dll.FLAC__stream_decoder_seek_absolute(m_pFlacDecoder, (int64_t)(iSeekTime*m_SampleRate)/1000))
|
||||||
|
CLog::Log(LOGERROR, "FLACCodec::Seek - failed to seek");
|
||||||
|
|
||||||
|
@@ -145,44 +152,39 @@
|
||||||
|
|
||||||
|
int FLACCodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize)
|
||||||
|
{
|
||||||
|
- *actualsize=0;
|
||||||
|
-
|
||||||
|
- bool eof=false;
|
||||||
|
- if (m_dll.FLAC__stream_decoder_get_state(m_pFlacDecoder)==FLAC__STREAM_DECODER_END_OF_STREAM)
|
||||||
|
- eof=true;
|
||||||
|
-
|
||||||
|
- if (!eof)
|
||||||
|
- {
|
||||||
|
- // fill our buffer 4 decoded frame (the buffer could hold 5)
|
||||||
|
- while(m_BufferSize < m_MaxFrameSize*4 &&
|
||||||
|
+ // fill our buffer NUM_FRAMES decoded frame (the buffer could hold NUM_FRAMES + 1)
|
||||||
|
+ while(BufferFillCount() < m_MaxFrameSize * NUM_FRAMES &&
|
||||||
|
m_dll.FLAC__stream_decoder_get_state(m_pFlacDecoder)!=FLAC__STREAM_DECODER_END_OF_STREAM)
|
||||||
|
+ {
|
||||||
|
+ if (!m_dll.FLAC__stream_decoder_process_single(m_pFlacDecoder))
|
||||||
|
{
|
||||||
|
- if (!m_dll.FLAC__stream_decoder_process_single(m_pFlacDecoder))
|
||||||
|
- {
|
||||||
|
- CLog::Log(LOGERROR, "FLACCodec: Error decoding single block");
|
||||||
|
- return READ_ERROR;
|
||||||
|
- }
|
||||||
|
+ CLog::Log(LOGERROR, "FLACCodec: Error decoding single block");
|
||||||
|
+ *actualsize=0;
|
||||||
|
+ return READ_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (size<m_BufferSize)
|
||||||
|
- { // do we need less audio data then in our buffer
|
||||||
|
- memcpy(pBuffer, m_pBuffer, size);
|
||||||
|
- memmove(m_pBuffer, m_pBuffer+size, m_BufferSize-size);
|
||||||
|
- m_BufferSize-=size;
|
||||||
|
- *actualsize=size;
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
+ BYTE *pTemp = pBuffer;
|
||||||
|
+ while (size > 0)
|
||||||
|
{
|
||||||
|
- memcpy(pBuffer, m_pBuffer, m_BufferSize);
|
||||||
|
- *actualsize=m_BufferSize;
|
||||||
|
- m_BufferSize=0;
|
||||||
|
- }
|
||||||
|
+ int portion = BufferGetCount();
|
||||||
|
+
|
||||||
|
+ if (portion <= 0)
|
||||||
|
+ break;
|
||||||
|
|
||||||
|
- if (eof && m_BufferSize==0)
|
||||||
|
- return READ_EOF;
|
||||||
|
+ if (portion > size)
|
||||||
|
+ portion = size;
|
||||||
|
|
||||||
|
- return READ_SUCCESS;
|
||||||
|
+ memcpy(pTemp, m_pBuffer + m_BufferHead, portion);
|
||||||
|
+ pTemp += portion;
|
||||||
|
+ size -= portion;
|
||||||
|
+ m_BufferHead = (m_BufferHead + portion) % m_BufferSize;
|
||||||
|
+ }
|
||||||
|
+ *actualsize = pTemp - pBuffer;
|
||||||
|
+
|
||||||
|
+ return (m_BufferHead == m_BufferTail &&
|
||||||
|
+ m_dll.FLAC__stream_decoder_get_state(m_pFlacDecoder)==FLAC__STREAM_DECODER_END_OF_STREAM)
|
||||||
|
+ ? READ_EOF : READ_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FLACCodec::CanInit()
|
||||||
|
@@ -262,43 +264,67 @@
|
||||||
|
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
|
||||||
|
|
||||||
|
const int bytes_per_sample = frame->header.bits_per_sample/8;
|
||||||
|
- BYTE* outptr = pThis->m_pBuffer+pThis->m_BufferSize;
|
||||||
|
- FLAC__int16* outptr16 = (FLAC__int16 *) outptr;
|
||||||
|
- FLAC__int32* outptr32 = (FLAC__int32 *) outptr;
|
||||||
|
+ BYTE* outptr = pThis->m_pBuffer + pThis->m_BufferTail;
|
||||||
|
+ int outcnt = 0, outlen = pThis->BufferPutCount();
|
||||||
|
+
|
||||||
|
+ #ifdef __BIG_ENDIAN__
|
||||||
|
+ int endian_shift = 32 - frame->header.bits_per_sample;
|
||||||
|
+ #endif
|
||||||
|
|
||||||
|
- unsigned int current_sample = 0;
|
||||||
|
- for(current_sample = 0; current_sample < frame->header.blocksize; current_sample++)
|
||||||
|
+ for(unsigned int current_sample = 0; current_sample < frame->header.blocksize; current_sample++)
|
||||||
|
{
|
||||||
|
for(unsigned int channel = 0; channel < frame->header.channels; channel++)
|
||||||
|
{
|
||||||
|
- switch(bytes_per_sample)
|
||||||
|
+ FLAC__int32 v = buffer[channel][current_sample];
|
||||||
|
+
|
||||||
|
+ // make 1 byte samples unsigned
|
||||||
|
+ if (bytes_per_sample == 1)
|
||||||
|
+ v ^= 0x80;
|
||||||
|
+
|
||||||
|
+ #ifdef __BIG_ENDIAN__
|
||||||
|
+ v <<= endian_shift;
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ if (outlen - outcnt >= 4)
|
||||||
|
{
|
||||||
|
- case 2:
|
||||||
|
- outptr16[current_sample*frame->header.channels + channel] = (FLAC__int16) buffer[channel][current_sample];
|
||||||
|
- break;
|
||||||
|
- case 3:
|
||||||
|
- outptr[2] = (buffer[channel][current_sample] >> 16) & 0xff;
|
||||||
|
- outptr[1] = (buffer[channel][current_sample] >> 8 ) & 0xff;
|
||||||
|
- outptr[0] = (buffer[channel][current_sample] >> 0 ) & 0xff;
|
||||||
|
- outptr += bytes_per_sample;
|
||||||
|
- break;
|
||||||
|
- default:
|
||||||
|
- outptr32[current_sample*frame->header.channels + channel] = buffer[channel][current_sample];
|
||||||
|
- break;
|
||||||
|
+ *((FLAC__int32 *)outptr) = v;
|
||||||
|
+
|
||||||
|
+ outptr += bytes_per_sample;
|
||||||
|
+ outcnt += bytes_per_sample;
|
||||||
|
+
|
||||||
|
+ if (outcnt >= outlen)
|
||||||
|
+ {
|
||||||
|
+ pThis->m_BufferTail = (pThis->m_BufferTail + outcnt) % pThis->m_BufferSize;
|
||||||
|
+ outcnt = 0;
|
||||||
|
+ outlen = pThis->BufferPutCount();
|
||||||
|
+ outptr = pThis->m_pBuffer + pThis->m_BufferTail;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ continue;
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
|
||||||
|
- if (bytes_per_sample == 1)
|
||||||
|
- {
|
||||||
|
- for(unsigned int i=0;i<current_sample;i++)
|
||||||
|
- {
|
||||||
|
- BYTE* outptr=pThis->m_pBuffer+pThis->m_BufferSize;
|
||||||
|
- outptr[i]^=0x80;
|
||||||
|
+ for(int byte_no = 0; byte_no < bytes_per_sample; byte_no++)
|
||||||
|
+ {
|
||||||
|
+ #ifdef __BIG_ENDIAN__
|
||||||
|
+ *outptr++ = (BYTE)(v >> 24);
|
||||||
|
+ v <<= 8;
|
||||||
|
+ #else
|
||||||
|
+ *outptr++ = (BYTE)v;
|
||||||
|
+ v >>= 8;
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ if (++outcnt >= outlen)
|
||||||
|
+ {
|
||||||
|
+ pThis->m_BufferTail = (pThis->m_BufferTail + outcnt) % pThis->m_BufferSize;
|
||||||
|
+ outcnt = 0;
|
||||||
|
+ outlen = pThis->BufferPutCount();
|
||||||
|
+ outptr = pThis->m_pBuffer + pThis->m_BufferTail;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- pThis->m_BufferSize += current_sample*bytes_per_sample*frame->header.channels;
|
||||||
|
+ pThis->m_BufferTail = (pThis->m_BufferTail + outcnt) % pThis->m_BufferSize;
|
||||||
|
|
||||||
|
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
|
||||||
|
}
|
||||||
|
diff -u a/xbmc/cores/paplayer/FLACcodec.h b/xbmc/cores/paplayer/FLACcodec.h
|
||||||
|
--- a/xbmc/cores/paplayer/FLACcodec.h 2013-05-02 16:46:47.000000000 +0200
|
||||||
|
+++ b/xbmc/cores/paplayer/FLACcodec.h 2013-11-02 17:44:53.000000000 +0100
|
||||||
|
@@ -51,8 +51,27 @@
|
||||||
|
|
||||||
|
DllLibFlac m_dll;
|
||||||
|
BYTE* m_pBuffer; // buffer to hold the decoded audio data
|
||||||
|
- int m_BufferSize; // size of buffer is filled with decoded audio data
|
||||||
|
+ int m_BufferSize; // allocated size of buffer
|
||||||
|
+ int m_BufferHead; // buffer head index
|
||||||
|
+ int m_BufferTail; // buffer tail index
|
||||||
|
int m_MaxFrameSize; // size of a single decoded frame
|
||||||
|
FLAC__StreamDecoder* m_pFlacDecoder;
|
||||||
|
CAEChannelInfo m_ChannelInfo;
|
||||||
|
+
|
||||||
|
+ int BufferFillCount() const
|
||||||
|
+ {
|
||||||
|
+ int i = m_BufferTail - m_BufferHead;
|
||||||
|
+ return (i < 0) ? (i + m_BufferSize) : i;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ int BufferGetCount() const
|
||||||
|
+ {
|
||||||
|
+ return ((m_BufferTail >= m_BufferHead) ? m_BufferTail : m_BufferSize) - m_BufferHead;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ int BufferPutCount() const
|
||||||
|
+ {
|
||||||
|
+ return ((m_BufferTail >= m_BufferHead) ?
|
||||||
|
+ (m_BufferSize + ((m_BufferHead == 0) ? 0 : 1)) : m_BufferHead) - m_BufferTail - 1;
|
||||||
|
+ }
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user