crazycat: update to latest

This commit is contained in:
CvH
2018-08-26 17:25:32 +02:00
parent 17cc22483a
commit b82e518575
7 changed files with 39 additions and 2863 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2,46 +2,35 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="crazycat"
PKG_VERSION="2017-12-06"
PKG_SHA256="779c7d42e5fd4dfac8f53654ce8af467d22a81b6c0b21e24f14aaaed033c6eb1"
PKG_VERSION="835dc72da3ee63df7f4057bd0507887454c005d1"
PKG_SHA256="3d68d368a9eda15688c6686caa854a045a753740ec93553d80a4bcfc14c2950a"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/crazycat69/linux_media"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_SITE="https://bitbucket.org/CrazyCat/media_build"
PKG_URL="https://bitbucket.org/CrazyCat/media_build/get/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="CrazyCat-media_build-*"
PKG_DEPENDS_TARGET="toolchain linux media_tree_cc"
PKG_NEED_UNPACK="$LINUX_DEPENDS media_tree_cc"
PKG_SECTION="driver.dvb"
PKG_LONGDESC="DVB driver for TBS cards with CrazyCats additions."
PKG_LONGDESC="DVB driver for TBS cards with CrazyCats additions"
PKG_IS_ADDON="embedded"
PKG_IS_KERNEL_PKG="yes"
PKG_ADDON_IS_STANDALONE="yes"
PKG_ADDON_NAME="DVB drivers for TBS (CrazyCat)"
PKG_ADDON_NAME="DVB drivers for TBS"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_VERSION="${ADDON_VERSION}.${PKG_REV}"
if [ $LINUX = "rockchip-4.4" ]; then
PKG_PATCH_DIRS="rockchip"
fi
pre_make_target() {
export KERNEL_VER=$(get_module_dir)
export LDFLAGS=""
}
make_target() {
kernel_make SRCDIR=$(kernel_path) untar
cp -RP $(get_build_dir media_tree_cc)/* $PKG_BUILD/linux
# copy config file
if [ "$PROJECT" = Generic ]; then
if [ -f $PKG_DIR/config/generic.config ]; then
cp $PKG_DIR/config/generic.config v4l/.config
fi
else
if [ -f $PKG_DIR/config/usb.config ]; then
cp $PKG_DIR/config/usb.config v4l/.config
fi
fi
# make staging config (all + experimental)
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path) stagingconfig
# hack to workaround media_build bug
if [ "$PROJECT" = Rockchip ]; then

View File

@@ -1,11 +0,0 @@
--- a/backports/backports.txt
+++ b/backports/backports.txt
@@ -25,6 +25,8 @@ add api_version.patch
add pr_fmt.patch
add debug.patch
add drx39xxj.patch
+add linux-202-lnbp22_patch_for_more_power_if_rotor.patch
+add linux-220-Xbox-One-DVB-T2-stick-support.patch
[4.12.255]
add v4.12_revert_solo6x10_copykerneluser.patch

View File

@@ -1,165 +0,0 @@
This patch is from the original driver author and allows minimal power on time,
so that capacitors of secondary equipment like dish motors can be properly loaded and equipment properly initialized
see https://www.spinics.net/lists/linux-media/msg38226.html
and https://github.com/LibreELEC/LibreELEC.tv/pull/1118
tested with TT S2-3650CI and a HH90 rotor
--- a/drivers/media/dvb-frontends/lnbp22.c
+++ b/drivers/media/dvb-frontends/lnbp22.c
@@ -48,47 +48,95 @@ struct lnbp22 {
struct i2c_adapter *i2c;
};
+static int lnbp22_read_config(struct dvb_frontend *fe, u8 *config) {
+ struct lnbp22 *lnbp22 = (struct lnbp22 *) fe->sec_priv;
+ struct i2c_msg msg = { .addr = 0x08, .flags = I2C_M_RD,
+ .buf = (char*)config,
+ .len = sizeof(lnbp22->config) };
+
+ if (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) {
+ dprintk(2, "%s: %02X %02X %02X %02X\n", __FUNCTION__,
+ config[0], config[1], config[2], config[3]);
+ return 0;
+ }
+ return -EIO;
+}
+
+static int lnbp22_write_config(struct dvb_frontend *fe, u8 *config) {
+ struct lnbp22 *lnbp22 = (struct lnbp22 *) fe->sec_priv;
+ struct i2c_msg msg = { .addr = 0x08, .flags = 0,
+ .buf = (char*)config,
+ .len = sizeof(lnbp22->config) };
+
+ if (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) {
+ dprintk(2, "%s: %02X %02X %02X %02X\n", __FUNCTION__,
+ config[0], config[1], config[2], config[3]);
+ return 0;
+ }
+ return -EIO;
+}
+
static int lnbp22_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{
struct lnbp22 *lnbp22 = (struct lnbp22 *)fe->sec_priv;
- struct i2c_msg msg = {
- .addr = 0x08,
- .flags = 0,
- .buf = (char *)&lnbp22->config,
- .len = sizeof(lnbp22->config),
- };
+ int status;
dprintk(1, "%s: %d (18V=%d 13V=%d)\n", __func__, voltage,
SEC_VOLTAGE_18, SEC_VOLTAGE_13);
- lnbp22->config[3] = 0x60; /* Power down */
switch (voltage) {
- case SEC_VOLTAGE_OFF:
- break;
- case SEC_VOLTAGE_13:
- lnbp22->config[3] |= LNBP22_EN;
- break;
- case SEC_VOLTAGE_18:
- lnbp22->config[3] |= (LNBP22_EN | LNBP22_VSEL);
- break;
- default:
- return -EINVAL;
+ case SEC_VOLTAGE_OFF:
+ lnbp22->config[3] &= ~LNBP22_EN;
+ return lnbp22_write_config(fe, lnbp22->config);
+ case SEC_VOLTAGE_13:
+ lnbp22->config[3] |= LNBP22_EN;
+ lnbp22->config[3] &= ~LNBP22_VSEL;
+ break;
+ case SEC_VOLTAGE_18:
+ lnbp22->config[3] |= LNBP22_EN|LNBP22_VSEL;
+ break;
+ default:
+ return -EINVAL; }
+
+ status = lnbp22_write_config(fe, lnbp22->config);
+ if( status == 0 ) {
+ u8 config[4];
+ int retries = 20;
+
+ /* byte 0: status
+ bit 3: open loop
+ bit 2: in progress/not ready
+ bit 1: over current limit
+ bit 0: over voltage limit */
+
+ /* wait up to 2 seconds for voltage to stablize.
+ It is important to wait that long, especially if there is a
+ rotor to power on, as DC/DC converter capacitors can take a
+ while to charge up and could cause a temporary overload */
+ do
+ {
+ msleep(50);
+ status = lnbp22_read_config(fe, config);
+ if( status < 0 )
+ return status;
+ }
+ while( (config[0] & (1<<2)) && retries-- );
+
+ dprintk(1, "%s status=0x%02X\n", __FUNCTION__, config[0]);
+
+ if( retries < 0 )
+ return -EAGAIN; /* temporary overload ? */
+
+ if( config[0] & (1<<3) )
+ return -ENOLINK; /* open loop */
}
-
- dprintk(1, "%s: 0x%02x)\n", __func__, lnbp22->config[3]);
- return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;
+ return status;
}
static int lnbp22_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
{
struct lnbp22 *lnbp22 = (struct lnbp22 *) fe->sec_priv;
- struct i2c_msg msg = {
- .addr = 0x08,
- .flags = 0,
- .buf = (char *)&lnbp22->config,
- .len = sizeof(lnbp22->config),
- };
dprintk(1, "%s: %d\n", __func__, (int)arg);
if (arg)
@@ -96,7 +144,7 @@ static int lnbp22_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
else
lnbp22->config[3] &= ~LNBP22_LLC;
- return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;
+ return lnbp22_write_config(fe, lnbp22->config);
}
static void lnbp22_release(struct dvb_frontend *fe)
@@ -118,20 +166,14 @@ struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,
return NULL;
/* default configuration */
- lnbp22->config[0] = 0x00; /* ? */
+ lnbp22->config[0] = 0x00; /* status */
lnbp22->config[1] = 0x28; /* ? */
- lnbp22->config[2] = 0x48; /* ? */
+ lnbp22->config[2] = 0x49; /* ? */
lnbp22->config[3] = 0x60; /* Power down */
lnbp22->i2c = i2c;
fe->sec_priv = lnbp22;
- /* detect if it is present or not */
- if (lnbp22_set_voltage(fe, SEC_VOLTAGE_OFF)) {
- dprintk(0, "%s LNBP22 not found\n", __func__);
- kfree(lnbp22);
- fe->sec_priv = NULL;
- return NULL;
- }
+ lnbp22_set_voltage(fe, SEC_VOLTAGE_OFF);
/* install release callback */
fe->ops.release_sec = lnbp22_release;

View File

@@ -0,0 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="media_tree_cc"
PKG_VERSION="2018-08-17"
PKG_SHA256="1ffaafeeec85eece9697693efa22c8955a5ff63b7697eb0976f830ba92247147"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://bitbucket.org/CrazyCat/media_build/downloads/"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="driver"
PKG_LONGDESC="Source of Linux Kernel media_tree subsystem to build with media_build."
PKG_TOOLCHAIN="manual"
unpack() {
mkdir -p $PKG_BUILD/
tar -xf $SOURCES/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2 -C $PKG_BUILD/
# hack/workaround for borked upstream kernel/media_build
# without removing atomisp there a lot additional includes that
# slowdown build process after modpost from 3min to 6min
# even if atomisp is disabled via kernel.conf
rm -rf $PKG_BUILD/drivers/staging/media/atomisp
sed -i 's|^.*drivers/staging/media/atomisp.*$||' \
$PKG_BUILD/drivers/staging/media/Kconfig
}