Remove old unused packages

This commit is contained in:
fewtarius 2022-02-15 17:52:24 -05:00
parent 9056c53ee7
commit 2b7342d152
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
148 changed files with 0 additions and 9253 deletions

View file

@ -1,2 +0,0 @@
100
- Initial add-on

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

View file

@ -1,61 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="crazycat"
PKG_VERSION="ca1ea9fc2cfaedfc32bd0ac628e03e9aa379e3ad"
PKG_SHA256="6b44a96d82c4a3e052864a995baceaede46b37c048c5718a6f62a009492d08ff"
PKG_LICENSE="GPL"
PKG_SITE="https://bitbucket.org/CrazyCat/media_build"
PKG_URL="https://bitbucket.org/CrazyCat/media_build/get/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux media_tree_cc"
PKG_NEED_UNPACK="$LINUX_DEPENDS $(get_pkg_directory media_tree_cc)"
PKG_SECTION="driver.dvb"
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"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_VERSION="${ADDON_VERSION}.${PKG_REV}"
if [ "$PROJECT" = "Amlogic-ng" ]; then
PKG_PATCH_DIRS="amlogic-4.9"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET media_tree_aml"
PKG_NEED_UNPACK="$PKG_NEED_UNPACK $(get_pkg_directory media_tree_aml)"
fi
pre_make_target() {
export KERNEL_VER=$(get_module_dir)
export LDFLAGS=""
}
make_target() {
cp -RP $(get_build_dir media_tree_cc)/* $PKG_BUILD/linux
if [ "$PROJECT" = "Amlogic-ng" ]; then
cp -Lr $(get_build_dir media_tree_aml)/* $PKG_BUILD/linux
echo "obj-y += video_dev/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo "obj-y += dvb/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo 'source "drivers/media/platform/meson/dvb/Kconfig"' >> "$PKG_BUILD/linux/drivers/media/platform/Kconfig"
sed -e 's/ && RC_CORE//g' -i $PKG_BUILD/linux/drivers/media/usb/dvb-usb/Kconfig
fi
# make config all
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path) allyesconfig
# hack to workaround media_build bug
if [ "$PROJECT" = Rockchip ]; then
sed -e 's/CONFIG_DVB_CXD2820R=m/# CONFIG_DVB_CXD2820R is not set/g' -i v4l/.config
sed -e 's/CONFIG_DVB_LGDT3306A=m/# CONFIG_DVB_LGDT3306A is not set/g' -i v4l/.config
# elif [ "$PROJECT" = "Amlogic-ng" ]; then
# sed -e 's/# CONFIG_MEDIA_TUNER_TDA18250 is not set/CONFIG_MEDIA_TUNER_TDA18250=m/g' -i $PKG_BUILD/v4l/.config
fi
# add menuconfig to edit .config
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path)
}
makeinstall_target() {
install_driver_addon_files "$PKG_BUILD/v4l/"
}

View file

@ -1,15 +0,0 @@
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -626,6 +626,12 @@ ($$)
close OUT;
# These options should default to off
+disable_config('MEDIA_ANALOG_TV_SUPPORT');
+disable_config('MEDIA_CAMERA_SUPPORT');
+disable_config('MEDIA_CEC_SUPPORT');
+disable_config('SOC_CAMERA');
+disable_config('VIDEO_SAA7146_VV');
+disable_config('RC_CORE');
disable_config('DVB_AV7110_FIRMWARE');
disable_config('DVB_CINERGYT2_TUNING');
disable_config('VIDEO_HELPER_CHIPS_AUTO');

View file

@ -1,12 +0,0 @@
--- /dev/null
+++ b/v4l/config-mycompat.h
@@ -0,0 +1,8 @@
+#undef smp_mb__after_atomic
+#define smp_mb__after_atomic() smp_mb() /*mb*/
+#undef NEED_SMP_MB_AFTER_ATOMIC
+#undef writel_relaxed
+#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
+#undef NEED_WRITEL_RELAXED
+#undef NEED_PM_RUNTIME_GET
+#undef NEED_OF_NODE_NAME_EQ
--

View file

@ -1,13 +0,0 @@
[Patch] without this patch you need to install libproc-processtable-perl at host system
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -51,7 +51,7 @@
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C ../linux apply_patches
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
- ./scripts/rmmod.pl check
+# ./scripts/rmmod.pl check
# $(MAKE) checkpatch
mismatch:: prepare firmware

View file

@ -1,2 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

View file

@ -1,2 +0,0 @@
100
- Initial add-on

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

View file

@ -1,68 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="crazycat_aml"
PKG_VERSION="835dc72da3ee63df7f4057bd0507887454c005d1"
PKG_SHA256="3d68d368a9eda15688c6686caa854a045a753740ec93553d80a4bcfc14c2950a"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://bitbucket.org/CrazyCat/media_build"
PKG_URL="https://bitbucket.org/CrazyCat/media_build/get/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux media_tree_cc_aml media_tree_aml"
PKG_NEED_UNPACK="$LINUX_DEPENDS $(get_pkg_directory media_tree_cc_aml) $(get_pkg_directory media_tree_aml)"
PKG_SECTION="driver.dvb"
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"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_VERSION="${ADDON_VERSION}.${PKG_REV}"
case "$LINUX" in
amlogic-3.14)
PKG_PATCH_DIRS="amlogic-3.14"
;;
esac
pre_make_target() {
export KERNEL_VER=$(get_module_dir)
export LDFLAGS=""
}
make_target() {
cp -RP $(get_build_dir media_tree_cc_aml)/* $PKG_BUILD/linux
rm -rf $PKG_BUILD/linux/drivers/media/platform/meson/wetek
rm -rf $PKG_BUILD/linux/drivers/media/platform/meson/dvb-avl
cp -Lr $(get_build_dir media_tree_aml)/* $PKG_BUILD/linux
# compile modules
echo "obj-y += video_dev/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo "obj-y += dvb/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo 'source "drivers/media/platform/meson/dvb/Kconfig"' >> "$PKG_BUILD/linux/drivers/media/platform/Kconfig"
sed -e 's/ && RC_CORE//g' -i $PKG_BUILD/linux/drivers/media/usb/dvb-usb/Kconfig
# make config all
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path) allyesconfig
# deactivate several build options
sed '/CONFIG_VIDEO_S5C73M3=m/d' -i $PKG_BUILD/v4l/.config
# enable AML drivers
echo "CONFIG_V4L_AMLOGIC_VIDEO=m" >> $PKG_BUILD/v4l/.config
echo "CONFIG_VIDEOBUF_RESOURCE=m" >> $PKG_BUILD/v4l/.config
# hack to workaround media_build bug
sed -e 's/CONFIG_VIDEO_SAA7146_VV=m/# CONFIG_VIDEO_SAA7146_VV is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_S5K5BAF=m/# CONFIG_VIDEO_S5K5BAF is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_TVP514X=m/# CONFIG_VIDEO_TVP514X is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_TVP7002=m/# CONFIG_VIDEO_TVP7002 is not set/g' -i $PKG_BUILD/v4l/.config
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path)
}
makeinstall_target() {
install_driver_addon_files "$PKG_BUILD/v4l/"
}

View file

@ -1,13 +0,0 @@
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -626,6 +626,10 @@ ($$)
close OUT;
# These options should default to off
+disable_config('MEDIA_ANALOG_TV_SUPPORT');
+disable_config('MEDIA_CAMERA_SUPPORT');
+disable_config('MEDIA_CEC_SUPPORT');
+disable_config('SOC_CAMERA');
disable_config('DVB_AV7110_FIRMWARE');
disable_config('DVB_CINERGYT2_TUNING');
disable_config('VIDEO_HELPER_CHIPS_AUTO');

View file

@ -1,15 +0,0 @@
--- /dev/null
+++ b/v4l/config-mycompat.h
@@ -0,0 +1,11 @@
+#undef smp_mb__after_atomic
+#define smp_mb__after_atomic() smp_mb() /*mb*/
+#undef NEED_SMP_MB_AFTER_ATOMIC
+#undef __pfn_to_phys
+#define __pfn_to_phys(pfn) ((phys_addr_t)(pfn) << PAGE_SHIFT)
+#undef NEED_PFN_TO_PHYS
+#undef writel_relaxed
+#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
+#undef NEED_WRITEL_RELAXED
+#undef NEED_PM_RUNTIME_GET
+#undef NEED_OF_NODE_NAME_EQ
--

View file

@ -1,13 +0,0 @@
[Patch] without this patch you need to install libproc-processtable-perl at host system
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -51,7 +51,7 @@
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C ../linux apply_patches
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
- ./scripts/rmmod.pl check
+# ./scripts/rmmod.pl check
# $(MAKE) checkpatch
mismatch:: prepare firmware

View file

@ -1,2 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

View file

@ -1,35 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="media_tree"
PKG_VERSION="2019-07-11-22be8233b34f"
PKG_SHA256="14363b1aacfe59805a1fe93739caed53036879e7b871f1d8d7061527c3cb9eb8"
PKG_LICENSE="GPL"
PKG_SITE="https://git.linuxtv.org/media_tree.git"
PKG_URL="http://linuxtv.org/downloads/drivers/linux-media-${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Source of Linux Kernel media_tree subsystem to build with media_build."
PKG_TOOLCHAIN="manual"
case "$LINUX" in
amlogic-4.9)
PKG_PATCH_DIRS="amlogic-4.9"
;;
esac
unpack() {
mkdir -p $PKG_BUILD/
tar -xf $SOURCES/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2 -C $PKG_BUILD/
}
post_unpack() {
# 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
}

View file

@ -1,23 +0,0 @@
--- a/drivers/media/v4l2-core/v4l2-fwnode.c 2019-04-02 00:31:42.224001000 +0200
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c 2019-04-02 00:31:42.256001000 +0200
@@ -553,6 +553,20 @@
}
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_alloc_parse);
+bool of_node_name_eq(const struct device_node *np, const char *name)
+{
+ const char *node_name;
+ size_t len;
+
+ if (!np)
+ return false;
+
+ node_name = kbasename(np->full_name);
+ len = strchrnul(node_name, '@') - node_name;
+
+ return (strlen(name) == len) && (strncmp(node_name, name, len) == 0);
+}
+
int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
struct v4l2_fwnode_link *link)
{

View file

@ -1,74 +0,0 @@
diff -ur a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c 2019-07-10 23:44:44.000000000 +0100
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c 2019-12-18 04:54:05.614904632 +0000
@@ -443,6 +443,42 @@
}
EXPORT_SYMBOL(v4l2_m2m_job_finish);
+void v4l2_m2m_job_pause(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&m2m_dev->job_spinlock, flags);
+ if (!m2m_dev->curr_ctx || m2m_dev->curr_ctx != m2m_ctx) {
+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
+ dprintk("Called by an instance not currently running\n");
+ return;
+ }
+
+ list_del(&m2m_dev->curr_ctx->queue);
+ m2m_dev->curr_ctx->job_flags &= ~(TRANS_QUEUED | TRANS_RUNNING);
+ m2m_dev->curr_ctx->job_flags |= TRANS_ABORT;
+ wake_up(&m2m_dev->curr_ctx->finished);
+ m2m_dev->curr_ctx = NULL;
+
+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
+}
+EXPORT_SYMBOL(v4l2_m2m_job_pause);
+
+void v4l2_m2m_job_resume(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&m2m_dev->job_spinlock, flags);
+ m2m_ctx->job_flags &= ~TRANS_ABORT;
+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
+
+ v4l2_m2m_try_schedule(m2m_ctx);
+ v4l2_m2m_try_run(m2m_dev);
+}
+EXPORT_SYMBOL(v4l2_m2m_job_resume);
+
int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
struct v4l2_requestbuffers *reqbufs)
{
diff -ur a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
--- a/include/media/v4l2-mem2mem.h 2019-07-10 23:44:45.000000000 +0100
+++ b/include/media/v4l2-mem2mem.h 2019-12-18 04:54:31.579097310 +0000
@@ -573,6 +573,24 @@
return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx);
}
+/*
+ * v4l2_m2m_job_pause() - paused the schedule of data which from the job queue.
+ *
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
+ * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
+ */
+void v4l2_m2m_job_pause(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx);
+
+ /*
+ * v4l2_m2m_job_resume() - resumed the schedule of data which from the job que.
+ *
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
+ * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
+ */
+void v4l2_m2m_job_resume(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx);
+
/**
* v4l2_m2m_buf_remove_by_buf() - take off exact buffer from the list of ready
* buffers

View file

@ -1,746 +0,0 @@
From: Brad Love <brad@nextdimension.cc>
https://git.linuxtv.org/brad/media_tree.git/log/?h=Montage-3103b.v2
support for m88ds3103b
diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index 3a367a5..0d3b81d 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -64,6 +64,92 @@ err:
return ret;
}
+/*
+ * m88ds3103b demod has an internal device related to clocking. First the i2c
+ * gate must be opened, for one transaction, then writes will be allowed.
+ */
+static int m88ds3103b_dt_write(struct m88ds3103_dev *dev, int reg, int data)
+{
+ struct i2c_client *client = dev->client;
+ u8 buf[] = {reg, data};
+ u8 val;
+ int ret;
+ struct i2c_msg msg = {
+ .addr = dev->dt_addr, .flags = 0, .buf = buf, .len = 2
+ };
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x00);
+
+ val = 0x11;
+ ret = regmap_write(dev->regmap, 0x03, val);
+ if (ret)
+ dev_dbg(&client->dev, "fail=%d\n", ret);
+
+ ret = i2c_transfer(dev->client->adapter, &msg, 1);
+ if (ret != 1) {
+ dev_dbg(&client->dev, "0x%02x (ret=%i, reg=0x%02x, value=0x%02x)\n",
+ dev->dt_addr, ret, reg, data);
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+ return -EREMOTEIO;
+ }
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ dev_dbg(&client->dev, "0x%02x reg 0x%02x, value 0x%02x\n",
+ dev->dt_addr, reg, data);
+
+ return 0;
+}
+
+/*
+ * m88ds3103b demod has an internal device related to clocking. First the i2c
+ * gate must be opened, for two transactions, then reads will be allowed.
+ */
+static int m88ds3103b_dt_read(struct m88ds3103_dev *dev, u8 reg)
+{
+ struct i2c_client *client = dev->client;
+ int ret;
+ u8 val;
+ u8 b0[] = { reg };
+ u8 b1[] = { 0 };
+ struct i2c_msg msg[] = {
+ {
+ .addr = dev->dt_addr,
+ .flags = 0,
+ .buf = b0,
+ .len = 1
+ },
+ {
+ .addr = dev->dt_addr,
+ .flags = I2C_M_RD,
+ .buf = b1,
+ .len = 1
+ }
+ };
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x00);
+
+ val = 0x12;
+ ret = regmap_write(dev->regmap, 0x03, val);
+ if (ret)
+ dev_dbg(&client->dev, "fail=%d\n", ret);
+
+ ret = i2c_transfer(dev->client->adapter, msg, 2);
+ if (ret != 2) {
+ dev_dbg(&client->dev, "0x%02x (err=%d, reg=0x%02x)\n",
+ dev->dt_addr, ret, reg);
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+ return -EREMOTEIO;
+ }
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ dev_dbg(&client->dev, "0x%02x reg 0x%02x, value 0x%02x\n",
+ dev->dt_addr, reg, b1[0]);
+
+ return b1[0];
+}
+
/*
* Get the demodulator AGC PWM voltage setting supplied to the tuner.
*/
@@ -288,6 +374,253 @@ err:
return ret;
}
+static int m88ds3103b_select_mclk(struct m88ds3103_dev *dev)
+{
+ struct i2c_client *client = dev->client;
+ struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache;
+ u32 adc_Freq_MHz[3] = {96, 93, 99};
+ u8 reg16_list[3] = {96, 92, 100}, reg16, reg15;
+ u32 offset_MHz[3];
+ u32 max_offset = 0;
+ u32 old_setting = dev->mclk;
+ u32 tuner_freq_MHz = c->frequency / 1000;
+ u8 i;
+ char big_symbol = 0;
+
+ big_symbol = (c->symbol_rate > 45010000) ? 1 : 0;
+
+ if (big_symbol) {
+ reg16 = 115;
+ } else {
+ reg16 = 96;
+
+ /* TODO: IS THIS NECESSARY ? */
+ for (i = 0; i < 3; i++) {
+ offset_MHz[i] = tuner_freq_MHz % adc_Freq_MHz[i];
+
+ if (offset_MHz[i] > (adc_Freq_MHz[i] / 2))
+ offset_MHz[i] = adc_Freq_MHz[i] - offset_MHz[i];
+
+ if (offset_MHz[i] > max_offset) {
+ max_offset = offset_MHz[i];
+ reg16 = reg16_list[i];
+ dev->mclk = adc_Freq_MHz[i] * 1000 * 1000;
+
+ if (big_symbol)
+ dev->mclk /= 2;
+
+ dev_dbg(&client->dev, "modifying mclk %u -> %u\n",
+ old_setting, dev->mclk);
+ }
+ }
+ }
+
+ if (dev->mclk == 93000000)
+ regmap_write(dev->regmap, 0xA0, 0x42);
+ else if (dev->mclk == 96000000)
+ regmap_write(dev->regmap, 0xA0, 0x44);
+ else if (dev->mclk == 99000000)
+ regmap_write(dev->regmap, 0xA0, 0x46);
+ else if (dev->mclk == 110250000)
+ regmap_write(dev->regmap, 0xA0, 0x4E);
+ else
+ regmap_write(dev->regmap, 0xA0, 0x44);
+
+ reg15 = m88ds3103b_dt_read(dev, 0x15);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x40);
+ m88ds3103b_dt_write(dev, 0x11, 0x08);
+
+ if (big_symbol)
+ reg15 |= 0x02;
+ else
+ reg15 &= ~0x02;
+
+ m88ds3103b_dt_write(dev, 0x15, reg15);
+ m88ds3103b_dt_write(dev, 0x16, reg16);
+
+ usleep_range(5000, 5500);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x00);
+ m88ds3103b_dt_write(dev, 0x11, (u8)(big_symbol ? 0x0E : 0x0A));
+
+ usleep_range(5000, 5500);
+
+ return 0;
+}
+
+static int m88ds3103b_set_mclk(struct m88ds3103_dev *dev, u32 mclk_khz)
+{
+ u8 reg11 = 0x0A, reg15, reg16, reg1D, reg1E, reg1F, tmp;
+ u8 sm, f0 = 0, f1 = 0, f2 = 0, f3 = 0, pll_ldpc_mode;
+ u16 pll_div_fb, N;
+ u32 div;
+
+ reg15 = m88ds3103b_dt_read(dev, 0x15);
+ reg16 = m88ds3103b_dt_read(dev, 0x16);
+ reg1D = m88ds3103b_dt_read(dev, 0x1D);
+
+ if (dev->cfg->ts_mode != M88DS3103_TS_SERIAL) {
+ if (reg16 == 92)
+ tmp = 93;
+ else if (reg16 == 100)
+ tmp = 99;
+ else
+ tmp = 96;
+
+ mclk_khz *= tmp;
+ mclk_khz /= 96;
+ }
+
+ pll_ldpc_mode = (reg15 >> 1) & 0x01;
+
+ pll_div_fb = (reg15 & 0x01) << 8;
+ pll_div_fb += reg16;
+ pll_div_fb += 32;
+
+ div = 9000 * pll_div_fb * 4;
+ div /= mclk_khz;
+
+ if (dev->cfg->ts_mode == M88DS3103_TS_SERIAL) {
+ reg11 |= 0x02;
+
+ if (div <= 32) {
+ N = 2;
+
+ f0 = 0;
+ f1 = div / N;
+ f2 = div - f1;
+ f3 = 0;
+ } else if (div <= 34) {
+ N = 3;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = div - f0 - f1;
+ f3 = 0;
+ } else if (div <= 64) {
+ N = 4;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = (div - f0 - f1) / (N - 2);
+ f3 = div - f0 - f1 - f2;
+ } else {
+ N = 4;
+
+ f0 = 16;
+ f1 = 16;
+ f2 = 16;
+ f3 = 16;
+ }
+
+ if (f0 == 16)
+ f0 = 0;
+ else if ((f0 < 8) && (f0 != 0))
+ f0 = 8;
+
+ if (f1 == 16)
+ f1 = 0;
+ else if ((f1 < 8) && (f1 != 0))
+ f1 = 8;
+
+ if (f2 == 16)
+ f2 = 0;
+ else if ((f2 < 8) && (f2 != 0))
+ f2 = 8;
+
+ if (f3 == 16)
+ f3 = 0;
+ else if ((f3 < 8) && (f3 != 0))
+ f3 = 8;
+ } else {
+ reg11 &= ~0x02;
+
+ if (div <= 32) {
+ N = 2;
+
+ f0 = 0;
+ f1 = div / N;
+ f2 = div - f1;
+ f3 = 0;
+ } else if (div <= 48) {
+ N = 3;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = div - f0 - f1;
+ f3 = 0;
+ } else if (div <= 64) {
+ N = 4;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = (div - f0 - f1) / (N - 2);
+ f3 = div - f0 - f1 - f2;
+ } else {
+ N = 4;
+
+ f0 = 16;
+ f1 = 16;
+ f2 = 16;
+ f3 = 16;
+ }
+
+ if (f0 == 16)
+ f0 = 0;
+ else if ((f0 < 9) && (f0 != 0))
+ f0 = 9;
+
+ if (f1 == 16)
+ f1 = 0;
+ else if ((f1 < 9) && (f1 != 0))
+ f1 = 9;
+
+ if (f2 == 16)
+ f2 = 0;
+ else if ((f2 < 9) && (f2 != 0))
+ f2 = 9;
+
+ if (f3 == 16)
+ f3 = 0;
+ else if ((f3 < 9) && (f3 != 0))
+ f3 = 9;
+ }
+
+ sm = N - 1;
+
+ /* Write to registers */
+ //reg15 &= 0x01;
+ //reg15 |= (pll_div_fb >> 8) & 0x01;
+
+ //reg16 = pll_div_fb & 0xFF;
+
+ reg1D &= ~0x03;
+ reg1D |= sm;
+ reg1D |= 0x80;
+
+ reg1E = ((f3 << 4) + f2) & 0xFF;
+ reg1F = ((f1 << 4) + f0) & 0xFF;
+
+ m88ds3103b_dt_write(dev, 0x05, 0x40);
+ m88ds3103b_dt_write(dev, 0x11, 0x08);
+ m88ds3103b_dt_write(dev, 0x1D, reg1D);
+ m88ds3103b_dt_write(dev, 0x1E, reg1E);
+ m88ds3103b_dt_write(dev, 0x1F, reg1F);
+
+ m88ds3103b_dt_write(dev, 0x17, 0xc1);
+ m88ds3103b_dt_write(dev, 0x17, 0x81);
+
+ usleep_range(5000, 5500);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x00);
+ m88ds3103b_dt_write(dev, 0x11, 0x0A);
+
+ usleep_range(5000, 5500);
+
+ return 0;
+}
+
static int m88ds3103_set_frontend(struct dvb_frontend *fe)
{
struct m88ds3103_dev *dev = fe->demodulator_priv;
@@ -298,7 +631,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u8 u8tmp, u8tmp1 = 0, u8tmp2 = 0; /* silence compiler warning */
u8 buf[3];
u16 u16tmp;
- u32 tuner_frequency_khz, target_mclk;
+ u32 tuner_frequency_khz, target_mclk, u32tmp;
s32 s32tmp;
static const struct reg_sequence reset_buf[] = {
{0x07, 0x80}, {0x07, 0x00}
@@ -321,6 +654,20 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
/* Disable demod clock path */
if (dev->chip_id == M88RS6000_CHIP_ID) {
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ ret = regmap_read(dev->regmap, 0xb2, &u32tmp);
+ if (ret)
+ goto err;
+ if (u32tmp == 0x01) {
+ ret = regmap_write(dev->regmap, 0x00, 0x00);
+ if (ret)
+ goto err;
+ ret = regmap_write(dev->regmap, 0xb2, 0x00);
+ if (ret)
+ goto err;
+ }
+ }
+
ret = regmap_write(dev->regmap, 0x06, 0xe0);
if (ret)
goto err;
@@ -346,7 +693,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
tuner_frequency_khz = c->frequency;
}
- /* select M88RS6000 demod main mclk and ts mclk from tuner die. */
+ /* set M88RS6000/DS3103B demod main mclk and ts mclk from tuner die */
if (dev->chip_id == M88RS6000_CHIP_ID) {
if (c->symbol_rate > 45010000)
dev->mclk = 110250000;
@@ -358,6 +705,11 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
else
target_mclk = 144000000;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ m88ds3103b_select_mclk(dev);
+ m88ds3103b_set_mclk(dev, target_mclk / 1000);
+ }
+
/* Enable demod clock path */
ret = regmap_write(dev->regmap, 0x06, 0x00);
if (ret)
@@ -469,12 +821,42 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
ret = m88ds3103_update_bits(dev, 0x9d, 0x08, 0x08);
if (ret)
goto err;
+
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ buf[0] = m88ds3103b_dt_read(dev, 0x15);
+ buf[1] = m88ds3103b_dt_read(dev, 0x16);
+
+ if (c->symbol_rate > 45010000) {
+ buf[0] &= ~0x03;
+ buf[0] |= 0x02;
+ buf[0] |= ((147 - 32) >> 8) & 0x01;
+ buf[1] = (147 - 32) & 0xFF;
+
+ dev->mclk = 110250 * 1000;
+ } else {
+ buf[0] &= ~0x03;
+ buf[0] |= ((128 - 32) >> 8) & 0x01;
+ buf[1] = (128 - 32) & 0xFF;
+
+ dev->mclk = 96000 * 1000;
+ }
+ m88ds3103b_dt_write(dev, 0x15, buf[0]);
+ m88ds3103b_dt_write(dev, 0x16, buf[1]);
+
+ regmap_read(dev->regmap, 0x30, &u32tmp);
+ u32tmp &= ~0x80;
+ regmap_write(dev->regmap, 0x30, u32tmp & 0xff);
+ }
+
ret = regmap_write(dev->regmap, 0xf1, 0x01);
if (ret)
goto err;
- ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
- if (ret)
- goto err;
+
+ if (dev->chiptype != M88DS3103_CHIPTYPE_3103B) {
+ ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
+ if (ret)
+ goto err;
+ }
}
switch (dev->cfg->ts_mode) {
@@ -488,6 +870,10 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
break;
case M88DS3103_TS_PARALLEL:
u8tmp = 0x02;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ u8tmp = 0x01;
+ u8tmp1 = 0x01;
+ }
break;
case M88DS3103_TS_CI:
u8tmp = 0x03;
@@ -516,6 +902,12 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u8tmp1 = 0x3f;
u8tmp2 = 0x3f;
break;
+ case M88DS3103_TS_PARALLEL:
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ ret = m88ds3103_update_bits(dev, 0x29, 0x01, u8tmp1);
+ if (ret)
+ goto err;
+ }
default:
u16tmp = DIV_ROUND_UP(target_mclk, dev->cfg->ts_clk);
u8tmp1 = u16tmp / 2 - 1;
@@ -543,6 +935,9 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
else
u8tmp = 0x06;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B)
+ m88ds3103b_set_mclk(dev, target_mclk / 1000);
+
ret = regmap_write(dev->regmap, 0xc3, 0x08);
if (ret)
goto err;
@@ -578,6 +973,16 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
if (ret)
goto err;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ /* enable/disable 192M LDPC clock */
+ ret = m88ds3103_update_bits(dev, 0x29, 0x10,
+ (c->delivery_system == SYS_DVBS) ? 0x10 : 0x0);
+ if (ret)
+ goto err;
+
+ ret = m88ds3103_update_bits(dev, 0xc9, 0x08, 0x08);
+ }
+
dev_dbg(&client->dev, "carrier offset=%d\n",
(tuner_frequency_khz - c->frequency));
@@ -654,10 +1059,13 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_info(&client->dev, "found a '%s' in cold state\n",
m88ds3103_ops.info.name);
- if (dev->chip_id == M88RS6000_CHIP_ID)
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B)
+ name = M88DS3103B_FIRMWARE;
+ else if (dev->chip_id == M88RS6000_CHIP_ID)
name = M88RS6000_FIRMWARE;
else
name = M88DS3103_FIRMWARE;
+
/* request the firmware, this will block and timeout */
ret = request_firmware(&firmware, name, &client->dev);
if (ret) {
@@ -704,6 +1112,12 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_info(&client->dev, "firmware version: %X.%X\n",
(utmp >> 4) & 0xf, (utmp >> 0 & 0xf));
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ m88ds3103b_dt_write(dev, 0x21, 0x92);
+ m88ds3103b_dt_write(dev, 0x15, 0x6C);
+ m88ds3103b_dt_write(dev, 0x17, 0xC1);
+ m88ds3103b_dt_write(dev, 0x17, 0x81);
+ }
warm:
/* warm state */
dev->warm = true;
@@ -1393,6 +1807,8 @@ static int m88ds3103_probe(struct i2c_client *client,
goto err_kfree;
dev->chip_id = utmp >> 1;
+ dev->chiptype = (u8)id->driver_data;
+
dev_dbg(&client->dev, "chip_id=%02x\n", dev->chip_id);
switch (dev->chip_id) {
@@ -1470,6 +1886,19 @@ static int m88ds3103_probe(struct i2c_client *client,
/* setup callbacks */
pdata->get_dvb_frontend = m88ds3103_get_dvb_frontend;
pdata->get_i2c_adapter = m88ds3103_get_i2c_adapter;
+
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ /* enable i2c repeater for tuner */
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ /* get frontend address */
+ ret = regmap_read(dev->regmap, 0x29, &utmp);
+ if (ret)
+ goto err_kfree;
+ dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
+ dev_err(&client->dev, "dt addr is 0x%02x", dev->dt_addr);
+ }
+
return 0;
err_kfree:
kfree(dev);
@@ -1491,7 +1920,9 @@ static int m88ds3103_remove(struct i2c_client *client)
}
static const struct i2c_device_id m88ds3103_id_table[] = {
- {"m88ds3103", 0},
+ {"m88ds3103", M88DS3103_CHIPTYPE_3103},
+ {"m88rs6000", M88DS3103_CHIPTYPE_RS6000},
+ {"m88ds3103b", M88DS3103_CHIPTYPE_3103B},
{}
};
MODULE_DEVICE_TABLE(i2c, m88ds3103_id_table);
@@ -1513,3 +1944,4 @@ MODULE_DESCRIPTION("Montage Technology M88DS3103 DVB-S/S2 demodulator driver");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(M88DS3103_FIRMWARE);
MODULE_FIRMWARE(M88RS6000_FIRMWARE);
+MODULE_FIRMWARE(M88DS3103B_FIRMWARE);
diff --git a/drivers/media/dvb-frontends/m88ds3103_priv.h b/drivers/media/dvb-frontends/m88ds3103_priv.h
index c825032..d656ec2 100644
--- a/drivers/media/dvb-frontends/m88ds3103_priv.h
+++ b/drivers/media/dvb-frontends/m88ds3103_priv.h
@@ -16,11 +16,17 @@
#include <linux/regmap.h>
#include <linux/math64.h>
-#define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
-#define M88RS6000_FIRMWARE "dvb-demod-m88rs6000.fw"
+#define M88DS3103B_FIRMWARE "dvb-demod-m88ds3103b.fw"
+#define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
+#define M88RS6000_FIRMWARE "dvb-demod-m88rs6000.fw"
+
#define M88RS6000_CHIP_ID 0x74
#define M88DS3103_CHIP_ID 0x70
+#define M88DS3103_CHIPTYPE_3103 0
+#define M88DS3103_CHIPTYPE_RS6000 1
+#define M88DS3103_CHIPTYPE_3103B 2
+
struct m88ds3103_dev {
struct i2c_client *client;
struct regmap_config regmap_config;
@@ -35,10 +41,13 @@ struct m88ds3103_dev {
struct i2c_mux_core *muxc;
/* auto detect chip id to do different config */
u8 chip_id;
+ /* chip type to differentiate m88rs6000 from m88ds3103b */
+ u8 chiptype;
/* main mclk is calculated for M88RS6000 dynamically */
s32 mclk;
u64 post_bit_error;
u64 post_bit_count;
+ u8 dt_addr;
};
struct m88ds3103_reg_val {
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 1283c7c..6561f7b 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2397,6 +2397,20 @@ const struct em28xx_board em28xx_boards[] = {
.has_dvb = 1,
.ir_codes = RC_MAP_PINNACLE_PCTV_HD,
},
+ /*
+ * 2013:0259 PCTV DVB-S2 Stick (461e_v2)
+ * Empia EM28178, Montage M88DS3103b, Montage M88TS2022, Allegro A8293
+ */
+ [EM28178_BOARD_PCTV_461E_V2] = {
+ .def_i2c_bus = 1,
+ .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
+ EM28XX_I2C_FREQ_400_KHZ,
+ .name = "PCTV DVB-S2 Stick (461e v2)",
+ .tuner_type = TUNER_ABSENT,
+ .tuner_gpio = pctv_461e,
+ .has_dvb = 1,
+ .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
+ },
/*
* 2013:025f PCTV tripleStick (292e).
* Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157
@@ -2678,6 +2692,10 @@ struct usb_device_id em28xx_id_table[] = {
.driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
{ USB_DEVICE(0x2013, 0x0258),
.driver_info = EM28178_BOARD_PCTV_461E },
+ { USB_DEVICE(0x2013, 0x0461),
+ .driver_info = EM28178_BOARD_PCTV_461E_V2 },
+ { USB_DEVICE(0x2013, 0x0259),
+ .driver_info = EM28178_BOARD_PCTV_461E_V2 },
{ USB_DEVICE(0x2013, 0x025f),
.driver_info = EM28178_BOARD_PCTV_292E },
{ USB_DEVICE(0x2013, 0x0264), /* Hauppauge WinTV-soloHD 292e SE */
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a73faf1..e2ddc25 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1219,6 +1219,65 @@ static int em28178_dvb_init_pctv_461e(struct em28xx *dev)
return 0;
}
+static int em28178_dvb_init_pctv_461e_v2(struct em28xx *dev)
+{
+ struct em28xx_dvb *dvb = dev->dvb;
+ struct i2c_adapter *i2c_adapter;
+ struct m88ds3103_platform_data m88ds3103_pdata = {};
+ struct ts2020_config ts2020_config = {};
+ struct a8293_platform_data a8293_pdata = {};
+
+ /* attach demod */
+ m88ds3103_pdata.clk = 27000000;
+ m88ds3103_pdata.i2c_wr_max = 33;
+ m88ds3103_pdata.ts_mode = M88DS3103_TS_PARALLEL;
+ m88ds3103_pdata.ts_clk = 16000;
+ m88ds3103_pdata.ts_clk_pol = 1;
+ m88ds3103_pdata.agc = 0x99;
+ m88ds3103_pdata.agc_inv = 1;
+ m88ds3103_pdata.spec_inv = 1;
+ dvb->i2c_client_demod = dvb_module_probe("m88ds3103", "m88ds3103b",
+ &dev->i2c_adap[dev->def_i2c_bus],
+ 0x6a, &m88ds3103_pdata);
+
+ if (!dvb->i2c_client_demod) {
+ pr_err("%s() FUCK\n", __func__);
+ return -ENODEV;
+ }
+
+ dvb->fe[0] = m88ds3103_pdata.get_dvb_frontend(dvb->i2c_client_demod);
+ i2c_adapter = m88ds3103_pdata.get_i2c_adapter(dvb->i2c_client_demod);
+
+ /* attach tuner */
+ ts2020_config.fe = dvb->fe[0];
+ dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022",
+ i2c_adapter,
+ 0x60, &ts2020_config);
+ if (!dvb->i2c_client_tuner) {
+ pr_err("%s() FUCK2\n", __func__);
+ dvb_module_release(dvb->i2c_client_demod);
+ return -ENODEV;
+ }
+
+ /* delegate signal strength measurement to tuner */
+ dvb->fe[0]->ops.read_signal_strength =
+ dvb->fe[0]->ops.tuner_ops.get_rf_strength;
+
+ /* attach SEC */
+ a8293_pdata.dvb_frontend = dvb->fe[0];
+ dvb->i2c_client_sec = dvb_module_probe("a8293", NULL,
+ &dev->i2c_adap[dev->def_i2c_bus],
+ 0x08, &a8293_pdata);
+ if (!dvb->i2c_client_sec) {
+ pr_err("%s() FUCK3\n", __func__);
+ dvb_module_release(dvb->i2c_client_tuner);
+ dvb_module_release(dvb->i2c_client_demod);
+ return -ENODEV;
+ }
+
+ return 0;
+}
+
static int em28178_dvb_init_pctv_292e(struct em28xx *dev)
{
struct em28xx_dvb *dvb = dev->dvb;
@@ -1860,6 +1919,11 @@ static int em28xx_dvb_init(struct em28xx *dev)
if (result)
goto out_free;
break;
+ case EM28178_BOARD_PCTV_461E_V2:
+ result = em28178_dvb_init_pctv_461e_v2(dev);
+ if (result)
+ goto out_free;
+ break;
case EM28178_BOARD_PCTV_292E:
result = em28178_dvb_init_pctv_292e(dev);
if (result)
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h
index a551072..1affdd1 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -149,6 +149,7 @@
#define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 100
#define EM2884_BOARD_TERRATEC_H6 101
#define EM2882_BOARD_ZOLID_HYBRID_TV_STICK 102
+#define EM28178_BOARD_PCTV_461E_V2 103
/* Limits minimum and default number of buffers */
#define EM28XX_MIN_BUF 4
--
2.17.1

View file

@ -1,217 +0,0 @@
From: Thomas Hollstegge <thomas.hollstegge@gmail.com>
[v3] media: dvbsky: Add support for MyGica T230C v2
https://lore.kernel.org/patchwork/cover/904817/
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 4d43424..3402b96 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -96,13 +96,15 @@ static int si2168_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
dev_dbg(&client->dev, "%s acquire: %d\n", __func__, acquire);
/* set TS_MODE property */
- memcpy(cmd.args, "\x14\x00\x01\x10\x10\x00", 6);
+ memcpy(cmd.args, "\x14\x00\x01\x10\x00\x00", 6);
if (acquire)
cmd.args[4] |= dev->ts_mode;
else
cmd.args[4] |= SI2168_TS_TRISTATE;
if (dev->ts_clock_gapped)
cmd.args[4] |= 0x40;
+ cmd.args[4] |= (dev->ts_clock_mode & 0x03) << 4;
+
cmd.wlen = 6;
cmd.rlen = 4;
ret = si2168_cmd_execute(client, &cmd);
@@ -644,6 +646,18 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
if (ret)
goto err;
+ /* set TS frequency */
+ if (dev->ts_clock_freq) {
+ memcpy(cmd.args, "\x14\x00\x0d\x10", 4);
+ cmd.args[4] = ((dev->ts_clock_freq / 10000) >> 0) & 0xff;
+ cmd.args[5] = ((dev->ts_clock_freq / 10000) >> 8) & 0xff;
+ cmd.wlen = 6;
+ cmd.rlen = 4;
+ ret = si2168_cmd_execute(client, &cmd);
+ if (ret)
+ goto err;
+ }
+
memcpy(cmd.args, "\x14\x00\x08\x10\xd7\x05", 6);
cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10;
cmd.wlen = 6;
@@ -1057,6 +1071,10 @@ static int si2168_probe(struct i2c_client *client,
dev->ts_mode = config->ts_mode;
dev->ts_clock_inv = config->ts_clock_inv;
dev->ts_clock_gapped = config->ts_clock_gapped;
+ dev->ts_clock_mode = config->ts_clock_mode;
+ if (dev->ts_clock_mode == 0)
+ dev->ts_clock_mode = SI2168_TS_CLOCK_MODE_AUTO_ADAPT;
+ dev->ts_clock_freq = config->ts_clock_freq;
dev->spectral_inversion = config->spectral_inversion;
dev_info(&client->dev, "Silicon Labs Si2168-%c%d%d successfully identified\n",
diff --git a/drivers/media/dvb-frontends/si2168.h b/drivers/media/dvb-frontends/si2168.h
index d519edd..3f52ee8 100644
--- a/drivers/media/dvb-frontends/si2168.h
+++ b/drivers/media/dvb-frontends/si2168.h
@@ -47,6 +47,14 @@ struct si2168_config {
/* TS clock gapped */
bool ts_clock_gapped;
+ /* TS clock mode */
+#define SI2168_TS_CLOCK_MODE_AUTO_ADAPT 0x01
+#define SI2168_TS_CLOCK_MODE_MANUAL 0x02
+ u8 ts_clock_mode;
+
+ /* TS clock frequency (for manual mode) */
+ u32 ts_clock_freq;
+
/* Inverted spectrum */
bool spectral_inversion;
};
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h
index 2d362e1..8173d6c 100644
--- a/drivers/media/dvb-frontends/si2168_priv.h
+++ b/drivers/media/dvb-frontends/si2168_priv.h
@@ -48,6 +48,8 @@ struct si2168_dev {
u8 ts_mode;
bool ts_clock_inv;
bool ts_clock_gapped;
+ u8 ts_clock_mode;
+ u32 ts_clock_freq;
bool spectral_inversion;
};
diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c
index e28bd88..4a4c6ae 100644
--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c
+++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c
@@ -583,6 +583,66 @@ static int dvbsky_mygica_t230c_attach(struct dvb_usb_adapter *adap)
return 0;
}
+static int dvbsky_mygica_t230c_v2_attach(struct dvb_usb_adapter *adap)
+{
+ struct dvbsky_state *state = adap_to_priv(adap);
+ struct dvb_usb_device *d = adap_to_d(adap);
+ struct i2c_adapter *i2c_adapter;
+ struct i2c_client *client_demod, *client_tuner;
+ struct i2c_board_info info;
+ struct si2168_config si2168_config;
+ struct si2157_config si2157_config;
+
+ /* attach demod */
+ memset(&si2168_config, 0, sizeof(si2168_config));
+ si2168_config.i2c_adapter = &i2c_adapter;
+ si2168_config.fe = &adap->fe[0];
+ si2168_config.ts_mode = SI2168_TS_PARALLEL;
+ si2168_config.ts_clock_inv = 1;
+ si2168_config.ts_clock_mode = SI2168_TS_CLOCK_MODE_MANUAL;
+ si2168_config.ts_clock_freq = 10000000;
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ strlcpy(info.type, "si2168", sizeof(info.type));
+ info.addr = 0x64;
+ info.platform_data = &si2168_config;
+
+ request_module("si2168");
+ client_demod = i2c_new_device(&d->i2c_adap, &info);
+ if (!client_demod || !client_demod->dev.driver)
+ goto fail_demod_device;
+ if (!try_module_get(client_demod->dev.driver->owner))
+ goto fail_demod_module;
+
+ /* attach tuner */
+ memset(&si2157_config, 0, sizeof(si2157_config));
+ si2157_config.fe = adap->fe[0];
+ si2157_config.if_port = 0;
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ strlcpy(info.type, "si2141", sizeof(info.type));
+ info.addr = 0x60;
+ info.platform_data = &si2157_config;
+
+ request_module("si2157");
+ client_tuner = i2c_new_device(i2c_adapter, &info);
+ if (!client_tuner || !client_tuner->dev.driver)
+ goto fail_tuner_device;
+ if (!try_module_get(client_tuner->dev.driver->owner))
+ goto fail_tuner_module;
+
+ state->i2c_client_demod = client_demod;
+ state->i2c_client_tuner = client_tuner;
+ return 0;
+
+fail_tuner_module:
+ i2c_unregister_device(client_tuner);
+fail_tuner_device:
+ module_put(client_demod->dev.driver->owner);
+fail_demod_module:
+ i2c_unregister_device(client_demod);
+fail_demod_device:
+ return -ENODEV;
+}
+
static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name)
{
@@ -762,6 +822,33 @@ static struct dvb_usb_device_properties mygica_t230c_props = {
}
};
+static struct dvb_usb_device_properties mygica_t230c_v2_props = {
+ .driver_name = KBUILD_MODNAME,
+ .owner = THIS_MODULE,
+ .adapter_nr = adapter_nr,
+ .size_of_priv = sizeof(struct dvbsky_state),
+
+ .generic_bulk_ctrl_endpoint = 0x01,
+ .generic_bulk_ctrl_endpoint_response = 0x81,
+ .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY,
+
+ .i2c_algo = &dvbsky_i2c_algo,
+ .frontend_attach = dvbsky_mygica_t230c_v2_attach,
+ .init = dvbsky_init,
+ .get_rc_config = dvbsky_get_rc_config,
+ .streaming_ctrl = dvbsky_streaming_ctrl,
+ .identify_state = dvbsky_identify_state,
+ .exit = dvbsky_exit,
+
+ .num_adapters = 1,
+ .adapter = {
+ {
+ .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096),
+ }
+ }
+};
+
+
static const struct usb_device_id dvbsky_id_table[] = {
{ DVB_USB_DEVICE(0x0572, 0x6831,
&dvbsky_s960_props, "DVBSky S960/S860", RC_MAP_DVBSKY) },
@@ -797,6 +884,9 @@ static const struct usb_device_id dvbsky_id_table[] = {
{ DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C,
&mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C",
RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
+ { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C_V2,
+ &mygica_t230c_v2_props, "MyGica Mini DVB-T2 USB Stick T230C v2",
+ RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
{ }
};
MODULE_DEVICE_TABLE(usb, dvbsky_id_table);
diff --git a/include/media/dvb-usb-ids.h b/include/media/dvb-usb-ids.h
index f9e73b4..d606248 100644
--- a/include/media/dvb-usb-ids.h
+++ b/include/media/dvb-usb-ids.h
@@ -387,6 +387,7 @@
#define USB_PID_MYGICA_D689 0xd811
#define USB_PID_MYGICA_T230 0xc688
#define USB_PID_MYGICA_T230C 0xc689
+#define USB_PID_MYGICA_T230C_V2 0xc68a
#define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011
#define USB_PID_ELGATO_EYETV_DTT 0x0021
#define USB_PID_ELGATO_EYETV_DTT_2 0x003f
--
2.17.1

View file

@ -1,140 +0,0 @@
From d8e559ad66feeffa31eb473a9c9bce51d0863079 Mon Sep 17 00:00:00 2001
From: alexelec <alexelecv5@gmail.com>
Date: Mon, 11 Feb 2019 11:09:50 +0200
Subject: [PATCH] dvb-core: fix blocking demux
---
drivers/media/dvb-core/dmxdev.c | 37 +++++++++++++++++++------
drivers/media/dvb-core/dvb_ringbuffer.c | 1 +
drivers/media/dvb-core/dvb_ringbuffer.h | 1 +
3 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index c0363f1b..da9ad1c8 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -82,7 +82,11 @@ static ssize_t dvb_dmxdev_buffer_read(struct dvb_ringbuffer *src,
ret = wait_event_interruptible(src->queue,
!dvb_ringbuffer_empty(src) ||
- (src->error != 0));
+ (src->error != 0) ||
+ (src->do_wait != 1));
+ if (src->do_wait != 1)
+ ret = -EINTR;
+
if (ret < 0)
break;
@@ -955,6 +959,23 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count,
return ret;
}
+
+static int dvb_demux_lock_filter(struct dmxdev_filter *dmxdevfilter)
+{
+ int ret;
+
+ dmxdevfilter->buffer.do_wait = 0;
+
+ if (waitqueue_active(&dmxdevfilter->buffer.queue))
+ wake_up(&dmxdevfilter->buffer.queue);
+
+ ret = mutex_lock_interruptible(&dmxdevfilter->mutex);
+
+ dmxdevfilter->buffer.do_wait = 1;
+
+ return ret;
+}
+
static int dvb_demux_do_ioctl(struct file *file,
unsigned int cmd, void *parg)
{
@@ -968,7 +989,7 @@ static int dvb_demux_do_ioctl(struct file *file,
switch (cmd) {
case DMX_START:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
mutex_unlock(&dmxdev->mutex);
return -ERESTARTSYS;
}
@@ -980,7 +1001,7 @@ static int dvb_demux_do_ioctl(struct file *file,
break;
case DMX_STOP:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
mutex_unlock(&dmxdev->mutex);
return -ERESTARTSYS;
}
@@ -989,7 +1010,7 @@ static int dvb_demux_do_ioctl(struct file *file,
break;
case DMX_SET_FILTER:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
mutex_unlock(&dmxdev->mutex);
return -ERESTARTSYS;
}
@@ -998,7 +1019,7 @@ static int dvb_demux_do_ioctl(struct file *file,
break;
case DMX_SET_PES_FILTER:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
mutex_unlock(&dmxdev->mutex);
return -ERESTARTSYS;
}
@@ -1007,7 +1028,7 @@ static int dvb_demux_do_ioctl(struct file *file,
break;
case DMX_SET_BUFFER_SIZE:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
mutex_unlock(&dmxdev->mutex);
return -ERESTARTSYS;
}
@@ -1051,7 +1072,7 @@ static int dvb_demux_do_ioctl(struct file *file,
break;
case DMX_ADD_PID:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
ret = -ERESTARTSYS;
break;
}
@@ -1060,7 +1081,7 @@ static int dvb_demux_do_ioctl(struct file *file,
break;
case DMX_REMOVE_PID:
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
+ if (dvb_demux_lock_filter(dmxdevfilter)) {
ret = -ERESTARTSYS;
break;
}
diff --git a/drivers/media/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb-core/dvb_ringbuffer.c
index a5712cd7..d5333f3a 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.c
+++ b/drivers/media/dvb-core/dvb_ringbuffer.c
@@ -45,6 +45,7 @@ void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len)
rbuf->data=data;
rbuf->size=len;
rbuf->error=0;
+ rbuf->do_wait=1;
init_waitqueue_head(&rbuf->queue);
diff --git a/include/media/dvb_ringbuffer.h b/include/media/dvb_ringbuffer.h
index 41f04dae..25a853b5 100644
--- a/include/media/dvb_ringbuffer.h
+++ b/include/media/dvb_ringbuffer.h
@@ -38,6 +38,7 @@ struct dvb_ringbuffer {
int error;
wait_queue_head_t queue;
+ int do_wait;
spinlock_t lock;
};

View file

@ -1,17 +0,0 @@
fix si2168 cmd timeout
Some Si2168 demodulator commands may take 130-140 ms
(DVB-T/T2 tuner MyGica T230C v2).
Details: https://github.com/CoreELEC/CoreELEC/pull/208
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -46,7 +46,7 @@ static int si2168_cmd_execute_unlocked(s
if (cmd->rlen) {
/* wait cmd execution terminate */
- #define TIMEOUT 70
+ #define TIMEOUT 200
timeout = jiffies + msecs_to_jiffies(TIMEOUT);
while (!time_after(jiffies, timeout)) {
ret = i2c_master_recv(client, cmd->args, cmd->rlen);

View file

@ -1,16 +0,0 @@
Fix compatibility with Si2141 tuner (e.g. MyGica T230C v2)
which needs a next command for proper initialization.
(Broken by media_tree-01-hauppauge.patch)
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -120,7 +120,7 @@ static int si2157_init(struct dvb_fronte
}
cmd.rlen = 1;
ret = si2157_cmd_execute(client, &cmd);
- if (ret)
+ if (ret && (dev->chiptype != SI2157_CHIPTYPE_SI2141 || ret != -EAGAIN))
goto err;
/* Si2141 needs a second command before it answers the revision query */

View file

@ -1,20 +0,0 @@
media: dvbsky: Avoid leaking dvb frontend
Source: https://git.linuxtv.org/media_tree.git/commit/drivers/media/usb/dvb-usb-v2?id=fdfa59cd63b184e1e96d51ff170fcac739bc6f6f
--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c
+++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c
@@ -834,11 +836,11 @@ static struct dvb_usb_device_properties mygica_t230c_v2_props = {
.i2c_algo = &dvbsky_i2c_algo,
.frontend_attach = dvbsky_mygica_t230c_v2_attach,
+ .frontend_detach = dvbsky_frontend_detach,
.init = dvbsky_init,
.get_rc_config = dvbsky_get_rc_config,
.streaming_ctrl = dvbsky_streaming_ctrl,
.identify_state = dvbsky_identify_state,
- .exit = dvbsky_exit,
.num_adapters = 1,
.adapter = {

View file

@ -1,215 +0,0 @@
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c 2019-06-15 02:14:51.909460692 +0200
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c 2019-06-15 02:14:55.029460692 +0200
@@ -1,4 +1,3 @@
-// SPDX-License-Identifier: GPL-2.0-only
/*
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
* Separated from fs stuff by Arnd Bergmann <arnd@arndb.de>
@@ -159,7 +158,7 @@
compat_caddr_t p;
u32 clipcount;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
copy_in_user(&p64->w, &p32->w, sizeof(p32->w)) ||
assign_in_user(&p64->field, &p32->field) ||
assign_in_user(&p64->chromakey, &p32->chromakey) ||
@@ -284,7 +283,7 @@
static int bufsize_v4l2_format(struct v4l2_format32 __user *p32, u32 *size)
{
- if (!access_ok(p32, sizeof(*p32)))
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)))
return -EFAULT;
return __bufsize_v4l2_format(p32, size);
}
@@ -336,7 +335,7 @@
struct v4l2_format32 __user *p32,
void __user *aux_buf, u32 aux_space)
{
- if (!access_ok(p32, sizeof(*p32)))
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)))
return -EFAULT;
return __get_v4l2_format32(p64, p32, aux_buf, aux_space);
}
@@ -344,7 +343,7 @@
static int bufsize_v4l2_create(struct v4l2_create_buffers32 __user *p32,
u32 *size)
{
- if (!access_ok(p32, sizeof(*p32)))
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)))
return -EFAULT;
return __bufsize_v4l2_format(&p32->format, size);
}
@@ -353,7 +352,7 @@
struct v4l2_create_buffers32 __user *p32,
void __user *aux_buf, u32 aux_space)
{
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
copy_in_user(p64, p32,
offsetof(struct v4l2_create_buffers32, format)))
return -EFAULT;
@@ -405,7 +404,7 @@
static int put_v4l2_format32(struct v4l2_format __user *p64,
struct v4l2_format32 __user *p32)
{
- if (!access_ok(p32, sizeof(*p32)))
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)))
return -EFAULT;
return __put_v4l2_format32(p64, p32);
}
@@ -413,7 +412,7 @@
static int put_v4l2_create32(struct v4l2_create_buffers __user *p64,
struct v4l2_create_buffers32 __user *p32)
{
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
copy_in_user(p32, p64,
offsetof(struct v4l2_create_buffers32, format)) ||
assign_in_user(&p32->capabilities, &p64->capabilities) ||
@@ -435,7 +434,7 @@
struct v4l2_standard32 __user *p32)
{
/* other fields are not set by the user, nor used by the driver */
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
assign_in_user(&p64->index, &p32->index))
return -EFAULT;
return 0;
@@ -444,7 +443,7 @@
static int put_v4l2_standard32(struct v4l2_standard __user *p64,
struct v4l2_standard32 __user *p32)
{
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
assign_in_user(&p32->index, &p64->index) ||
assign_in_user(&p32->id, &p64->id) ||
copy_in_user(p32->name, p64->name, sizeof(p32->name)) ||
@@ -561,7 +560,7 @@
u32 type;
u32 length;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
get_user(type, &p32->type) ||
get_user(length, &p32->length))
return -EFAULT;
@@ -594,7 +593,7 @@
compat_caddr_t p;
int ret;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
assign_in_user(&p64->index, &p32->index) ||
get_user(type, &p32->type) ||
put_user(type, &p64->type) ||
@@ -633,7 +632,7 @@
return -EFAULT;
uplane32 = compat_ptr(p);
- if (!access_ok(uplane32,
+ if (!access_ok(VERIFY_READ, uplane32,
num_planes * sizeof(*uplane32)))
return -EFAULT;
@@ -692,7 +691,7 @@
compat_caddr_t p;
int ret;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
assign_in_user(&p32->index, &p64->index) ||
get_user(type, &p64->type) ||
put_user(type, &p32->type) ||
@@ -782,7 +781,7 @@
{
compat_caddr_t tmp;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
get_user(tmp, &p32->base) ||
put_user_force(compat_ptr(tmp), &p64->base) ||
assign_in_user(&p64->capability, &p32->capability) ||
@@ -797,7 +796,7 @@
{
void *base;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
get_user(base, &p64->base) ||
put_user(ptr_to_compat((void __user *)base), &p32->base) ||
assign_in_user(&p32->capability, &p64->capability) ||
@@ -894,7 +893,7 @@
{
u32 count;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
get_user(count, &p32->count))
return -EFAULT;
if (count > V4L2_CID_MAX_CTRLS)
@@ -914,7 +913,7 @@
u32 n;
compat_caddr_t p;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
assign_in_user(&p64->which, &p32->which) ||
get_user(count, &p32->count) ||
put_user(count, &p64->count) ||
@@ -930,7 +929,7 @@
if (get_user(p, &p32->controls))
return -EFAULT;
ucontrols = compat_ptr(p);
- if (!access_ok(ucontrols, count * sizeof(*ucontrols)))
+ if (!access_ok(VERIFY_READ, ucontrols, count * sizeof(*ucontrols)))
return -EFAULT;
if (aux_space < count * sizeof(*kcontrols))
return -EFAULT;
@@ -980,7 +979,7 @@
* with __user causes smatch warnings, so instead declare it
* without __user and cast it as a userspace pointer where needed.
*/
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
assign_in_user(&p32->which, &p64->which) ||
get_user(count, &p64->count) ||
put_user(count, &p32->count) ||
@@ -995,7 +994,7 @@
if (get_user(p, &p32->controls))
return -EFAULT;
ucontrols = compat_ptr(p);
- if (!access_ok(ucontrols, count * sizeof(*ucontrols)))
+ if (!access_ok(VERIFY_WRITE, ucontrols, count * sizeof(*ucontrols)))
return -EFAULT;
for (n = 0; n < count; n++) {
@@ -1044,7 +1043,7 @@
static int put_v4l2_event32(struct v4l2_event __user *p64,
struct v4l2_event32 __user *p32)
{
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
assign_in_user(&p32->type, &p64->type) ||
copy_in_user(&p32->u, &p64->u, sizeof(p64->u)) ||
assign_in_user(&p32->pending, &p64->pending) ||
@@ -1070,7 +1069,7 @@
{
compat_uptr_t tmp;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_READ, p32, sizeof(*p32)) ||
assign_in_user(&p64->pad, &p32->pad) ||
assign_in_user(&p64->start_block, &p32->start_block) ||
assign_in_user_cast(&p64->blocks, &p32->blocks) ||
@@ -1086,7 +1085,7 @@
{
void *edid;
- if (!access_ok(p32, sizeof(*p32)) ||
+ if (!access_ok(VERIFY_WRITE, p32, sizeof(*p32)) ||
assign_in_user(&p32->pad, &p64->pad) ||
assign_in_user(&p32->start_block, &p64->start_block) ||
assign_in_user(&p32->blocks, &p64->blocks) ||

View file

@ -1,28 +0,0 @@
diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index 123f2a3..403f428 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -309,9 +309,6 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u16 u16tmp;
u32 tuner_frequency_khz, target_mclk;
s32 s32tmp;
- static const struct reg_sequence reset_buf[] = {
- {0x07, 0x80}, {0x07, 0x00}
- };
dev_dbg(&client->dev,
"delivery_system=%d modulation=%d frequency=%u symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n",
@@ -324,7 +321,11 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
}
/* reset */
+ ret = regmap_write(dev->regmap, 0x07, 0x80);
+ if (ret)
+ goto err;
+
+ ret = regmap_write(dev->regmap, 0x07, 0x00);
- ret = regmap_multi_reg_write(dev->regmap, reset_buf, 2);
if (ret)
goto err;

View file

@ -1,28 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="media_tree_aml"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/CoreELEC"
PKG_DEPENDS_TARGET="toolchain"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Source of Linux Kernel amlogic drivers to build with media_build."
PKG_TOOLCHAIN="manual"
case "$LINUX" in
amlogic-3.14)
PKG_VERSION="f9a4b158183866c589ee8c06ab740f41aa08fa66"
PKG_SHA256="ff629f20b39749e6523571409c74c38a27ba0101b0ffe2a1ecea3e4dafea6dd2"
PKG_URL="https://github.com/CoreELEC/media_tree_aml/archive/${PKG_VERSION}.tar.gz"
;;
amlogic-4.9)
PKG_VERSION="a87a02aa4cad4b5835f20ed756799f3a6a74f9af"
PKG_SHA256="c598e78a637963389699c157ccae92d2c158a55335570b2c2bdc5acef316b9b7"
PKG_URL="https://github.com/CoreELEC/media_tree_aml/archive/${PKG_VERSION}.tar.gz"
;;
esac
unpack() {
mkdir -p $PKG_BUILD/
tar -xf $SOURCES/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz -C $PKG_BUILD/../
}

View file

@ -1,34 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="media_tree_cc"
PKG_VERSION="2019-07-10"
PKG_SHA256="c1d4467a7771d4a3e3f80cdce7065b4a1a9b61a306f35586e4c198812661e883"
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_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Source of Linux Kernel media_tree subsystem to build with media_build."
PKG_TOOLCHAIN="manual"
case "$LINUX" in
amlogic-4.9)
PKG_PATCH_DIRS="amlogic-4.9"
;;
esac
unpack() {
mkdir -p $PKG_BUILD/
tar -xf $SOURCES/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2 -C $PKG_BUILD/
}
post_unpack() {
# 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
}

View file

@ -1,74 +0,0 @@
diff -ur a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c 2019-07-10 23:44:44.000000000 +0100
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c 2019-12-18 04:54:05.614904632 +0000
@@ -443,6 +443,42 @@
}
EXPORT_SYMBOL(v4l2_m2m_job_finish);
+void v4l2_m2m_job_pause(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&m2m_dev->job_spinlock, flags);
+ if (!m2m_dev->curr_ctx || m2m_dev->curr_ctx != m2m_ctx) {
+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
+ dprintk("Called by an instance not currently running\n");
+ return;
+ }
+
+ list_del(&m2m_dev->curr_ctx->queue);
+ m2m_dev->curr_ctx->job_flags &= ~(TRANS_QUEUED | TRANS_RUNNING);
+ m2m_dev->curr_ctx->job_flags |= TRANS_ABORT;
+ wake_up(&m2m_dev->curr_ctx->finished);
+ m2m_dev->curr_ctx = NULL;
+
+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
+}
+EXPORT_SYMBOL(v4l2_m2m_job_pause);
+
+void v4l2_m2m_job_resume(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&m2m_dev->job_spinlock, flags);
+ m2m_ctx->job_flags &= ~TRANS_ABORT;
+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
+
+ v4l2_m2m_try_schedule(m2m_ctx);
+ v4l2_m2m_try_run(m2m_dev);
+}
+EXPORT_SYMBOL(v4l2_m2m_job_resume);
+
int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
struct v4l2_requestbuffers *reqbufs)
{
diff -ur a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
--- a/include/media/v4l2-mem2mem.h 2019-07-10 23:44:45.000000000 +0100
+++ b/include/media/v4l2-mem2mem.h 2019-12-18 04:54:31.579097310 +0000
@@ -573,6 +573,24 @@
return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx);
}
+/*
+ * v4l2_m2m_job_pause() - paused the schedule of data which from the job queue.
+ *
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
+ * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
+ */
+void v4l2_m2m_job_pause(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx);
+
+ /*
+ * v4l2_m2m_job_resume() - resumed the schedule of data which from the job que.
+ *
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
+ * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
+ */
+void v4l2_m2m_job_resume(struct v4l2_m2m_dev *m2m_dev,
+ struct v4l2_m2m_ctx *m2m_ctx);
+
/**
* v4l2_m2m_buf_remove_by_buf() - take off exact buffer from the list of ready
* buffers

View file

@ -1,23 +0,0 @@
--- a/drivers/media/v4l2-core/v4l2-fwnode.c 2019-04-02 00:31:42.224001000 +0200
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c 2019-04-02 00:31:42.256001000 +0200
@@ -553,6 +553,20 @@
}
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_alloc_parse);
+bool of_node_name_eq(const struct device_node *np, const char *name)
+{
+ const char *node_name;
+ size_t len;
+
+ if (!np)
+ return false;
+
+ node_name = kbasename(np->full_name);
+ len = strchrnul(node_name, '@') - node_name;
+
+ return (strlen(name) == len) && (strncmp(node_name, name, len) == 0);
+}
+
int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
struct v4l2_fwnode_link *link)
{

View file

@ -1,746 +0,0 @@
From: Brad Love <brad@nextdimension.cc>
https://git.linuxtv.org/brad/media_tree.git/log/?h=Montage-3103b.v2
support for m88ds3103b
diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index 3a367a5..0d3b81d 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -64,6 +64,92 @@ err:
return ret;
}
+/*
+ * m88ds3103b demod has an internal device related to clocking. First the i2c
+ * gate must be opened, for one transaction, then writes will be allowed.
+ */
+static int m88ds3103b_dt_write(struct m88ds3103_dev *dev, int reg, int data)
+{
+ struct i2c_client *client = dev->client;
+ u8 buf[] = {reg, data};
+ u8 val;
+ int ret;
+ struct i2c_msg msg = {
+ .addr = dev->dt_addr, .flags = 0, .buf = buf, .len = 2
+ };
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x00);
+
+ val = 0x11;
+ ret = regmap_write(dev->regmap, 0x03, val);
+ if (ret)
+ dev_dbg(&client->dev, "fail=%d\n", ret);
+
+ ret = i2c_transfer(dev->client->adapter, &msg, 1);
+ if (ret != 1) {
+ dev_dbg(&client->dev, "0x%02x (ret=%i, reg=0x%02x, value=0x%02x)\n",
+ dev->dt_addr, ret, reg, data);
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+ return -EREMOTEIO;
+ }
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ dev_dbg(&client->dev, "0x%02x reg 0x%02x, value 0x%02x\n",
+ dev->dt_addr, reg, data);
+
+ return 0;
+}
+
+/*
+ * m88ds3103b demod has an internal device related to clocking. First the i2c
+ * gate must be opened, for two transactions, then reads will be allowed.
+ */
+static int m88ds3103b_dt_read(struct m88ds3103_dev *dev, u8 reg)
+{
+ struct i2c_client *client = dev->client;
+ int ret;
+ u8 val;
+ u8 b0[] = { reg };
+ u8 b1[] = { 0 };
+ struct i2c_msg msg[] = {
+ {
+ .addr = dev->dt_addr,
+ .flags = 0,
+ .buf = b0,
+ .len = 1
+ },
+ {
+ .addr = dev->dt_addr,
+ .flags = I2C_M_RD,
+ .buf = b1,
+ .len = 1
+ }
+ };
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x00);
+
+ val = 0x12;
+ ret = regmap_write(dev->regmap, 0x03, val);
+ if (ret)
+ dev_dbg(&client->dev, "fail=%d\n", ret);
+
+ ret = i2c_transfer(dev->client->adapter, msg, 2);
+ if (ret != 2) {
+ dev_dbg(&client->dev, "0x%02x (err=%d, reg=0x%02x)\n",
+ dev->dt_addr, ret, reg);
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+ return -EREMOTEIO;
+ }
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ dev_dbg(&client->dev, "0x%02x reg 0x%02x, value 0x%02x\n",
+ dev->dt_addr, reg, b1[0]);
+
+ return b1[0];
+}
+
/*
* Get the demodulator AGC PWM voltage setting supplied to the tuner.
*/
@@ -288,6 +374,253 @@ err:
return ret;
}
+static int m88ds3103b_select_mclk(struct m88ds3103_dev *dev)
+{
+ struct i2c_client *client = dev->client;
+ struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache;
+ u32 adc_Freq_MHz[3] = {96, 93, 99};
+ u8 reg16_list[3] = {96, 92, 100}, reg16, reg15;
+ u32 offset_MHz[3];
+ u32 max_offset = 0;
+ u32 old_setting = dev->mclk;
+ u32 tuner_freq_MHz = c->frequency / 1000;
+ u8 i;
+ char big_symbol = 0;
+
+ big_symbol = (c->symbol_rate > 45010000) ? 1 : 0;
+
+ if (big_symbol) {
+ reg16 = 115;
+ } else {
+ reg16 = 96;
+
+ /* TODO: IS THIS NECESSARY ? */
+ for (i = 0; i < 3; i++) {
+ offset_MHz[i] = tuner_freq_MHz % adc_Freq_MHz[i];
+
+ if (offset_MHz[i] > (adc_Freq_MHz[i] / 2))
+ offset_MHz[i] = adc_Freq_MHz[i] - offset_MHz[i];
+
+ if (offset_MHz[i] > max_offset) {
+ max_offset = offset_MHz[i];
+ reg16 = reg16_list[i];
+ dev->mclk = adc_Freq_MHz[i] * 1000 * 1000;
+
+ if (big_symbol)
+ dev->mclk /= 2;
+
+ dev_dbg(&client->dev, "modifying mclk %u -> %u\n",
+ old_setting, dev->mclk);
+ }
+ }
+ }
+
+ if (dev->mclk == 93000000)
+ regmap_write(dev->regmap, 0xA0, 0x42);
+ else if (dev->mclk == 96000000)
+ regmap_write(dev->regmap, 0xA0, 0x44);
+ else if (dev->mclk == 99000000)
+ regmap_write(dev->regmap, 0xA0, 0x46);
+ else if (dev->mclk == 110250000)
+ regmap_write(dev->regmap, 0xA0, 0x4E);
+ else
+ regmap_write(dev->regmap, 0xA0, 0x44);
+
+ reg15 = m88ds3103b_dt_read(dev, 0x15);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x40);
+ m88ds3103b_dt_write(dev, 0x11, 0x08);
+
+ if (big_symbol)
+ reg15 |= 0x02;
+ else
+ reg15 &= ~0x02;
+
+ m88ds3103b_dt_write(dev, 0x15, reg15);
+ m88ds3103b_dt_write(dev, 0x16, reg16);
+
+ usleep_range(5000, 5500);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x00);
+ m88ds3103b_dt_write(dev, 0x11, (u8)(big_symbol ? 0x0E : 0x0A));
+
+ usleep_range(5000, 5500);
+
+ return 0;
+}
+
+static int m88ds3103b_set_mclk(struct m88ds3103_dev *dev, u32 mclk_khz)
+{
+ u8 reg11 = 0x0A, reg15, reg16, reg1D, reg1E, reg1F, tmp;
+ u8 sm, f0 = 0, f1 = 0, f2 = 0, f3 = 0, pll_ldpc_mode;
+ u16 pll_div_fb, N;
+ u32 div;
+
+ reg15 = m88ds3103b_dt_read(dev, 0x15);
+ reg16 = m88ds3103b_dt_read(dev, 0x16);
+ reg1D = m88ds3103b_dt_read(dev, 0x1D);
+
+ if (dev->cfg->ts_mode != M88DS3103_TS_SERIAL) {
+ if (reg16 == 92)
+ tmp = 93;
+ else if (reg16 == 100)
+ tmp = 99;
+ else
+ tmp = 96;
+
+ mclk_khz *= tmp;
+ mclk_khz /= 96;
+ }
+
+ pll_ldpc_mode = (reg15 >> 1) & 0x01;
+
+ pll_div_fb = (reg15 & 0x01) << 8;
+ pll_div_fb += reg16;
+ pll_div_fb += 32;
+
+ div = 9000 * pll_div_fb * 4;
+ div /= mclk_khz;
+
+ if (dev->cfg->ts_mode == M88DS3103_TS_SERIAL) {
+ reg11 |= 0x02;
+
+ if (div <= 32) {
+ N = 2;
+
+ f0 = 0;
+ f1 = div / N;
+ f2 = div - f1;
+ f3 = 0;
+ } else if (div <= 34) {
+ N = 3;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = div - f0 - f1;
+ f3 = 0;
+ } else if (div <= 64) {
+ N = 4;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = (div - f0 - f1) / (N - 2);
+ f3 = div - f0 - f1 - f2;
+ } else {
+ N = 4;
+
+ f0 = 16;
+ f1 = 16;
+ f2 = 16;
+ f3 = 16;
+ }
+
+ if (f0 == 16)
+ f0 = 0;
+ else if ((f0 < 8) && (f0 != 0))
+ f0 = 8;
+
+ if (f1 == 16)
+ f1 = 0;
+ else if ((f1 < 8) && (f1 != 0))
+ f1 = 8;
+
+ if (f2 == 16)
+ f2 = 0;
+ else if ((f2 < 8) && (f2 != 0))
+ f2 = 8;
+
+ if (f3 == 16)
+ f3 = 0;
+ else if ((f3 < 8) && (f3 != 0))
+ f3 = 8;
+ } else {
+ reg11 &= ~0x02;
+
+ if (div <= 32) {
+ N = 2;
+
+ f0 = 0;
+ f1 = div / N;
+ f2 = div - f1;
+ f3 = 0;
+ } else if (div <= 48) {
+ N = 3;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = div - f0 - f1;
+ f3 = 0;
+ } else if (div <= 64) {
+ N = 4;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = (div - f0 - f1) / (N - 2);
+ f3 = div - f0 - f1 - f2;
+ } else {
+ N = 4;
+
+ f0 = 16;
+ f1 = 16;
+ f2 = 16;
+ f3 = 16;
+ }
+
+ if (f0 == 16)
+ f0 = 0;
+ else if ((f0 < 9) && (f0 != 0))
+ f0 = 9;
+
+ if (f1 == 16)
+ f1 = 0;
+ else if ((f1 < 9) && (f1 != 0))
+ f1 = 9;
+
+ if (f2 == 16)
+ f2 = 0;
+ else if ((f2 < 9) && (f2 != 0))
+ f2 = 9;
+
+ if (f3 == 16)
+ f3 = 0;
+ else if ((f3 < 9) && (f3 != 0))
+ f3 = 9;
+ }
+
+ sm = N - 1;
+
+ /* Write to registers */
+ //reg15 &= 0x01;
+ //reg15 |= (pll_div_fb >> 8) & 0x01;
+
+ //reg16 = pll_div_fb & 0xFF;
+
+ reg1D &= ~0x03;
+ reg1D |= sm;
+ reg1D |= 0x80;
+
+ reg1E = ((f3 << 4) + f2) & 0xFF;
+ reg1F = ((f1 << 4) + f0) & 0xFF;
+
+ m88ds3103b_dt_write(dev, 0x05, 0x40);
+ m88ds3103b_dt_write(dev, 0x11, 0x08);
+ m88ds3103b_dt_write(dev, 0x1D, reg1D);
+ m88ds3103b_dt_write(dev, 0x1E, reg1E);
+ m88ds3103b_dt_write(dev, 0x1F, reg1F);
+
+ m88ds3103b_dt_write(dev, 0x17, 0xc1);
+ m88ds3103b_dt_write(dev, 0x17, 0x81);
+
+ usleep_range(5000, 5500);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x00);
+ m88ds3103b_dt_write(dev, 0x11, 0x0A);
+
+ usleep_range(5000, 5500);
+
+ return 0;
+}
+
static int m88ds3103_set_frontend(struct dvb_frontend *fe)
{
struct m88ds3103_dev *dev = fe->demodulator_priv;
@@ -298,7 +631,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u8 u8tmp, u8tmp1 = 0, u8tmp2 = 0; /* silence compiler warning */
u8 buf[3];
u16 u16tmp;
- u32 tuner_frequency_khz, target_mclk;
+ u32 tuner_frequency_khz, target_mclk, u32tmp;
s32 s32tmp;
static const struct reg_sequence reset_buf[] = {
{0x07, 0x80}, {0x07, 0x00}
@@ -321,6 +654,20 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
/* Disable demod clock path */
if (dev->chip_id == M88RS6000_CHIP_ID) {
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ ret = regmap_read(dev->regmap, 0xb2, &u32tmp);
+ if (ret)
+ goto err;
+ if (u32tmp == 0x01) {
+ ret = regmap_write(dev->regmap, 0x00, 0x00);
+ if (ret)
+ goto err;
+ ret = regmap_write(dev->regmap, 0xb2, 0x00);
+ if (ret)
+ goto err;
+ }
+ }
+
ret = regmap_write(dev->regmap, 0x06, 0xe0);
if (ret)
goto err;
@@ -346,7 +693,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
tuner_frequency_khz = c->frequency;
}
- /* select M88RS6000 demod main mclk and ts mclk from tuner die. */
+ /* set M88RS6000/DS3103B demod main mclk and ts mclk from tuner die */
if (dev->chip_id == M88RS6000_CHIP_ID) {
if (c->symbol_rate > 45010000)
dev->mclk = 110250000;
@@ -358,6 +705,11 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
else
target_mclk = 144000000;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ m88ds3103b_select_mclk(dev);
+ m88ds3103b_set_mclk(dev, target_mclk / 1000);
+ }
+
/* Enable demod clock path */
ret = regmap_write(dev->regmap, 0x06, 0x00);
if (ret)
@@ -469,12 +821,42 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
ret = m88ds3103_update_bits(dev, 0x9d, 0x08, 0x08);
if (ret)
goto err;
+
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ buf[0] = m88ds3103b_dt_read(dev, 0x15);
+ buf[1] = m88ds3103b_dt_read(dev, 0x16);
+
+ if (c->symbol_rate > 45010000) {
+ buf[0] &= ~0x03;
+ buf[0] |= 0x02;
+ buf[0] |= ((147 - 32) >> 8) & 0x01;
+ buf[1] = (147 - 32) & 0xFF;
+
+ dev->mclk = 110250 * 1000;
+ } else {
+ buf[0] &= ~0x03;
+ buf[0] |= ((128 - 32) >> 8) & 0x01;
+ buf[1] = (128 - 32) & 0xFF;
+
+ dev->mclk = 96000 * 1000;
+ }
+ m88ds3103b_dt_write(dev, 0x15, buf[0]);
+ m88ds3103b_dt_write(dev, 0x16, buf[1]);
+
+ regmap_read(dev->regmap, 0x30, &u32tmp);
+ u32tmp &= ~0x80;
+ regmap_write(dev->regmap, 0x30, u32tmp & 0xff);
+ }
+
ret = regmap_write(dev->regmap, 0xf1, 0x01);
if (ret)
goto err;
- ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
- if (ret)
- goto err;
+
+ if (dev->chiptype != M88DS3103_CHIPTYPE_3103B) {
+ ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
+ if (ret)
+ goto err;
+ }
}
switch (dev->cfg->ts_mode) {
@@ -488,6 +870,10 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
break;
case M88DS3103_TS_PARALLEL:
u8tmp = 0x02;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ u8tmp = 0x01;
+ u8tmp1 = 0x01;
+ }
break;
case M88DS3103_TS_CI:
u8tmp = 0x03;
@@ -516,6 +902,12 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u8tmp1 = 0x3f;
u8tmp2 = 0x3f;
break;
+ case M88DS3103_TS_PARALLEL:
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ ret = m88ds3103_update_bits(dev, 0x29, 0x01, u8tmp1);
+ if (ret)
+ goto err;
+ }
default:
u16tmp = DIV_ROUND_UP(target_mclk, dev->cfg->ts_clk);
u8tmp1 = u16tmp / 2 - 1;
@@ -543,6 +935,9 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
else
u8tmp = 0x06;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B)
+ m88ds3103b_set_mclk(dev, target_mclk / 1000);
+
ret = regmap_write(dev->regmap, 0xc3, 0x08);
if (ret)
goto err;
@@ -578,6 +973,16 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
if (ret)
goto err;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ /* enable/disable 192M LDPC clock */
+ ret = m88ds3103_update_bits(dev, 0x29, 0x10,
+ (c->delivery_system == SYS_DVBS) ? 0x10 : 0x0);
+ if (ret)
+ goto err;
+
+ ret = m88ds3103_update_bits(dev, 0xc9, 0x08, 0x08);
+ }
+
dev_dbg(&client->dev, "carrier offset=%d\n",
(tuner_frequency_khz - c->frequency));
@@ -654,10 +1059,13 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_info(&client->dev, "found a '%s' in cold state\n",
m88ds3103_ops.info.name);
- if (dev->chip_id == M88RS6000_CHIP_ID)
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B)
+ name = M88DS3103B_FIRMWARE;
+ else if (dev->chip_id == M88RS6000_CHIP_ID)
name = M88RS6000_FIRMWARE;
else
name = M88DS3103_FIRMWARE;
+
/* request the firmware, this will block and timeout */
ret = request_firmware(&firmware, name, &client->dev);
if (ret) {
@@ -704,6 +1112,12 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_info(&client->dev, "firmware version: %X.%X\n",
(utmp >> 4) & 0xf, (utmp >> 0 & 0xf));
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ m88ds3103b_dt_write(dev, 0x21, 0x92);
+ m88ds3103b_dt_write(dev, 0x15, 0x6C);
+ m88ds3103b_dt_write(dev, 0x17, 0xC1);
+ m88ds3103b_dt_write(dev, 0x17, 0x81);
+ }
warm:
/* warm state */
dev->warm = true;
@@ -1393,6 +1807,8 @@ static int m88ds3103_probe(struct i2c_client *client,
goto err_kfree;
dev->chip_id = utmp >> 1;
+ dev->chiptype = (u8)id->driver_data;
+
dev_dbg(&client->dev, "chip_id=%02x\n", dev->chip_id);
switch (dev->chip_id) {
@@ -1470,6 +1886,19 @@ static int m88ds3103_probe(struct i2c_client *client,
/* setup callbacks */
pdata->get_dvb_frontend = m88ds3103_get_dvb_frontend;
pdata->get_i2c_adapter = m88ds3103_get_i2c_adapter;
+
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ /* enable i2c repeater for tuner */
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ /* get frontend address */
+ ret = regmap_read(dev->regmap, 0x29, &utmp);
+ if (ret)
+ goto err_kfree;
+ dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
+ dev_err(&client->dev, "dt addr is 0x%02x", dev->dt_addr);
+ }
+
return 0;
err_kfree:
kfree(dev);
@@ -1491,7 +1920,9 @@ static int m88ds3103_remove(struct i2c_client *client)
}
static const struct i2c_device_id m88ds3103_id_table[] = {
- {"m88ds3103", 0},
+ {"m88ds3103", M88DS3103_CHIPTYPE_3103},
+ {"m88rs6000", M88DS3103_CHIPTYPE_RS6000},
+ {"m88ds3103b", M88DS3103_CHIPTYPE_3103B},
{}
};
MODULE_DEVICE_TABLE(i2c, m88ds3103_id_table);
@@ -1513,3 +1944,4 @@ MODULE_DESCRIPTION("Montage Technology M88DS3103 DVB-S/S2 demodulator driver");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(M88DS3103_FIRMWARE);
MODULE_FIRMWARE(M88RS6000_FIRMWARE);
+MODULE_FIRMWARE(M88DS3103B_FIRMWARE);
diff --git a/drivers/media/dvb-frontends/m88ds3103_priv.h b/drivers/media/dvb-frontends/m88ds3103_priv.h
index c825032..d656ec2 100644
--- a/drivers/media/dvb-frontends/m88ds3103_priv.h
+++ b/drivers/media/dvb-frontends/m88ds3103_priv.h
@@ -16,11 +16,17 @@
#include <linux/regmap.h>
#include <linux/math64.h>
-#define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
-#define M88RS6000_FIRMWARE "dvb-demod-m88rs6000.fw"
+#define M88DS3103B_FIRMWARE "dvb-demod-m88ds3103b.fw"
+#define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
+#define M88RS6000_FIRMWARE "dvb-demod-m88rs6000.fw"
+
#define M88RS6000_CHIP_ID 0x74
#define M88DS3103_CHIP_ID 0x70
+#define M88DS3103_CHIPTYPE_3103 0
+#define M88DS3103_CHIPTYPE_RS6000 1
+#define M88DS3103_CHIPTYPE_3103B 2
+
struct m88ds3103_dev {
struct i2c_client *client;
struct regmap_config regmap_config;
@@ -35,10 +41,13 @@ struct m88ds3103_dev {
struct i2c_mux_core *muxc;
/* auto detect chip id to do different config */
u8 chip_id;
+ /* chip type to differentiate m88rs6000 from m88ds3103b */
+ u8 chiptype;
/* main mclk is calculated for M88RS6000 dynamically */
s32 mclk;
u64 post_bit_error;
u64 post_bit_count;
+ u8 dt_addr;
};
struct m88ds3103_reg_val {
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 1283c7c..6561f7b 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2397,6 +2397,20 @@ const struct em28xx_board em28xx_boards[] = {
.has_dvb = 1,
.ir_codes = RC_MAP_PINNACLE_PCTV_HD,
},
+ /*
+ * 2013:0259 PCTV DVB-S2 Stick (461e_v2)
+ * Empia EM28178, Montage M88DS3103b, Montage M88TS2022, Allegro A8293
+ */
+ [EM28178_BOARD_PCTV_461E_V2] = {
+ .def_i2c_bus = 1,
+ .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
+ EM28XX_I2C_FREQ_400_KHZ,
+ .name = "PCTV DVB-S2 Stick (461e v2)",
+ .tuner_type = TUNER_ABSENT,
+ .tuner_gpio = pctv_461e,
+ .has_dvb = 1,
+ .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
+ },
/*
* 2013:025f PCTV tripleStick (292e).
* Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157
@@ -2678,6 +2692,10 @@ struct usb_device_id em28xx_id_table[] = {
.driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
{ USB_DEVICE(0x2013, 0x0258),
.driver_info = EM28178_BOARD_PCTV_461E },
+ { USB_DEVICE(0x2013, 0x0461),
+ .driver_info = EM28178_BOARD_PCTV_461E_V2 },
+ { USB_DEVICE(0x2013, 0x0259),
+ .driver_info = EM28178_BOARD_PCTV_461E_V2 },
{ USB_DEVICE(0x2013, 0x025f),
.driver_info = EM28178_BOARD_PCTV_292E },
{ USB_DEVICE(0x2013, 0x0264), /* Hauppauge WinTV-soloHD 292e SE */
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a73faf1..e2ddc25 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1219,6 +1219,65 @@ static int em28178_dvb_init_pctv_461e(struct em28xx *dev)
return 0;
}
+static int em28178_dvb_init_pctv_461e_v2(struct em28xx *dev)
+{
+ struct em28xx_dvb *dvb = dev->dvb;
+ struct i2c_adapter *i2c_adapter;
+ struct m88ds3103_platform_data m88ds3103_pdata = {};
+ struct ts2020_config ts2020_config = {};
+ struct a8293_platform_data a8293_pdata = {};
+
+ /* attach demod */
+ m88ds3103_pdata.clk = 27000000;
+ m88ds3103_pdata.i2c_wr_max = 33;
+ m88ds3103_pdata.ts_mode = M88DS3103_TS_PARALLEL;
+ m88ds3103_pdata.ts_clk = 16000;
+ m88ds3103_pdata.ts_clk_pol = 1;
+ m88ds3103_pdata.agc = 0x99;
+ m88ds3103_pdata.agc_inv = 1;
+ m88ds3103_pdata.spec_inv = 1;
+ dvb->i2c_client_demod = dvb_module_probe("m88ds3103", "m88ds3103b",
+ &dev->i2c_adap[dev->def_i2c_bus],
+ 0x6a, &m88ds3103_pdata);
+
+ if (!dvb->i2c_client_demod) {
+ pr_err("%s() FUCK\n", __func__);
+ return -ENODEV;
+ }
+
+ dvb->fe[0] = m88ds3103_pdata.get_dvb_frontend(dvb->i2c_client_demod);
+ i2c_adapter = m88ds3103_pdata.get_i2c_adapter(dvb->i2c_client_demod);
+
+ /* attach tuner */
+ ts2020_config.fe = dvb->fe[0];
+ dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022",
+ i2c_adapter,
+ 0x60, &ts2020_config);
+ if (!dvb->i2c_client_tuner) {
+ pr_err("%s() FUCK2\n", __func__);
+ dvb_module_release(dvb->i2c_client_demod);
+ return -ENODEV;
+ }
+
+ /* delegate signal strength measurement to tuner */
+ dvb->fe[0]->ops.read_signal_strength =
+ dvb->fe[0]->ops.tuner_ops.get_rf_strength;
+
+ /* attach SEC */
+ a8293_pdata.dvb_frontend = dvb->fe[0];
+ dvb->i2c_client_sec = dvb_module_probe("a8293", NULL,
+ &dev->i2c_adap[dev->def_i2c_bus],
+ 0x08, &a8293_pdata);
+ if (!dvb->i2c_client_sec) {
+ pr_err("%s() FUCK3\n", __func__);
+ dvb_module_release(dvb->i2c_client_tuner);
+ dvb_module_release(dvb->i2c_client_demod);
+ return -ENODEV;
+ }
+
+ return 0;
+}
+
static int em28178_dvb_init_pctv_292e(struct em28xx *dev)
{
struct em28xx_dvb *dvb = dev->dvb;
@@ -1860,6 +1919,11 @@ static int em28xx_dvb_init(struct em28xx *dev)
if (result)
goto out_free;
break;
+ case EM28178_BOARD_PCTV_461E_V2:
+ result = em28178_dvb_init_pctv_461e_v2(dev);
+ if (result)
+ goto out_free;
+ break;
case EM28178_BOARD_PCTV_292E:
result = em28178_dvb_init_pctv_292e(dev);
if (result)
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h
index a551072..1affdd1 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -149,6 +149,7 @@
#define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 100
#define EM2884_BOARD_TERRATEC_H6 101
#define EM2882_BOARD_ZOLID_HYBRID_TV_STICK 102
+#define EM28178_BOARD_PCTV_461E_V2 103
/* Limits minimum and default number of buffers */
#define EM28XX_MIN_BUF 4
--
2.17.1

View file

@ -1,36 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="media_tree_cc_aml"
PKG_VERSION="2018-09-23"
PKG_SHA256="3b0cf3699317c04d9184b7e25056065fd374b20b851ee86a63ea2c70e219ee9e"
PKG_LICENSE="GPL"
PKG_SITE="https://bitbucket.org/CrazyCat/media_build/downloads/"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain media_tree_aml"
PKG_NEED_UNPACK="$LINUX_DEPENDS $(get_pkg_directory media_tree_aml)"
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.xz -C $PKG_BUILD/
}
post_unpack() {
# 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
}
configure() {
rm -rf $PKG_BUILD/drivers/media/platform/meson/dvb
cp -Lr $(get_build_dir media_tree_aml)/* $PKG_BUILD/
echo 'source "drivers/media/platform/meson/dvb/Kconfig"' >> "$PKG_BUILD/drivers/media/platform/Kconfig"
echo 'source "drivers/media/platform/meson/video_dev/Kconfig"' >> "$PKG_BUILD/drivers/media/platform/Kconfig"
}

View file

@ -1,746 +0,0 @@
From: Brad Love <brad@nextdimension.cc>
https://git.linuxtv.org/brad/media_tree.git/log/?h=Montage-3103b.v2
support for m88ds3103b
diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index 3a367a5..0d3b81d 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -64,6 +64,92 @@ err:
return ret;
}
+/*
+ * m88ds3103b demod has an internal device related to clocking. First the i2c
+ * gate must be opened, for one transaction, then writes will be allowed.
+ */
+static int m88ds3103b_dt_write(struct m88ds3103_dev *dev, int reg, int data)
+{
+ struct i2c_client *client = dev->client;
+ u8 buf[] = {reg, data};
+ u8 val;
+ int ret;
+ struct i2c_msg msg = {
+ .addr = dev->dt_addr, .flags = 0, .buf = buf, .len = 2
+ };
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x00);
+
+ val = 0x11;
+ ret = regmap_write(dev->regmap, 0x03, val);
+ if (ret)
+ dev_dbg(&client->dev, "fail=%d\n", ret);
+
+ ret = i2c_transfer(dev->client->adapter, &msg, 1);
+ if (ret != 1) {
+ dev_dbg(&client->dev, "0x%02x (ret=%i, reg=0x%02x, value=0x%02x)\n",
+ dev->dt_addr, ret, reg, data);
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+ return -EREMOTEIO;
+ }
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ dev_dbg(&client->dev, "0x%02x reg 0x%02x, value 0x%02x\n",
+ dev->dt_addr, reg, data);
+
+ return 0;
+}
+
+/*
+ * m88ds3103b demod has an internal device related to clocking. First the i2c
+ * gate must be opened, for two transactions, then reads will be allowed.
+ */
+static int m88ds3103b_dt_read(struct m88ds3103_dev *dev, u8 reg)
+{
+ struct i2c_client *client = dev->client;
+ int ret;
+ u8 val;
+ u8 b0[] = { reg };
+ u8 b1[] = { 0 };
+ struct i2c_msg msg[] = {
+ {
+ .addr = dev->dt_addr,
+ .flags = 0,
+ .buf = b0,
+ .len = 1
+ },
+ {
+ .addr = dev->dt_addr,
+ .flags = I2C_M_RD,
+ .buf = b1,
+ .len = 1
+ }
+ };
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x00);
+
+ val = 0x12;
+ ret = regmap_write(dev->regmap, 0x03, val);
+ if (ret)
+ dev_dbg(&client->dev, "fail=%d\n", ret);
+
+ ret = i2c_transfer(dev->client->adapter, msg, 2);
+ if (ret != 2) {
+ dev_dbg(&client->dev, "0x%02x (err=%d, reg=0x%02x)\n",
+ dev->dt_addr, ret, reg);
+
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+ return -EREMOTEIO;
+ }
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ dev_dbg(&client->dev, "0x%02x reg 0x%02x, value 0x%02x\n",
+ dev->dt_addr, reg, b1[0]);
+
+ return b1[0];
+}
+
/*
* Get the demodulator AGC PWM voltage setting supplied to the tuner.
*/
@@ -288,6 +374,253 @@ err:
return ret;
}
+static int m88ds3103b_select_mclk(struct m88ds3103_dev *dev)
+{
+ struct i2c_client *client = dev->client;
+ struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache;
+ u32 adc_Freq_MHz[3] = {96, 93, 99};
+ u8 reg16_list[3] = {96, 92, 100}, reg16, reg15;
+ u32 offset_MHz[3];
+ u32 max_offset = 0;
+ u32 old_setting = dev->mclk;
+ u32 tuner_freq_MHz = c->frequency / 1000;
+ u8 i;
+ char big_symbol = 0;
+
+ big_symbol = (c->symbol_rate > 45010000) ? 1 : 0;
+
+ if (big_symbol) {
+ reg16 = 115;
+ } else {
+ reg16 = 96;
+
+ /* TODO: IS THIS NECESSARY ? */
+ for (i = 0; i < 3; i++) {
+ offset_MHz[i] = tuner_freq_MHz % adc_Freq_MHz[i];
+
+ if (offset_MHz[i] > (adc_Freq_MHz[i] / 2))
+ offset_MHz[i] = adc_Freq_MHz[i] - offset_MHz[i];
+
+ if (offset_MHz[i] > max_offset) {
+ max_offset = offset_MHz[i];
+ reg16 = reg16_list[i];
+ dev->mclk = adc_Freq_MHz[i] * 1000 * 1000;
+
+ if (big_symbol)
+ dev->mclk /= 2;
+
+ dev_dbg(&client->dev, "modifying mclk %u -> %u\n",
+ old_setting, dev->mclk);
+ }
+ }
+ }
+
+ if (dev->mclk == 93000000)
+ regmap_write(dev->regmap, 0xA0, 0x42);
+ else if (dev->mclk == 96000000)
+ regmap_write(dev->regmap, 0xA0, 0x44);
+ else if (dev->mclk == 99000000)
+ regmap_write(dev->regmap, 0xA0, 0x46);
+ else if (dev->mclk == 110250000)
+ regmap_write(dev->regmap, 0xA0, 0x4E);
+ else
+ regmap_write(dev->regmap, 0xA0, 0x44);
+
+ reg15 = m88ds3103b_dt_read(dev, 0x15);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x40);
+ m88ds3103b_dt_write(dev, 0x11, 0x08);
+
+ if (big_symbol)
+ reg15 |= 0x02;
+ else
+ reg15 &= ~0x02;
+
+ m88ds3103b_dt_write(dev, 0x15, reg15);
+ m88ds3103b_dt_write(dev, 0x16, reg16);
+
+ usleep_range(5000, 5500);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x00);
+ m88ds3103b_dt_write(dev, 0x11, (u8)(big_symbol ? 0x0E : 0x0A));
+
+ usleep_range(5000, 5500);
+
+ return 0;
+}
+
+static int m88ds3103b_set_mclk(struct m88ds3103_dev *dev, u32 mclk_khz)
+{
+ u8 reg11 = 0x0A, reg15, reg16, reg1D, reg1E, reg1F, tmp;
+ u8 sm, f0 = 0, f1 = 0, f2 = 0, f3 = 0, pll_ldpc_mode;
+ u16 pll_div_fb, N;
+ u32 div;
+
+ reg15 = m88ds3103b_dt_read(dev, 0x15);
+ reg16 = m88ds3103b_dt_read(dev, 0x16);
+ reg1D = m88ds3103b_dt_read(dev, 0x1D);
+
+ if (dev->cfg->ts_mode != M88DS3103_TS_SERIAL) {
+ if (reg16 == 92)
+ tmp = 93;
+ else if (reg16 == 100)
+ tmp = 99;
+ else
+ tmp = 96;
+
+ mclk_khz *= tmp;
+ mclk_khz /= 96;
+ }
+
+ pll_ldpc_mode = (reg15 >> 1) & 0x01;
+
+ pll_div_fb = (reg15 & 0x01) << 8;
+ pll_div_fb += reg16;
+ pll_div_fb += 32;
+
+ div = 9000 * pll_div_fb * 4;
+ div /= mclk_khz;
+
+ if (dev->cfg->ts_mode == M88DS3103_TS_SERIAL) {
+ reg11 |= 0x02;
+
+ if (div <= 32) {
+ N = 2;
+
+ f0 = 0;
+ f1 = div / N;
+ f2 = div - f1;
+ f3 = 0;
+ } else if (div <= 34) {
+ N = 3;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = div - f0 - f1;
+ f3 = 0;
+ } else if (div <= 64) {
+ N = 4;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = (div - f0 - f1) / (N - 2);
+ f3 = div - f0 - f1 - f2;
+ } else {
+ N = 4;
+
+ f0 = 16;
+ f1 = 16;
+ f2 = 16;
+ f3 = 16;
+ }
+
+ if (f0 == 16)
+ f0 = 0;
+ else if ((f0 < 8) && (f0 != 0))
+ f0 = 8;
+
+ if (f1 == 16)
+ f1 = 0;
+ else if ((f1 < 8) && (f1 != 0))
+ f1 = 8;
+
+ if (f2 == 16)
+ f2 = 0;
+ else if ((f2 < 8) && (f2 != 0))
+ f2 = 8;
+
+ if (f3 == 16)
+ f3 = 0;
+ else if ((f3 < 8) && (f3 != 0))
+ f3 = 8;
+ } else {
+ reg11 &= ~0x02;
+
+ if (div <= 32) {
+ N = 2;
+
+ f0 = 0;
+ f1 = div / N;
+ f2 = div - f1;
+ f3 = 0;
+ } else if (div <= 48) {
+ N = 3;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = div - f0 - f1;
+ f3 = 0;
+ } else if (div <= 64) {
+ N = 4;
+
+ f0 = div / N;
+ f1 = (div - f0) / (N - 1);
+ f2 = (div - f0 - f1) / (N - 2);
+ f3 = div - f0 - f1 - f2;
+ } else {
+ N = 4;
+
+ f0 = 16;
+ f1 = 16;
+ f2 = 16;
+ f3 = 16;
+ }
+
+ if (f0 == 16)
+ f0 = 0;
+ else if ((f0 < 9) && (f0 != 0))
+ f0 = 9;
+
+ if (f1 == 16)
+ f1 = 0;
+ else if ((f1 < 9) && (f1 != 0))
+ f1 = 9;
+
+ if (f2 == 16)
+ f2 = 0;
+ else if ((f2 < 9) && (f2 != 0))
+ f2 = 9;
+
+ if (f3 == 16)
+ f3 = 0;
+ else if ((f3 < 9) && (f3 != 0))
+ f3 = 9;
+ }
+
+ sm = N - 1;
+
+ /* Write to registers */
+ //reg15 &= 0x01;
+ //reg15 |= (pll_div_fb >> 8) & 0x01;
+
+ //reg16 = pll_div_fb & 0xFF;
+
+ reg1D &= ~0x03;
+ reg1D |= sm;
+ reg1D |= 0x80;
+
+ reg1E = ((f3 << 4) + f2) & 0xFF;
+ reg1F = ((f1 << 4) + f0) & 0xFF;
+
+ m88ds3103b_dt_write(dev, 0x05, 0x40);
+ m88ds3103b_dt_write(dev, 0x11, 0x08);
+ m88ds3103b_dt_write(dev, 0x1D, reg1D);
+ m88ds3103b_dt_write(dev, 0x1E, reg1E);
+ m88ds3103b_dt_write(dev, 0x1F, reg1F);
+
+ m88ds3103b_dt_write(dev, 0x17, 0xc1);
+ m88ds3103b_dt_write(dev, 0x17, 0x81);
+
+ usleep_range(5000, 5500);
+
+ m88ds3103b_dt_write(dev, 0x05, 0x00);
+ m88ds3103b_dt_write(dev, 0x11, 0x0A);
+
+ usleep_range(5000, 5500);
+
+ return 0;
+}
+
static int m88ds3103_set_frontend(struct dvb_frontend *fe)
{
struct m88ds3103_dev *dev = fe->demodulator_priv;
@@ -298,7 +631,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u8 u8tmp, u8tmp1 = 0, u8tmp2 = 0; /* silence compiler warning */
u8 buf[3];
u16 u16tmp;
- u32 tuner_frequency_khz, target_mclk;
+ u32 tuner_frequency_khz, target_mclk, u32tmp;
s32 s32tmp;
static const struct reg_sequence reset_buf[] = {
{0x07, 0x80}, {0x07, 0x00}
@@ -321,6 +654,20 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
/* Disable demod clock path */
if (dev->chip_id == M88RS6000_CHIP_ID) {
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ ret = regmap_read(dev->regmap, 0xb2, &u32tmp);
+ if (ret)
+ goto err;
+ if (u32tmp == 0x01) {
+ ret = regmap_write(dev->regmap, 0x00, 0x00);
+ if (ret)
+ goto err;
+ ret = regmap_write(dev->regmap, 0xb2, 0x00);
+ if (ret)
+ goto err;
+ }
+ }
+
ret = regmap_write(dev->regmap, 0x06, 0xe0);
if (ret)
goto err;
@@ -346,7 +693,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
tuner_frequency_khz = c->frequency;
}
- /* select M88RS6000 demod main mclk and ts mclk from tuner die. */
+ /* set M88RS6000/DS3103B demod main mclk and ts mclk from tuner die */
if (dev->chip_id == M88RS6000_CHIP_ID) {
if (c->symbol_rate > 45010000)
dev->mclk = 110250000;
@@ -358,6 +705,11 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
else
target_mclk = 144000000;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ m88ds3103b_select_mclk(dev);
+ m88ds3103b_set_mclk(dev, target_mclk / 1000);
+ }
+
/* Enable demod clock path */
ret = regmap_write(dev->regmap, 0x06, 0x00);
if (ret)
@@ -469,12 +821,42 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
ret = m88ds3103_update_bits(dev, 0x9d, 0x08, 0x08);
if (ret)
goto err;
+
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ buf[0] = m88ds3103b_dt_read(dev, 0x15);
+ buf[1] = m88ds3103b_dt_read(dev, 0x16);
+
+ if (c->symbol_rate > 45010000) {
+ buf[0] &= ~0x03;
+ buf[0] |= 0x02;
+ buf[0] |= ((147 - 32) >> 8) & 0x01;
+ buf[1] = (147 - 32) & 0xFF;
+
+ dev->mclk = 110250 * 1000;
+ } else {
+ buf[0] &= ~0x03;
+ buf[0] |= ((128 - 32) >> 8) & 0x01;
+ buf[1] = (128 - 32) & 0xFF;
+
+ dev->mclk = 96000 * 1000;
+ }
+ m88ds3103b_dt_write(dev, 0x15, buf[0]);
+ m88ds3103b_dt_write(dev, 0x16, buf[1]);
+
+ regmap_read(dev->regmap, 0x30, &u32tmp);
+ u32tmp &= ~0x80;
+ regmap_write(dev->regmap, 0x30, u32tmp & 0xff);
+ }
+
ret = regmap_write(dev->regmap, 0xf1, 0x01);
if (ret)
goto err;
- ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
- if (ret)
- goto err;
+
+ if (dev->chiptype != M88DS3103_CHIPTYPE_3103B) {
+ ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
+ if (ret)
+ goto err;
+ }
}
switch (dev->cfg->ts_mode) {
@@ -488,6 +870,10 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
break;
case M88DS3103_TS_PARALLEL:
u8tmp = 0x02;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ u8tmp = 0x01;
+ u8tmp1 = 0x01;
+ }
break;
case M88DS3103_TS_CI:
u8tmp = 0x03;
@@ -516,6 +902,12 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
u8tmp1 = 0x3f;
u8tmp2 = 0x3f;
break;
+ case M88DS3103_TS_PARALLEL:
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ ret = m88ds3103_update_bits(dev, 0x29, 0x01, u8tmp1);
+ if (ret)
+ goto err;
+ }
default:
u16tmp = DIV_ROUND_UP(target_mclk, dev->cfg->ts_clk);
u8tmp1 = u16tmp / 2 - 1;
@@ -543,6 +935,9 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
else
u8tmp = 0x06;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B)
+ m88ds3103b_set_mclk(dev, target_mclk / 1000);
+
ret = regmap_write(dev->regmap, 0xc3, 0x08);
if (ret)
goto err;
@@ -578,6 +973,16 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
if (ret)
goto err;
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ /* enable/disable 192M LDPC clock */
+ ret = m88ds3103_update_bits(dev, 0x29, 0x10,
+ (c->delivery_system == SYS_DVBS) ? 0x10 : 0x0);
+ if (ret)
+ goto err;
+
+ ret = m88ds3103_update_bits(dev, 0xc9, 0x08, 0x08);
+ }
+
dev_dbg(&client->dev, "carrier offset=%d\n",
(tuner_frequency_khz - c->frequency));
@@ -654,10 +1059,13 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_info(&client->dev, "found a '%s' in cold state\n",
m88ds3103_ops.info.name);
- if (dev->chip_id == M88RS6000_CHIP_ID)
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B)
+ name = M88DS3103B_FIRMWARE;
+ else if (dev->chip_id == M88RS6000_CHIP_ID)
name = M88RS6000_FIRMWARE;
else
name = M88DS3103_FIRMWARE;
+
/* request the firmware, this will block and timeout */
ret = request_firmware(&firmware, name, &client->dev);
if (ret) {
@@ -704,6 +1112,12 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_info(&client->dev, "firmware version: %X.%X\n",
(utmp >> 4) & 0xf, (utmp >> 0 & 0xf));
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ m88ds3103b_dt_write(dev, 0x21, 0x92);
+ m88ds3103b_dt_write(dev, 0x15, 0x6C);
+ m88ds3103b_dt_write(dev, 0x17, 0xC1);
+ m88ds3103b_dt_write(dev, 0x17, 0x81);
+ }
warm:
/* warm state */
dev->warm = true;
@@ -1393,6 +1807,8 @@ static int m88ds3103_probe(struct i2c_client *client,
goto err_kfree;
dev->chip_id = utmp >> 1;
+ dev->chiptype = (u8)id->driver_data;
+
dev_dbg(&client->dev, "chip_id=%02x\n", dev->chip_id);
switch (dev->chip_id) {
@@ -1470,6 +1886,19 @@ static int m88ds3103_probe(struct i2c_client *client,
/* setup callbacks */
pdata->get_dvb_frontend = m88ds3103_get_dvb_frontend;
pdata->get_i2c_adapter = m88ds3103_get_i2c_adapter;
+
+ if (dev->chiptype == M88DS3103_CHIPTYPE_3103B) {
+ /* enable i2c repeater for tuner */
+ m88ds3103_update_bits(dev, 0x11, 0x01, 0x01);
+
+ /* get frontend address */
+ ret = regmap_read(dev->regmap, 0x29, &utmp);
+ if (ret)
+ goto err_kfree;
+ dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
+ dev_err(&client->dev, "dt addr is 0x%02x", dev->dt_addr);
+ }
+
return 0;
err_kfree:
kfree(dev);
@@ -1491,7 +1920,9 @@ static int m88ds3103_remove(struct i2c_client *client)
}
static const struct i2c_device_id m88ds3103_id_table[] = {
- {"m88ds3103", 0},
+ {"m88ds3103", M88DS3103_CHIPTYPE_3103},
+ {"m88rs6000", M88DS3103_CHIPTYPE_RS6000},
+ {"m88ds3103b", M88DS3103_CHIPTYPE_3103B},
{}
};
MODULE_DEVICE_TABLE(i2c, m88ds3103_id_table);
@@ -1513,3 +1944,4 @@ MODULE_DESCRIPTION("Montage Technology M88DS3103 DVB-S/S2 demodulator driver");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(M88DS3103_FIRMWARE);
MODULE_FIRMWARE(M88RS6000_FIRMWARE);
+MODULE_FIRMWARE(M88DS3103B_FIRMWARE);
diff --git a/drivers/media/dvb-frontends/m88ds3103_priv.h b/drivers/media/dvb-frontends/m88ds3103_priv.h
index c825032..d656ec2 100644
--- a/drivers/media/dvb-frontends/m88ds3103_priv.h
+++ b/drivers/media/dvb-frontends/m88ds3103_priv.h
@@ -16,11 +16,17 @@
#include <linux/regmap.h>
#include <linux/math64.h>
-#define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
-#define M88RS6000_FIRMWARE "dvb-demod-m88rs6000.fw"
+#define M88DS3103B_FIRMWARE "dvb-demod-m88ds3103b.fw"
+#define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
+#define M88RS6000_FIRMWARE "dvb-demod-m88rs6000.fw"
+
#define M88RS6000_CHIP_ID 0x74
#define M88DS3103_CHIP_ID 0x70
+#define M88DS3103_CHIPTYPE_3103 0
+#define M88DS3103_CHIPTYPE_RS6000 1
+#define M88DS3103_CHIPTYPE_3103B 2
+
struct m88ds3103_dev {
struct i2c_client *client;
struct regmap_config regmap_config;
@@ -35,10 +41,13 @@ struct m88ds3103_dev {
struct i2c_mux_core *muxc;
/* auto detect chip id to do different config */
u8 chip_id;
+ /* chip type to differentiate m88rs6000 from m88ds3103b */
+ u8 chiptype;
/* main mclk is calculated for M88RS6000 dynamically */
s32 mclk;
u64 post_bit_error;
u64 post_bit_count;
+ u8 dt_addr;
};
struct m88ds3103_reg_val {
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 1283c7c..6561f7b 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2397,6 +2397,20 @@ const struct em28xx_board em28xx_boards[] = {
.has_dvb = 1,
.ir_codes = RC_MAP_PINNACLE_PCTV_HD,
},
+ /*
+ * 2013:0259 PCTV DVB-S2 Stick (461e_v2)
+ * Empia EM28178, Montage M88DS3103b, Montage M88TS2022, Allegro A8293
+ */
+ [EM28178_BOARD_PCTV_461E_V2] = {
+ .def_i2c_bus = 1,
+ .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
+ EM28XX_I2C_FREQ_400_KHZ,
+ .name = "PCTV DVB-S2 Stick (461e v2)",
+ .tuner_type = TUNER_ABSENT,
+ .tuner_gpio = pctv_461e,
+ .has_dvb = 1,
+ .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
+ },
/*
* 2013:025f PCTV tripleStick (292e).
* Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157
@@ -2678,6 +2692,10 @@ struct usb_device_id em28xx_id_table[] = {
.driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
{ USB_DEVICE(0x2013, 0x0258),
.driver_info = EM28178_BOARD_PCTV_461E },
+ { USB_DEVICE(0x2013, 0x0461),
+ .driver_info = EM28178_BOARD_PCTV_461E_V2 },
+ { USB_DEVICE(0x2013, 0x0259),
+ .driver_info = EM28178_BOARD_PCTV_461E_V2 },
{ USB_DEVICE(0x2013, 0x025f),
.driver_info = EM28178_BOARD_PCTV_292E },
{ USB_DEVICE(0x2013, 0x0264), /* Hauppauge WinTV-soloHD 292e SE */
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a73faf1..e2ddc25 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1219,6 +1219,65 @@ static int em28178_dvb_init_pctv_461e(struct em28xx *dev)
return 0;
}
+static int em28178_dvb_init_pctv_461e_v2(struct em28xx *dev)
+{
+ struct em28xx_dvb *dvb = dev->dvb;
+ struct i2c_adapter *i2c_adapter;
+ struct m88ds3103_platform_data m88ds3103_pdata = {};
+ struct ts2020_config ts2020_config = {};
+ struct a8293_platform_data a8293_pdata = {};
+
+ /* attach demod */
+ m88ds3103_pdata.clk = 27000000;
+ m88ds3103_pdata.i2c_wr_max = 33;
+ m88ds3103_pdata.ts_mode = M88DS3103_TS_PARALLEL;
+ m88ds3103_pdata.ts_clk = 16000;
+ m88ds3103_pdata.ts_clk_pol = 1;
+ m88ds3103_pdata.agc = 0x99;
+ m88ds3103_pdata.agc_inv = 1;
+ m88ds3103_pdata.spec_inv = 1;
+ dvb->i2c_client_demod = dvb_module_probe("m88ds3103", "m88ds3103b",
+ &dev->i2c_adap[dev->def_i2c_bus],
+ 0x6a, &m88ds3103_pdata);
+
+ if (!dvb->i2c_client_demod) {
+ pr_err("%s() FUCK\n", __func__);
+ return -ENODEV;
+ }
+
+ dvb->fe[0] = m88ds3103_pdata.get_dvb_frontend(dvb->i2c_client_demod);
+ i2c_adapter = m88ds3103_pdata.get_i2c_adapter(dvb->i2c_client_demod);
+
+ /* attach tuner */
+ ts2020_config.fe = dvb->fe[0];
+ dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022",
+ i2c_adapter,
+ 0x60, &ts2020_config);
+ if (!dvb->i2c_client_tuner) {
+ pr_err("%s() FUCK2\n", __func__);
+ dvb_module_release(dvb->i2c_client_demod);
+ return -ENODEV;
+ }
+
+ /* delegate signal strength measurement to tuner */
+ dvb->fe[0]->ops.read_signal_strength =
+ dvb->fe[0]->ops.tuner_ops.get_rf_strength;
+
+ /* attach SEC */
+ a8293_pdata.dvb_frontend = dvb->fe[0];
+ dvb->i2c_client_sec = dvb_module_probe("a8293", NULL,
+ &dev->i2c_adap[dev->def_i2c_bus],
+ 0x08, &a8293_pdata);
+ if (!dvb->i2c_client_sec) {
+ pr_err("%s() FUCK3\n", __func__);
+ dvb_module_release(dvb->i2c_client_tuner);
+ dvb_module_release(dvb->i2c_client_demod);
+ return -ENODEV;
+ }
+
+ return 0;
+}
+
static int em28178_dvb_init_pctv_292e(struct em28xx *dev)
{
struct em28xx_dvb *dvb = dev->dvb;
@@ -1860,6 +1919,11 @@ static int em28xx_dvb_init(struct em28xx *dev)
if (result)
goto out_free;
break;
+ case EM28178_BOARD_PCTV_461E_V2:
+ result = em28178_dvb_init_pctv_461e_v2(dev);
+ if (result)
+ goto out_free;
+ break;
case EM28178_BOARD_PCTV_292E:
result = em28178_dvb_init_pctv_292e(dev);
if (result)
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h
index a551072..1affdd1 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -149,6 +149,7 @@
#define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 100
#define EM2884_BOARD_TERRATEC_H6 101
#define EM2882_BOARD_ZOLID_HYBRID_TV_STICK 102
+#define EM28178_BOARD_PCTV_461E_V2 103
/* Limits minimum and default number of buffers */
#define EM28XX_MIN_BUF 4
--
2.17.1

View file

@ -1,53 +0,0 @@
From 3f1f8303b6e0be751d7a7c55031c8ab840ed5c1a Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Fri, 24 Aug 2018 23:31:51 +0200
Subject: [PATCH] media: rc: ir-rc6-decoder: enable toggle bit for Kathrein
RCU-676 remote
The Kathrein RCU-676 remote uses the 32-bit rc6 protocol and toggles
bit 15 (0x8000) on repeated button presses, like MCE remotes.
Add it's customer code 0x80460000 to the 32-bit rc6 toggle
handling code to get proper scancodes and toggle reports.
Signed-off-by: Matthias Reichl <hias@horus.com>
---
drivers/media/rc/ir-rc6-decoder.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c
index 68487ce9f79b..d96aed1343e4 100644
--- a/drivers/media/rc/ir-rc6-decoder.c
+++ b/drivers/media/rc/ir-rc6-decoder.c
@@ -40,6 +40,7 @@
#define RC6_6A_MCE_TOGGLE_MASK 0x8000 /* for the body bits */
#define RC6_6A_LCC_MASK 0xffff0000 /* RC6-6A-32 long customer code mask */
#define RC6_6A_MCE_CC 0x800f0000 /* MCE customer code */
+#define RC6_6A_KATHREIN_CC 0x80460000 /* Kathrein RCU-676 customer code */
#ifndef CHAR_BIT
#define CHAR_BIT 8 /* Normally in <limits.h> */
#endif
@@ -242,13 +243,17 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
toggle = 0;
break;
case 32:
- if ((scancode & RC6_6A_LCC_MASK) == RC6_6A_MCE_CC) {
+ switch (scancode & RC6_6A_LCC_MASK) {
+ case RC6_6A_MCE_CC:
+ case RC6_6A_KATHREIN_CC:
protocol = RC_PROTO_RC6_MCE;
toggle = !!(scancode & RC6_6A_MCE_TOGGLE_MASK);
scancode &= ~RC6_6A_MCE_TOGGLE_MASK;
- } else {
+ break;
+ default:
protocol = RC_PROTO_RC6_6A_32;
toggle = 0;
+ break;
}
break;
default:
--
2.11.0

View file

@ -1,41 +0,0 @@
From ae1ccaa3587c0bd3d6d01841fa2e668cdf738f1e Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Sun, 3 Feb 2019 14:24:00 +0100
Subject: [PATCH] media: rc: ir-rc6-decoder: enable toggle bit for Zotac
remotes
The Zotac RC2604323/01G and RC2604329/02BG remotes use the 32-bit
rc6 protocol and toggle bit 15 (0x8000) on repeated button presses,
like MCE remotes.
Add the customer code 0x80340000 to the 32-bit rc6 toggle
handling code to get proper scancodes and toggle reports.
Signed-off-by: Matthias Reichl <hias@horus.com>
---
drivers/media/rc/ir-rc6-decoder.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c
index d96aed1343e4..5cc302fa4daa 100644
--- a/drivers/media/rc/ir-rc6-decoder.c
+++ b/drivers/media/rc/ir-rc6-decoder.c
@@ -40,6 +40,7 @@
#define RC6_6A_MCE_TOGGLE_MASK 0x8000 /* for the body bits */
#define RC6_6A_LCC_MASK 0xffff0000 /* RC6-6A-32 long customer code mask */
#define RC6_6A_MCE_CC 0x800f0000 /* MCE customer code */
+#define RC6_6A_ZOTAC_CC 0x80340000 /* Zotac customer code */
#define RC6_6A_KATHREIN_CC 0x80460000 /* Kathrein RCU-676 customer code */
#ifndef CHAR_BIT
#define CHAR_BIT 8 /* Normally in <limits.h> */
@@ -246,6 +247,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
switch (scancode & RC6_6A_LCC_MASK) {
case RC6_6A_MCE_CC:
case RC6_6A_KATHREIN_CC:
+ case RC6_6A_ZOTAC_CC:
protocol = RC_PROTO_RC6_MCE;
toggle = !!(scancode & RC6_6A_MCE_TOGGLE_MASK);
scancode &= ~RC6_6A_MCE_TOGGLE_MASK;
--
2.20.1

View file

@ -1,22 +0,0 @@
https://bitbucket.org/CrazyCat/linux_media/commits/ebd9c45524383e09d993563f4bd3cc765796b38a/raw
https://forum.libreelec.tv/thread/14405-dual-tbs-5520se-libreelec-9-0-0-intel-generic/?postID=110926#post110926
fixes TBS5520se scanning of frequencies
From: CrazyCat
Date: Mon, 12 Nov 2018 19:49:55 +0200
Subject: [PATCH] si2183: Fixed minimal frequency for DVB-C.
diff --git a/drivers/media/dvb-frontends/si2183.c b/drivers/media/dvb-frontends/si2183.c
index f1cc0da..333abd0 100644
--- a/drivers/media/dvb-frontends/si2183.c
+++ b/drivers/media/dvb-frontends/si2183.c
@@ -1335,7 +1335,7 @@ static int si2183_set_property(struct dvb_frontend *fe,
break;
case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_B:
- fe->ops.info.frequency_min_hz = 470 * MHz;
+ fe->ops.info.frequency_min_hz = 47 * MHz;
fe->ops.info.frequency_max_hz = 862 * MHz;
fe->ops.info.frequency_stepsize_hz = 62500;
break;

View file

@ -1,18 +0,0 @@
https://github.com/CoreELEC/CoreELEC/pull/208
fix si2168 tunning timeout
Some demuxer si2168 commands may take 130-140 ms
(DVB-T/T2 tuner MyGica T230C v2).
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -42,7 +42,7 @@ static int si2168_cmd_execute(struct i2c
if (cmd->rlen) {
/* wait cmd execution terminate */
- #define TIMEOUT 70
+ #define TIMEOUT 200
timeout = jiffies + msecs_to_jiffies(TIMEOUT);
while (!time_after(jiffies, timeout)) {
ret = i2c_master_recv(client, cmd->args, cmd->rlen);

View file

@ -1,19 +0,0 @@
https://github.com/CoreELEC/CoreELEC/pull/208
various checksum and continuity errors workaround
Workaround for various discontinuity, invalid checksum, Continuity
counter error and Transport error indicator errors which happens
randomly at 1/25 channel switches (DVB-T/T2 tuner MyGica T230C v2
at ARM plaform - Amlogic S912).
--- a/include/media/dmxdev.h
+++ b/include/media/dmxdev.h
@@ -187,7 +187,7 @@ struct dmxdev {
struct dmx_frontend *dvr_orig_fe;
struct dvb_ringbuffer dvr_buffer;
-#define DVR_BUFFER_SIZE (10*188*1024)
+#define DVR_BUFFER_SIZE (4*10*188*1024)
struct dvb_vb2_ctx dvr_vb2_ctx;

View file

@ -1,860 +0,0 @@
diff --git a/drivers/media/dvb-frontends/mxl58x.c b/drivers/media/dvb-frontends/mxl58x.c
index a6f2c68..45c4f9e 100644
--- a/drivers/media/dvb-frontends/mxl58x.c
+++ b/drivers/media/dvb-frontends/mxl58x.c
@@ -158,7 +158,7 @@ static int write_register(struct mxl *state, u32 reg, u32 val)
dev_err(&state->base->i2c->dev,"i2c write error\n");
return stat;
}
-
+/*
static int write_register_block(struct mxl *state, u32 reg, u32 size, u8 *data)
{
int stat;
@@ -181,7 +181,7 @@ static int write_register_block(struct mxl *state, u32 reg, u32 size, u8 *data)
mutex_unlock(&state->base->i2c_lock);
return stat;
}
-
+*/
static int write_firmware_block(struct mxl *state,
u32 reg, u32 size, u8 *regDataPtr)
{
@@ -282,7 +282,7 @@ static int update_by_mnemonic(struct mxl *state,
stat = write_register(state, reg, data);
return stat;
}
-
+/*
static void extract_from_mnemonic(u32 regAddr, u8 lsbPos, u8 width,
u32 *toAddr, u8 *toLsbPos, u8 *toWidth)
{
@@ -293,7 +293,7 @@ static void extract_from_mnemonic(u32 regAddr, u8 lsbPos, u8 width,
if (toWidth)
*toWidth = width;
}
-
+*/
static int firmware_is_alive(struct mxl *state)
{
u32 hb0, hb1;
@@ -329,7 +329,7 @@ static int get_algo(struct dvb_frontend *fe)
{
return DVBFE_ALGO_HW;
}
-
+/*
static int CfgDemodAbortTune(struct mxl *state)
{
MXL_HYDRA_DEMOD_ABORT_TUNE_T abortTuneCmd;
@@ -340,7 +340,7 @@ static int CfgDemodAbortTune(struct mxl *state)
BUILD_HYDRA_CMD(MXL_HYDRA_ABORT_TUNE_CMD, MXL_CMD_WRITE, cmdSize, &abortTuneCmd, cmdBuff);
return send_command(state, cmdSize + MXL_HYDRA_CMD_HEADER_SIZE, &cmdBuff[0]);
}
-
+*/
static int send_master_cmd(struct dvb_frontend *fe,
struct dvb_diseqc_master_cmd *cmd)
{
@@ -375,7 +375,7 @@ static int send_burst(struct dvb_frontend *fe,
MXL_HYDRA_DISEQC_TX_MSG_T diseqcMsgPtr;
u8 cmdSize = sizeof(MXL_HYDRA_DISEQC_TX_MSG_T);
u8 cmdBuff[MXL_HYDRA_OEM_MAX_CMD_BUFF_LEN];
- int i = 0,ret = 0;
+ int ret = 0;
if (!mode)
return 0;
@@ -544,7 +544,8 @@ static int read_status(struct dvb_frontend *fe, enum fe_status *status)
p->pre_bit_count.len = 1;
p->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
p->pre_bit_count.stat[0].uvalue = reg[3];
- dev_dbg(&state->base->i2c->dev,"pre_bit_error=%u pre_bit_count=%u\n", p->pre_bit_error.stat[0].uvalue, p->pre_bit_count.stat[0].uvalue);
+ dev_dbg(&state->base->i2c->dev,"pre_bit_error=%u pre_bit_count=%u\n",
+ (unsigned int)p->pre_bit_error.stat[0].uvalue, (unsigned int)p->pre_bit_count.stat[0].uvalue);
break;
default:
break;
@@ -579,7 +580,7 @@ static int read_status(struct dvb_frontend *fe, enum fe_status *status)
default:
break;
}
- dev_dbg(&state->base->i2c->dev,"post_bit_error=%u post_bit_count=%u\n", p->post_bit_error.stat[0].uvalue, p->post_bit_count.stat[0].uvalue);
+ dev_dbg(&state->base->i2c->dev,"post_bit_error=%u post_bit_count=%u\n", (unsigned int)p->post_bit_error.stat[0].uvalue, (unsigned int)p->post_bit_count.stat[0].uvalue);
return 0;
}
@@ -1072,6 +1073,7 @@ static int firmware_download(struct mxl *state, u32 mbinBufferSize,
return status;
}
+#if 0
static int cfg_ts_pad_mux(struct mxl *state, MXL_BOOL_E enableSerialTS)
{
int status = 0;
@@ -1177,7 +1179,7 @@ static int config_ts(struct mxl *state, MXL_HYDRA_DEMOD_ID_E demodId, MXL_HYDRA_
{XPT_TS_CLK_OUT_EN2}, {XPT_TS_CLK_OUT_EN3},
{XPT_TS_CLK_OUT_EN4}, {XPT_TS_CLK_OUT_EN5},
{XPT_TS_CLK_OUT_EN6}, {XPT_TS_CLK_OUT_EN7} };
- MXL_REG_FIELD_T mxl561_xpt_ts_sync[MXL_HYDRA_DEMOD_ID_6] = {
+/* MXL_REG_FIELD_T mxl561_xpt_ts_sync[MXL_HYDRA_DEMOD_ID_6] = {
{PAD_MUX_DIGIO_25_PINMUX_SEL}, {PAD_MUX_DIGIO_20_PINMUX_SEL},
{PAD_MUX_DIGIO_17_PINMUX_SEL}, {PAD_MUX_DIGIO_11_PINMUX_SEL},
{PAD_MUX_DIGIO_08_PINMUX_SEL}, {PAD_MUX_DIGIO_03_PINMUX_SEL} };
@@ -1185,7 +1187,7 @@ static int config_ts(struct mxl *state, MXL_HYDRA_DEMOD_ID_E demodId, MXL_HYDRA_
{PAD_MUX_DIGIO_26_PINMUX_SEL}, {PAD_MUX_DIGIO_19_PINMUX_SEL},
{PAD_MUX_DIGIO_18_PINMUX_SEL}, {PAD_MUX_DIGIO_10_PINMUX_SEL},
{PAD_MUX_DIGIO_09_PINMUX_SEL}, {PAD_MUX_DIGIO_02_PINMUX_SEL} };
-
+*/
if (MXL_ENABLE == mpegOutParamPtr->enable) {
cfg_ts_pad_mux(state, MXL_TRUE);
SET_REG_FIELD_DATA(XPT_ENABLE_PARALLEL_OUTPUT, MXL_FALSE);
@@ -1320,7 +1322,7 @@ static int config_mux(struct mxl *state)
SET_REG_FIELD_DATA(XPT_STREAM_MUXMODE1, 1);
return 0;
}
-
+#endif
static int config_dis(struct mxl *state, u32 id)
{
MXL_HYDRA_DISEQC_ID_E diseqcId = id;
@@ -1344,9 +1346,9 @@ static int config_dis(struct mxl *state, u32 id)
static int load_fw(struct mxl *state)
{
- struct mxl58x_cfg *cfg = state->base->cfg;
+// struct mxl58x_cfg *cfg = state->base->cfg;
int stat = 0;
- u8 *buf;
+// u8 *buf;
const struct firmware *fw;
@@ -1357,7 +1359,7 @@ static int load_fw(struct mxl *state)
if (stat)
return stat;
- stat = firmware_download(state, fw->size, fw->data);
+ stat = firmware_download(state, fw->size, (u8 *)fw->data);
release_firmware(fw);
@@ -1396,8 +1398,8 @@ static int probe(struct mxl *state)
{
struct mxl58x_cfg *cfg = state->base->cfg;
u32 chipver;
- int fw, status, j;
- MXL_HYDRA_MPEGOUT_PARAM_T mpegInterfaceCfg;
+ int fw, status;
+// MXL_HYDRA_MPEGOUT_PARAM_T mpegInterfaceCfg;
fw = firmware_is_alive(state);
diff --git a/drivers/media/dvb-frontends/si2183.c b/drivers/media/dvb-frontends/si2183.c
index 0c512b5..98914b1 100644
--- a/drivers/media/dvb-frontends/si2183.c
+++ b/drivers/media/dvb-frontends/si2183.c
@@ -28,12 +28,19 @@
#define SI2183_PROP_MODE 0x100a
#define SI2183_PROP_DVBC_CONST 0x1101
#define SI2183_PROP_DVBC_SR 0x1102
+#define SI2183_PROP_DVBC_AFC 0x1103
#define SI2183_PROP_DVBT_HIER 0x1201
+#define SI2183_PROP_DVBT_AFC 0x1202
+#define SI2183_PROP_DVBT2_AFC 0x1301
#define SI2183_PROP_DVBT2_MODE 0x1304
#define SI2183_PROP_DVBS2_SR 0x1401
+#define SI2183_PROP_DVBS2_AFC 0x1402
#define SI2183_PROP_DVBS_SR 0x1501
+#define SI2183_PROP_DVBS_AFC 0x1502
#define SI2183_PROP_MCNS_CONST 0x1601
#define SI2183_PROP_MCNS_SR 0x1602
+#define SI2183_PROP_MCNS_AFC 0x1603
+#define SI2183_PROP_DVBC2_AFC 0x1701
#define SI2183_ARGLEN 30
struct si2183_cmd {
@@ -47,6 +54,7 @@ static const struct dvb_frontend_ops si2183_ops;
LIST_HEAD(silist);
struct si_base {
+ struct mutex i2c_mutex;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
struct i2c_mux_core *muxc;
#endif
@@ -74,6 +82,7 @@ struct si2183_dev {
u8 ts_mode;
bool ts_clock_inv;
bool ts_clock_gapped;
+ u8 start_clk_mode;
int fef_pin;
bool fef_inv;
@@ -176,11 +185,12 @@ err:
static int si2183_cmd_execute(struct i2c_client *client, struct si2183_cmd *cmd)
{
+ struct si2183_dev *dev = i2c_get_clientdata(client);
int ret;
- i2c_lock_adapter(client->adapter);
+ mutex_lock(&dev->base->i2c_mutex);
ret = si2183_cmd_execute_unlocked(client, cmd);
- i2c_unlock_adapter(client->adapter);
+ mutex_unlock(&dev->base->i2c_mutex);
return ret;
}
@@ -202,7 +212,7 @@ static int si2183_set_prop(struct i2c_client *client, u16 prop, u16 *val)
*val = (cmd.args[2] | (cmd.args[3] << 8));
return ret;
}
-
+/*
static int si2183_get_prop(struct i2c_client *client, u16 prop, u16 *val)
{
struct si2183_cmd cmd;
@@ -218,7 +228,7 @@ static int si2183_get_prop(struct i2c_client *client, u16 prop, u16 *val)
*val = (cmd.args[2] | (cmd.args[3] << 8));
return ret;
}
-
+*/
static int si2183_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct i2c_client *client = fe->demodulator_priv;
@@ -282,6 +292,12 @@ static int si2183_read_status(struct dvb_frontend *fe, enum fe_status *status)
cmd.rlen = 14;
snr_mul = 2;
break;
+ case SYS_DVBC2:
+ memcpy(cmd.args, "\x91\x01", 2);
+ cmd.wlen = 2;
+ cmd.rlen = 16;
+ snr_mul = 2;
+ break;
default:
ret = -EINVAL;
goto err;
@@ -427,7 +443,7 @@ static int si2183_set_dvbc(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct i2c_client *client = fe->demodulator_priv;
- struct si2183_cmd cmd;
+// struct si2183_cmd cmd;
int ret;
u16 prop;
@@ -474,6 +490,14 @@ static int si2183_set_dvbc(struct dvb_frontend *fe)
return ret;
}
+ /* AFC range */
+ prop = 100;
+ ret = si2183_set_prop(client, SI2183_PROP_DVBC_AFC, &prop);
+ if (ret) {
+ dev_err(&client->dev, "err set dvb-c AFC range\n");
+ return ret;
+ }
+
return 0;
}
@@ -481,7 +505,7 @@ static int si2183_set_mcns(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct i2c_client *client = fe->demodulator_priv;
- struct si2183_cmd cmd;
+// struct si2183_cmd cmd;
int ret;
u16 prop;
@@ -528,6 +552,41 @@ static int si2183_set_mcns(struct dvb_frontend *fe)
return ret;
}
+ /* AFC range */
+ prop = 200;
+ ret = si2183_set_prop(client, SI2183_PROP_MCNS_AFC, &prop);
+ if (ret) {
+ dev_err(&client->dev, "err set mcns AFC range\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int si2183_set_dvbc2(struct dvb_frontend *fe)
+{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ struct i2c_client *client = fe->demodulator_priv;
+ struct si2183_cmd cmd;
+ int ret;
+ u16 prop;
+
+ /* dvb-c2 mode */
+ prop = 0xb8;
+ ret = si2183_set_prop(client, SI2183_PROP_MODE, &prop);
+ if (ret) {
+ dev_err(&client->dev, "err set dvb-c2 mode\n");
+ return ret;
+ }
+
+ /* AFC range */
+ prop = 550;
+ ret = si2183_set_prop(client, SI2183_PROP_DVBC2_AFC, &prop);
+ if (ret) {
+ dev_err(&client->dev, "err set dvb-c2 AFC range\n");
+ return ret;
+ }
+
return 0;
}
@@ -765,7 +824,9 @@ static int si2183_set_frontend(struct dvb_frontend *fe)
case SYS_DVBT2:
case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_B:
+ case SYS_DVBC_ANNEX_C:
case SYS_ISDBT:
+ case SYS_DVBC2:
dev->RF_switch(dev->base->i2c,dev->rf_in,1);
break;
@@ -801,11 +862,15 @@ static int si2183_set_frontend(struct dvb_frontend *fe)
ret = si2183_set_dvbt(fe);
break;
case SYS_DVBC_ANNEX_A:
+ case SYS_DVBC_ANNEX_C:
ret = si2183_set_dvbc(fe);
break;
case SYS_DVBC_ANNEX_B:
ret = si2183_set_mcns(fe);
break;
+ case SYS_DVBC2:
+ ret = si2183_set_dvbc2(fe);
+ break;
case SYS_ISDBT:
ret = si2183_set_isdbt(fe);
break;
@@ -856,6 +921,10 @@ static int si2183_init(struct dvb_frontend *fe)
/* initialize */
memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13);
+ if (dev->start_clk_mode) {
+ cmd.args[3] = 0;
+ cmd.args[5] = 0x6;
+ }
cmd.wlen = 13;
cmd.rlen = 0;
ret = si2183_cmd_execute(client, &cmd);
@@ -883,6 +952,9 @@ static int si2183_init(struct dvb_frontend *fe)
/* power up */
memcpy(cmd.args, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8);
+ if (dev->start_clk_mode) {
+ cmd.args[6] = 0x30;
+ }
cmd.wlen = 8;
cmd.rlen = 1;
ret = si2183_cmd_execute(client, &cmd);
@@ -1392,8 +1464,8 @@ err:
static const struct dvb_frontend_ops si2183_ops = {
.delsys = {SYS_DVBT, SYS_DVBT2, SYS_ISDBT,
- SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_B,
- SYS_DVBS, SYS_DVBS2, SYS_DSS},
+ SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_B, SYS_DVBC_ANNEX_C,
+ SYS_DVBS, SYS_DVBS2, SYS_DVBC2},
.info = {
.name = "Silicon Labs Si2183",
.symbol_rate_min = 1000000,
@@ -1462,7 +1534,7 @@ static int si2183_probe(struct i2c_client *client,
struct si2183_config *config = client->dev.platform_data;
struct si2183_dev *dev;
struct si_base *base;
- int ret;
+ int ret = 0;
dev_dbg(&client->dev, "\n");
@@ -1487,6 +1559,7 @@ static int si2183_probe(struct i2c_client *client,
dev->base = base;
list_add(&base->silist, &silist);
+ mutex_init(&base->i2c_mutex);
#ifdef SI2183_USE_I2C_MUX
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
/* create mux i2c adapter for tuner */
@@ -1532,6 +1605,7 @@ static int si2183_probe(struct i2c_client *client,
dev->sat_agc_inv = config->sat_agc_inv;
dev->RF_switch = config->RF_switch;
dev->rf_in = config->rf_in;
+ dev->start_clk_mode = config->start_clk_mode;
dev->fw_loaded = false;
dev->stat_resp = 0;
diff --git a/drivers/media/dvb-frontends/si2183.h b/drivers/media/dvb-frontends/si2183.h
index 106e11c..41ab0d9 100644
--- a/drivers/media/dvb-frontends/si2183.h
+++ b/drivers/media/dvb-frontends/si2183.h
@@ -44,6 +44,9 @@ struct si2183_config {
/* TS clock gapped */
bool ts_clock_gapped;
+ /* 0 terrestrial mode 1: satellite mode */
+ u8 start_clk_mode;
+
/* Tuner control pins */
#define SI2183_MP_NOT_USED 1
#define SI2183_MP_A 2
diff --git a/drivers/media/dvb-frontends/stid135/stid135-fe.c b/drivers/media/dvb-frontends/stid135/stid135-fe.c
index 700854d..9454695 100644
--- a/drivers/media/dvb-frontends/stid135/stid135-fe.c
+++ b/drivers/media/dvb-frontends/stid135/stid135-fe.c
@@ -336,7 +336,7 @@ static int stid135_set_parameters(struct dvb_frontend *fe)
static int stid135_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
{
- struct stv *state = fe->demodulator_priv;
+// struct stv *state = fe->demodulator_priv;
return 0;
}
diff --git a/drivers/media/dvb-frontends/stid135/stid135_drv.c b/drivers/media/dvb-frontends/stid135/stid135_drv.c
index ab47144..b30c6b0 100644
--- a/drivers/media/dvb-frontends/stid135/stid135_drv.c
+++ b/drivers/media/dvb-frontends/stid135/stid135_drv.c
@@ -2759,8 +2759,8 @@ fe_lla_error_t FE_STiD135_GetRFLevel(fe_stid135_handle_t handle,
u8 exp;
u32 Agc2x1000;
u32 InterpolatedGvanax1000;
- s32 PchRFx1000;
- s32 Pbandx1000;
+ s32 PchRFx1000 = 0;
+ s32 Pbandx1000 = 0;
s32 agcrf_path;
struct fe_stid135_internal_param *pParams;
fe_lla_error_t error = FE_LLA_NO_ERROR;
@@ -5152,6 +5152,8 @@ fe_lla_error_t fe_stid135_diseqc_init(fe_stid135_handle_t handle,
reg_value |= 0x00000100;
error |= ChipSetOneRegister(pParams->handle_soc, (u16)REG_RSTID135_SYSCFG_NORTH_SYSTEM_CONFIG1000, reg_value);
break;
+ default:
+ break;
}
error |= ChipSetField(pParams->handle_demod,
@@ -10028,6 +10030,8 @@ fe_lla_error_t fe_stid135_init_before_bb_flt_calib(fe_stid135_handle_t handle, F
error |= ChipSetField(pParams->handle_demod, FLD_FSTID135_AFE_AFE_AGC4_CTRL_AGC4_BB_CTRL, 3); /* set AGC1 manually, 0x7F */
error |= ChipSetOneRegister(pParams->handle_demod, (u16)REG_RSTID135_AFE_AFE_AGC4_BB_PWM, 0xCF); //7F
break;
+ default:
+ break;
}
error |= ChipSetOneRegister(pParams->handle_demod, (u16)REG_RC8CODEW_DVBSX_DEMOD_DMDCFGMD(FE_SAT_DEMOD_1), 0x40); //idee PG 20/04/2017
@@ -10149,6 +10153,8 @@ fe_lla_error_t fe_stid135_uninit_after_bb_flt_calib(fe_stid135_handle_t handle,
ChipSetOneRegister(pParams->handle_demod, (u16)REG_RSTID135_AFE_AFE_AGC4_CTRL, 0x00);
ChipSetOneRegister(pParams->handle_demod, (u16)REG_RSTID135_AFE_AFE_AGC4_BB_PWM, 0x00);
break;
+ default:
+ break;
}
Oxford_StopBBcal(pParams->handle_demod, tuner_nb);
@@ -10596,13 +10602,13 @@ fe_lla_error_t fe_stid135_bb_flt_calib(fe_stid135_handle_t handle, FE_OXFORD_Tun
{
s32 fld_value = 0;
u32 measure_h1, measure_h3;
- u32 ratio, ratio_threshold = 174; /* 174 because 10xlog(174/10)=12.4dB */
+ u32 ratio = 0, ratio_threshold = 174; /* 174 because 10xlog(174/10)=12.4dB */
fe_lla_error_t error = FE_LLA_NO_ERROR;
BOOL calib_value_found = FALSE;
s32 epsilon = 5;
s32 start_index = 0;
s32 end_index;
- s32 middle_index;
+ s32 middle_index = 0;
struct fe_stid135_internal_param *pParams;
s32 best_i_cal = 0x00, best_q_cal = 0x00;
diff --git a/drivers/media/dvb-frontends/tas2101.c b/drivers/media/dvb-frontends/tas2101.c
index 010ea59..4c43a82 100644
--- a/drivers/media/dvb-frontends/tas2101.c
+++ b/drivers/media/dvb-frontends/tas2101.c
@@ -637,9 +637,9 @@ err3:
err2:
i2c_del_mux_adapter(priv->i2c_demod);
#endif
-#endif
err1:
kfree(priv);
+#endif
err:
dev_err(&i2c->dev, "%s: Error attaching frontend\n", KBUILD_MODNAME);
return NULL;
diff --git a/drivers/media/tuners/av201x.c b/drivers/media/tuners/av201x.c
index 07c379e..989e3da 100644
--- a/drivers/media/tuners/av201x.c
+++ b/drivers/media/tuners/av201x.c
@@ -229,7 +229,7 @@ static int AV201x_level_dBm_10[] = { 90, -50, -263, -361, -463, -563, -66
static int av201x_get_rf_strength(struct dvb_frontend *fe, u16 *st)
{
- struct av201x_priv *priv = fe->tuner_priv;
+// struct av201x_priv *priv = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int if_agc, index, table_length, slope, *x, *y;
diff --git a/drivers/media/tuners/r848.c b/drivers/media/tuners/r848.c
index de601f7..05efce0 100644
--- a/drivers/media/tuners/r848.c
+++ b/drivers/media/tuners/r848.c
@@ -72,13 +72,13 @@ static int r848_wr(struct r848_priv *priv, u8 addr, u8 data)
return r848_wrm(priv, buf, 2);
}
-/* read one register */
+/* read one register *
static int r848_rd(struct r848_priv *priv, u8 addr, u8 *data)
{
return r848_rdm(priv, addr, data, 1);
}
-
-/* read register, apply masks, write back */
+*/
+/* read register, apply masks, write back *
static int r848_regmask(struct r848_priv *priv,
u8 reg, u8 setmask, u8 clrmask)
{
@@ -92,7 +92,7 @@ static int r848_regmask(struct r848_priv *priv,
}
return r848_wr(priv, reg, b | setmask);
}
-
+*/
static int r848_get_lock_status(struct r848_priv *priv, u8 *lock)
{
int ret;
@@ -123,7 +123,7 @@ static int R848_Muti_Read( struct r848_priv *priv,u8* IMR_Result_Data)
u8 ReadMax = 0;
u8 ReadMin = 255;
u8 ReadData = 0;
- I2C_LEN_TYPE R848_I2C_Len;
+// I2C_LEN_TYPE R848_I2C_Len;
u8 buf[2];
int ret;
@@ -333,7 +333,7 @@ int I2C_Write(struct r848_priv *priv, I2C_TYPE *R848_I2C)
R848_ErrCode R848_Cal_Prepare( struct r848_priv *priv,u8 u1CalFlag)
{
R848_Cal_Info_Type Cal_Info;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
// I2C_LEN_TYPE R848_I2C_Len;
u8 R848_IMR_Cal_Type = R848_IMR_CAL;
int ret;
@@ -673,8 +673,8 @@ R848_ErrCode R848_Cal_Prepare( struct r848_priv *priv,u8 u1CalFlag)
R848_ErrCode R848_Xtal_Check( struct r848_priv *priv)
{
u8 i = 0;
- I2C_TYPE R848_I2C;
- I2C_LEN_TYPE R848_I2C_Len;
+// I2C_TYPE R848_I2C;
+// I2C_LEN_TYPE R848_I2C_Len;
u8 buf[3];
int ret;
@@ -899,8 +899,8 @@ R848_ErrCode R848_PLL( struct r848_priv *priv,u32 LO_Freq, R848_Standard_Type R8
u8 R848_XtalDiv = XTAL_DIV2;
- I2C_TYPE R848_I2C;
- I2C_LEN_TYPE R848_I2C_Len;
+// I2C_TYPE R848_I2C;
+// I2C_LEN_TYPE R848_I2C_Len;
//TF, NA fix
u1RfFlag = (priv->cfg->R848_Array[14] & 0x01); //R22[0]
@@ -1384,7 +1384,7 @@ R848_ErrCode R848_MUX( struct r848_priv *priv,u32 LO_KHz, u32 RF_KHz, R848_Stand
u8 Reg08_IMR_Gain = 0;
u8 Reg09_IMR_Phase = 0;
u8 Reg03_IMR_Iqcap = 0;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
Freq_Info1 = R848_Freq_Sel(LO_KHz, RF_KHz, R848_Standard);
@@ -1512,7 +1512,7 @@ R848_ErrCode R848_IQ_Tree( struct r848_priv *priv,u8 FixPot, u8 FlucPot, u8 PotR
u8 TreeCunt = 0;
u8 TreeTimes = 3;
u8 PntReg = 0;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
if(PotReg == 0x10)
PntReg = 0x11; //phase control
@@ -1652,7 +1652,7 @@ R848_ErrCode R848_IMR_Cross( struct r848_priv *priv,R848_SectType* IQ_Pont, u8*
u8 CrossCount = 0;
u8 Reg16 = priv->cfg->R848_Array[8] & 0xC0;
u8 Reg17 = priv->cfg->R848_Array[9] & 0xC0;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
memset(&Compare_Temp, 0, sizeof(R848_SectType));
Compare_Temp.Value = 255;
@@ -1824,7 +1824,7 @@ R848_ErrCode R848_CompreStep( struct r848_priv *priv,R848_SectType* StepArry, u8
{
int ret;
R848_SectType StepTemp;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
//min value already saved in StepArry[0]
StepTemp.Phase_Y = StepArry[0].Phase_Y;
StepTemp.Gain_X = StepArry[0].Gain_X;
@@ -1877,7 +1877,7 @@ R848_ErrCode R848_IMR_Iqcap( struct r848_priv *priv,R848_SectType* IQ_Point)
{
R848_SectType Compare_Temp;
int i = 0, ret;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
//Set Gain/Phase to right setting
// R848_I2C.RegAddr = 0x10; // R16[5:0]
@@ -1930,7 +1930,7 @@ R848_ErrCode R848_IQ( struct r848_priv *priv,R848_SectType* IQ_Pont)
u8 VGA_Count = 0;
u8 VGA_Read = 0;
u8 X_Direction; // 1:X, 0:Y
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
// increase VGA power to let image significant
@@ -2084,7 +2084,7 @@ R848_ErrCode R848_F_IMR( struct r848_priv *priv,R848_SectType* IQ_Pont)
R848_SectType Compare_Bet[3];
u8 VGA_Count = 0;
u8 VGA_Read = 0;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
//VGA
for(VGA_Count=11; VGA_Count < 16; VGA_Count ++)
@@ -2184,7 +2184,7 @@ R848_ErrCode R848_SetTF( struct r848_priv *priv,u32 u4FreqKHz, u8 u1TfType)
u8 u1TF_Set_Result2 = 0;
u8 u1TF_tmp1, u1TF_tmp2;
u8 u1TFCalNum = R848_TF_HIGH_NUM;
- I2C_TYPE R848_I2C;
+// I2C_TYPE R848_I2C;
u8 R848_TF = 0;
if(u4FreqKHz<R848_LNA_LOW_LOWEST[R848_TF_BEAD]) //Ultra Low
@@ -2392,9 +2392,9 @@ R848_ErrCode R848_IMR( struct r848_priv *priv,u8 IMR_MEM, bool IM_Flag)
//Mixer Amp Gain
R848_I2C.RegAddr = 0x0F; //R848:R15[4:0]
priv->cfg->R848_Array[7] = (priv->cfg->R848_Array[7] & 0xE0) | u1MixerGain;
- R848_I2C.Data = priv->cfg->R848_Array[7];
- if(I2C_Write(priv,&R848_I2C) != RT_Success)
- return RT_Fail;
+ R848_I2C.Data = priv->cfg->R848_Array[7];
+ if(I2C_Write(priv,&R848_I2C) != RT_Success)
+ return RT_Fail;
//write I2C to set RingPLL
R848_I2C.RegAddr = 0x27;
@@ -2768,9 +2768,9 @@ u8 R848_Filt_Cal_ADC( struct r848_priv *priv,u32 IF_Freq, u8 R848_BW, u8 FilCal
}
if(u1FilterCode==16)
- u1FilterCodeResult = 15;
+ u1FilterCodeResult = 15;
- return u1FilterCodeResult;
+ return u1FilterCodeResult;
}
@@ -3730,6 +3730,8 @@ R848_SysFreq_Info_Type R848_SysFreq_Sel(struct r848_priv *priv,R848_Standard_Typ
case R848_DVB_T2_1_7M_IF_5M:
R848_SysFreq_Info.AGC_CLK = 0x1C; //250Hz R26[4:2]
break;
+ default:
+ break;
}
}
break;
@@ -3755,7 +3757,7 @@ R848_ErrCode R848_RfGainMode( struct r848_priv *priv,R848_RF_Gain_TYPE R848_RfGa
u8 RfGain = 0;
u8 LnaGain = 0;
I2C_TYPE R848_I2C;
- I2C_LEN_TYPE R848_I2C_Len;
+// I2C_LEN_TYPE R848_I2C_Len;
if(R848_RfGainType==RF_MANUAL)
{
@@ -4438,10 +4440,10 @@ static int r848_init(struct dvb_frontend *fe)
{
struct r848_priv *priv = fe->tuner_priv;
int ret;
- dev_dbg(&priv->i2c->dev, "%s()\n", __func__);
-
u8 i;
+ dev_dbg(&priv->i2c->dev, "%s()\n", __func__);
+
if (priv->inited == 1)
return 0;
diff --git a/drivers/media/tuners/stv6120.c b/drivers/media/tuners/stv6120.c
index 0980f51..f25d60a 100644
--- a/drivers/media/tuners/stv6120.c
+++ b/drivers/media/tuners/stv6120.c
@@ -364,7 +364,7 @@ static int set_lof(struct stv *state, u32 LocalFrequency, u32 CutOffFrequency)
int cf_index = (CutOffFrequency / 1000000) - 5;
u32 Frequency = (LocalFrequency + 500) / 1000; // Hz -> kHz
u32 fvco, div, frac;
- u8 Icp, tmp;
+ u8 Icp; //, tmp;
u8 PDIV, P;
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 12c5b68..2a05f13 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -717,8 +717,10 @@ static int register_dvb(struct cx231xx_dvb *dvb,
return 0;
+#if 0
fail_create_graph:
dvb_net_release(&dvb->net);
+#endif
fail_fe_conn:
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
fail_fe_mem:
diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c
index 6eee95d..5c2ef8a 100644
--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c
+++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c
@@ -546,6 +546,7 @@ static int dvbsky_t330_attach(struct dvb_usb_adapter *adap)
return 0;
}
+#if 0
static int dvbsky_mygica_t230c_attach(struct dvb_usb_adapter *adap)
{
struct dvbsky_state *state = adap_to_priv(adap);
@@ -580,7 +581,7 @@ static int dvbsky_mygica_t230c_attach(struct dvb_usb_adapter *adap)
return 0;
}
-
+#endif
static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name)
{
@@ -731,7 +732,7 @@ static struct dvb_usb_device_properties dvbsky_t330_props = {
}
}
};
-
+#if 0
static struct dvb_usb_device_properties mygica_t230c_props = {
.driver_name = KBUILD_MODNAME,
.owner = THIS_MODULE,
@@ -757,7 +758,7 @@ static struct dvb_usb_device_properties mygica_t230c_props = {
}
}
};
-
+#endif
static const struct usb_device_id dvbsky_id_table[] = {
{ DVB_USB_DEVICE(0x0572, 0x6831,
&dvbsky_s960_props, "DVBSky S960/S860", RC_MAP_DVBSKY) },
diff --git a/drivers/media/usb/dvb-usb/cycitv.c b/drivers/media/usb/dvb-usb/cycitv.c
index ba2b8c9..33340c2 100644
--- a/drivers/media/usb/dvb-usb/cycitv.c
+++ b/drivers/media/usb/dvb-usb/cycitv.c
@@ -283,7 +283,7 @@ struct cycitv_adapter_state {
static int cycitv_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
{
- struct cycitv_adapter_state *state = (struct cycitv_adapter_state *)adap->priv;
+// struct cycitv_adapter_state *state = (struct cycitv_adapter_state *)adap->priv;
u8 obuf[0x40], ibuf[0x40];
u8 tsckinv ;
deb_info("%s onoff=%d\n", __func__,onoff);
@@ -593,7 +593,8 @@ static int cycitv_power_ctrl(struct dvb_usb_device *d, int i)
if (i && !state->initialized) {
state->initialized = 1;
/* reset board */
- dvb_usb_generic_rw(d, obuf, 2, NULL, 0, 0);
+ if (dvb_usb_generic_rw(d, obuf, 2, NULL, 0, 0))
+ return 0;
}
return 0;
@@ -665,7 +666,7 @@ static int cycitv_frontend_attach(struct dvb_usb_adapter *d)
{
struct dvb_usb_device *dev = d->dev;
struct cycitv_state *s = (struct cycitv_state *)dev->priv;
- struct cycitv_adapter_state *state = (struct cycitv_adapter_state *)d->priv;
+// struct cycitv_adapter_state *state = (struct cycitv_adapter_state *)d->priv;
int id;
deb_info("cycitv_frontend_attach 00!\n");
@@ -697,6 +698,7 @@ static int cycitv_frontend_attach(struct dvb_usb_adapter *d)
return -EIO;
}
+#if 0
static struct rc_map_table rc_map_cycitv_table_mygica[] = {
{ 0x25, KEY_POWER }, /* right-bottom Red */
{ 0x0a, KEY_MUTE }, /* -/-- */
@@ -780,6 +782,7 @@ static int cycitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
return 0;
}
+#endif
enum cycitv_table_entry {
GENIATECH_DEV_COLD,
GENIATECH_DEV_WORK,
diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index 866ed1f..1b898b7 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -1144,13 +1144,13 @@ static struct stv0900_config prof_7500_stv0900_config = {
.tun1_type = 3,
.set_lock_led = dw210x_led_ctrl,
};
-
+/*
static struct ds3000_config su3000_ds3000_config = {
.demod_address = 0x68,
.ci_mode = 1,
.set_lock_led = dw210x_led_ctrl,
};
-
+*/
static struct ds3k_config su3000_ds3k_config = {
.demod_address = 0x68,
.ci_mode = 0,
@@ -1390,11 +1390,11 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *adap)
{
struct dvb_usb_device *d = adap->dev;
struct dw2102_state *state = d->priv;
- struct i2c_adapter *i2c_adapter;
- struct i2c_client *client;
- struct i2c_board_info board_info;
- struct m88ds3103_platform_data m88ds3103_pdata = {};
- struct ts2020_config ts2020_config = {};
+// struct i2c_adapter *i2c_adapter;
+// struct i2c_client *client;
+// struct i2c_board_info board_info;
+// struct m88ds3103_platform_data m88ds3103_pdata = {};
+// struct ts2020_config ts2020_config = {};
mutex_lock(&d->data_mutex);

View file

@ -1,2 +0,0 @@
100
- Initial add-on

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View file

@ -1,29 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="digital_devices"
PKG_VERSION="e3601828472485b299495ec15dcd7e4cc4c770a3"
PKG_SHA256="2e75a97602cd7512655020d7147a18eee76a9b7befa2aaca82d1548a0995c313"
PKG_ARCH="x86_64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/DigitalDevices/dddvb/"
PKG_URL="https://github.com/DigitalDevices/dddvb/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_BUILD_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_SECTION="driver.dvb"
PKG_LONGDESC="DVB driver for Digital Devices cards"
PKG_IS_ADDON="embedded"
PKG_ADDON_IS_STANDALONE="yes"
PKG_ADDON_NAME="DVB drivers for DigitalDevices"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_VERSION="${ADDON_VERSION}.${PKG_REV}"
make_target() {
KDIR=$(kernel_path) make
}
makeinstall_target() {
install_driver_addon_files "$PKG_BUILD/ddbridge $PKG_BUILD/dvb-core $PKG_BUILD/frontends"
}

View file

@ -1,2 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

View file

@ -1,2 +0,0 @@
100
- Initial add-on

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View file

@ -1,79 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="dvb-latest"
PKG_VERSION="0f25e6fb13b6bc345218800ad9ac863deb2ee9c8"
PKG_SHA256="71294995cff2bc556bcf9aa7ade595a4ccd91a1972b73d1e537d99d2ce86dbed"
PKG_LICENSE="GPL"
PKG_SITE="http://git.linuxtv.org/media_build.git"
PKG_URL="https://git.linuxtv.org/media_build.git/snapshot/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux media_tree"
PKG_NEED_UNPACK="$LINUX_DEPENDS $(get_pkg_directory media_tree)"
PKG_SECTION="driver.dvb"
PKG_LONGDESC="DVB drivers from the latest kernel (media_build)"
PKG_IS_ADDON="embedded"
PKG_IS_KERNEL_PKG="yes"
PKG_ADDON_IS_STANDALONE="yes"
PKG_ADDON_NAME="DVB drivers from the latest kernel"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_VERSION="${ADDON_VERSION}.${PKG_REV}"
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
PKG_PATCH_DIRS="amlogic-common"
case "$LINUX" in
amlogic-3.14)
PKG_PATCH_DIRS+=" amlogic-3.14"
;;
amlogic-4.9)
PKG_PATCH_DIRS+=" amlogic-4.9"
;;
esac
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET media_tree_aml"
PKG_NEED_UNPACK="$PKG_NEED_UNPACK $(get_pkg_directory media_tree_aml)"
fi
pre_make_target() {
export KERNEL_VER=$(get_module_dir)
export LDFLAGS=""
}
make_target() {
cp -RP $(get_build_dir media_tree)/* $PKG_BUILD/linux
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
cp -Lr $(get_build_dir media_tree_aml)/* $PKG_BUILD/linux
# compile modules
echo "obj-y += video_dev/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo "obj-y += dvb/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo 'source "drivers/media/platform/meson/dvb/Kconfig"' >> "$PKG_BUILD/linux/drivers/media/platform/Kconfig"
sed -e 's/ && RC_CORE//g' -i $PKG_BUILD/linux/drivers/media/usb/dvb-usb/Kconfig
fi
# make config all
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path) allyesconfig
# hack to workaround media_build bug
if [ "$PROJECT" = "Amlogic" ]; then
sed -e 's/CONFIG_DVB_LGDT3306A=m/# CONFIG_DVB_LGDT3306A is not set/g' -i v4l/.config
sed -e 's/CONFIG_VIDEO_S5C73M3=m/# CONFIG_VIDEO_S5C73M3 is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_SAA7146_VV=m/# CONFIG_VIDEO_SAA7146_VV is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_OV2659=m/# CONFIG_VIDEO_OV2659 is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_OV5647=m/# CONFIG_VIDEO_OV5647 is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_S5K5BAF=m/# CONFIG_VIDEO_S5K5BAF is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_VIVID=m/# CONFIG_VIDEO_VIVID is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_TVP514X=m/# CONFIG_VIDEO_TVP514X is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_TVP7002=m/# CONFIG_VIDEO_TVP7002 is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_CADENCE_CSI2RX=m/# CONFIG_VIDEO_CADENCE_CSI2RX is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_CADENCE_CSI2TX=m/# CONFIG_VIDEO_CADENCE_CSI2TX is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/# CONFIG_MEDIA_TUNER_TDA18250 is not set/CONFIG_MEDIA_TUNER_TDA18250=m/g' -i $PKG_BUILD/v4l/.config
fi
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path)
}
makeinstall_target() {
install_driver_addon_files "$PKG_BUILD/v4l/"
}

View file

@ -1,15 +0,0 @@
--- /dev/null
+++ b/v4l/config-mycompat.h
@@ -0,0 +1,11 @@
+#undef smp_mb__after_atomic
+#define smp_mb__after_atomic() smp_mb() /*mb*/
+#undef NEED_SMP_MB_AFTER_ATOMIC
+#undef __pfn_to_phys
+#define __pfn_to_phys(pfn) ((phys_addr_t)(pfn) << PAGE_SHIFT)
+#undef NEED_PFN_TO_PHYS
+#undef writel_relaxed
+#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
+#undef NEED_WRITEL_RELAXED
+#undef NEED_PM_RUNTIME_GET
+#undef NEED_OF_NODE_NAME_EQ
--

View file

@ -1,14 +0,0 @@
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -626,6 +626,11 @@ ($$)
close OUT;
# These options should default to off
+disable_config('MEDIA_ANALOG_TV_SUPPORT');
+disable_config('MEDIA_CAMERA_SUPPORT');
+disable_config('MEDIA_CEC_SUPPORT');
+disable_config('SOC_CAMERA');
+disable_config('RC_CORE');
disable_config('DVB_AV7110_FIRMWARE');
disable_config('DVB_CINERGYT2_TUNING');
disable_config('VIDEO_HELPER_CHIPS_AUTO');

View file

@ -1,12 +0,0 @@
--- /dev/null
+++ b/v4l/config-mycompat.h
@@ -0,0 +1,8 @@
+#undef smp_mb__after_atomic
+#define smp_mb__after_atomic() smp_mb() /*mb*/
+#undef NEED_SMP_MB_AFTER_ATOMIC
+#undef writel_relaxed
+#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
+#undef NEED_WRITEL_RELAXED
+#undef NEED_PM_RUNTIME_GET
+#undef NEED_OF_NODE_NAME_EQ
--

View file

@ -1,17 +0,0 @@
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -626,6 +626,12 @@ ($$)
close OUT;
# These options should default to off
+disable_config('MEDIA_ANALOG_TV_SUPPORT');
+disable_config('MEDIA_CAMERA_SUPPORT');
+disable_config('MEDIA_CEC_SUPPORT');
+disable_config('SOC_CAMERA');
+disable_config('VIDEO_SAA7146_VV');
+disable_config('RC_CORE');
disable_config('DVB_AV7110_FIRMWARE');
disable_config('DVB_CINERGYT2_TUNING');
disable_config('VIDEO_HELPER_CHIPS_AUTO');

View file

@ -1,13 +0,0 @@
--- a/v4l/versions.txt 2018-06-26 18:42:30.000000000 +0200
+++ b/v4l/versions.txt 2018-08-14 15:28:29.713517240 +0200
@@ -24,10 +24,6 @@
VIDEO_ADV748X
[4.7.0]
-# needs i2c_mux_alloc
-DVB_RTL2830
-DVB_RTL2832
-DVB_M88DS3103
# needs struct i2c_mux_core
DVB_AF9013

View file

@ -1,72 +0,0 @@
diff --git a/backports/v4.10_sched_signal.patch b/backports/v4.10_sched_signal.patch
index fbed946..59e275e 100644
--- a/backports/v4.10_sched_signal.patch
+++ b/backports/v4.10_sched_signal.patch
@@ -86,66 +86,6 @@
/* If you have already X v4l cards, then set this to X. This way
the device numbers stay matched. Example: you have a WinTV card
-diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h
-index 6b099da..81f3c19 100644
---- a/drivers/media/pci/ivtv/ivtv-driver.h
-+++ b/drivers/media/pci/ivtv/ivtv-driver.h
-@@ -39,38 +39,37 @@
- * using information provided by Jiun-Kuei Jung @ AVerMedia.
- */
-
--#include <linux/module.h>
--#include <linux/init.h>
-+#include <asm/byteorder.h>
- #include <linux/delay.h>
--#include <linux/sched/signal.h>
-+#include <linux/device.h>
- #include <linux/fs.h>
--#include <linux/pci.h>
--#include <linux/interrupt.h>
--#include <linux/spinlock.h>
- #include <linux/i2c.h>
- #include <linux/i2c-algo-bit.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
-+#include <linux/ivtv.h>
-+#include <linux/kernel.h>
-+#include <linux/kthread.h>
- #include <linux/list.h>
--#include <linux/unistd.h>
-+#include <linux/module.h>
-+#include <linux/mutex.h>
- #include <linux/pagemap.h>
-+#include <linux/pci.h>
- #include <linux/scatterlist.h>
--#include <linux/kthread.h>
--#include <linux/mutex.h>
-+#include <linux/sched.h>
- #include <linux/slab.h>
-+#include <linux/spinlock.h>
- #include <linux/uaccess.h>
--#include <asm/byteorder.h>
-+#include <linux/unistd.h>
-
--#include <linux/dvb/video.h>
--#include <linux/dvb/audio.h>
-+#include <media/drv-intf/cx2341x.h>
-+#include <media/i2c/ir-kbd-i2c.h>
-+#include <media/tuner.h>
- #include <media/v4l2-common.h>
--#include <media/v4l2-ioctl.h>
- #include <media/v4l2-ctrls.h>
- #include <media/v4l2-device.h>
- #include <media/v4l2-fh.h>
--#include <media/tuner.h>
--#include <media/drv-intf/cx2341x.h>
--#include <media/i2c/ir-kbd-i2c.h>
--
--#include <linux/ivtv.h>
-+#include <media/v4l2-ioctl.h>
-
- /* Memory layout */
- #define IVTV_ENCODER_OFFSET 0x00000000
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 5708f69..e306544 100644
--- a/drivers/media/pci/pt1/pt1.c

View file

@ -1,11 +0,0 @@
diff --git a/v4l/Makefile b/v4l/Makefile
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -51,7 +51,6 @@ default:: prepare firmware
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C ../linux apply_patches
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
- ./scripts/rmmod.pl check
# $(MAKE) checkpatch
mismatch:: prepare firmware

View file

@ -1,17 +0,0 @@
--- a/backports/backports.txt
+++ b/backports/backports.txt
@@ -31,6 +31,4 @@
add v4.18_add_map_atomic.patch
-[4.20.255]
-add v4.20_access_ok.patch
[4.17.255]
@@ -91,6 +89,5 @@
[4.1.255]
-add v4.1_pat_enabled.patch
add v4.1_drop_fwnode.patch
[4.0.255]
--

View file

@ -1,2 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

View file

@ -1,32 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8188EU"
PKG_VERSION="9a56f32c2a46be5b81f0eedf49ad44ea8f10bfae"
PKG_SHA256="c8f225ff85cdc49e4a043773234e42de38aac0d2c9322829dac21c2ba72fed87"
PKG_LICENSE="GPL"
# realtek: PKG_SITE="http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PFid=48&Level=5&Conn=4&ProdID=274&DownTypeID=3&GetDown=false&Downloads=true"
PKG_SITE="https://github.com/lwfinger/rtl8188eu"
PKG_URL="https://github.com/lwfinger/rtl8188eu/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL81xxEU Linux 3.x driver"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8192CU"
PKG_VERSION="f32ef3984db7c7f7644edec0fa28a63a47b1a7d6"
PKG_SHA256="7e8df7cce0918630121c7493a6333d392b3099b1126e8c355aa221cee032c80b"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/pvaret/rtl8192cu-fixes"
PKG_URL="$PKG_SITE/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL81xxCU Linux 3.x driver"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,12 +0,0 @@
diff -Naur RTL8192CU-v4.0.2_9000.20130911/hal/rtl8192c/usb/usb_halinit.c RTL8192CU-v4.0.2_9000.20130911.patch/hal/rtl8192c/usb/usb_halinit.c
--- RTL8192CU-v4.0.2_9000.20130911/hal/rtl8192c/usb/usb_halinit.c 2013-09-11 05:56:55.000000000 +0200
+++ RTL8192CU-v4.0.2_9000.20130911.patch/hal/rtl8192c/usb/usb_halinit.c 2014-04-01 20:17:59.270739417 +0200
@@ -3509,6 +3509,8 @@
pHalData->CustomerID = RT_CID_DLINK;
else if((pHalData->EEPROMVID == 0x2001) && (pHalData->EEPROMPID == 0x330a))
pHalData->CustomerID = RT_CID_DLINK;
+ else if((pHalData->EEPROMVID == 0x2001) && (pHalData->EEPROMPID == 0x330d))
+ pHalData->CustomerID = RT_CID_DLINK;
break;
case EEPROM_CID_WHQL:
/*

View file

@ -1,29 +0,0 @@
--- a/os_dep/linux/os_intfs.c 2013-09-11 05:56:55.000000000 +0200
+++ b/os_dep/linux/os_intfs.c 2013-11-12 00:30:41.158248277 +0100
@@ -277,6 +277,18 @@
#define RTW_PROC_NAME DRV_NAME
+#ifndef create_proc_entry
+/* dummy routines */
+void rtw_proc_remove_one(struct net_device *dev)
+{
+}
+
+void rtw_proc_init_one(struct net_device *dev)
+{
+}
+
+#else /* create_proc_entry not defined */
+
void rtw_proc_init_one(struct net_device *dev)
{
struct proc_dir_entry *dir_dev = NULL;
@@ -751,6 +763,7 @@
}
}
}
+#endif /* create_proc_entry not defined */
#endif
uint loadparam( _adapter *padapter, _nic_hdl pnetdev);

View file

@ -1,22 +0,0 @@
diff -Naur RTL8192CU-v4.0.2_9000.20130911/os_dep/linux/pci_intf.c RTL8192CU-v4.0.2_9000.20130911.patch/os_dep/linux/pci_intf.c
--- RTL8192CU-v4.0.2_9000.20130911/os_dep/linux/pci_intf.c 2013-09-11 05:56:55.000000000 +0200
+++ RTL8192CU-v4.0.2_9000.20130911.patch/os_dep/linux/pci_intf.c 2014-04-22 23:25:02.082908033 +0200
@@ -1963,7 +1963,6 @@
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_entry\n"));
DBG_871X("rtw driver version=%s\n", DRIVERVERSION);
- DBG_871X("Build at: %s %s\n", __DATE__, __TIME__);
pci_drvpriv.drv_registered = _TRUE;
rtw_suspend_lock_init();
diff -Naur RTL8192CU-v4.0.2_9000.20130911/os_dep/linux/usb_intf.c RTL8192CU-v4.0.2_9000.20130911.patch/os_dep/linux/usb_intf.c
--- RTL8192CU-v4.0.2_9000.20130911/os_dep/linux/usb_intf.c 2013-09-11 05:56:55.000000000 +0200
+++ RTL8192CU-v4.0.2_9000.20130911.patch/os_dep/linux/usb_intf.c 2014-04-22 23:25:21.337862827 +0200
@@ -1577,7 +1577,6 @@
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_entry\n"));
DBG_871X(DRV_NAME " driver version=%s\n", DRIVERVERSION);
- DBG_871X("build time: %s %s\n", __DATE__, __TIME__);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
//console_suspend_enabled=0;

View file

@ -1,25 +0,0 @@
diff -Naur RTL8192CU-v4.0.2_9000.20130911/include/ieee80211.h RTL8192CU-v4.0.2_9000.20130911.patch/include/ieee80211.h
--- RTL8192CU-v4.0.2_9000.20130911/include/ieee80211.h 2013-09-11 05:56:55.000000000 +0200
+++ RTL8192CU-v4.0.2_9000.20130911.patch/include/ieee80211.h 2015-11-03 14:05:03.789280151 +0100
@@ -1194,18 +1194,18 @@
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+static __inline int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

View file

@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8192DU"
PKG_VERSION="72b53f8a6c2a6696d60791df4455c3073fffc4e4"
PKG_SHA256="dec3cc45601c2c6dab47816523cb5a5731393d34cc75ec0f96a91191d3563fdd"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/lwfinger/rtl8192du"
PKG_URL="https://github.com/lwfinger/rtl8192du/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8192DU Linux 3.x driver"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,12 +0,0 @@
diff -Naur RTL8192DU-085e206/os_dep/usb_intf.c RTL8192DU-085e206.patch/os_dep/usb_intf.c
--- RTL8192DU-085e206/os_dep/usb_intf.c 2014-03-25 15:48:57.000000000 +0100
+++ RTL8192DU-085e206.patch/os_dep/usb_intf.c 2014-04-11 09:23:12.097223906 +0200
@@ -137,7 +137,7 @@
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8194)},/* 8192DU-VS */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8111)},/* Realtek 5G dongle for WiFi Display */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0193)},/* 8192DE-VAU */ \
- {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8171)},/* 8192DU-VC */ \
+/* {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8171)}, 8192DU-VC overlaps with in-kernel rtl8192se */ \
/*=== Customer ID ===*/ \
/****** 8192DU-VC ********/ \
{USB_DEVICE(0x2019, 0xAB2C)},/* PCI - Abocm */ \

View file

@ -1,64 +0,0 @@
From d295ee29d71a7969047fbe5042cec471408632c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Peron?=
<1859302+clementperon@users.noreply.github.com>
Date: Wed, 6 Jun 2018 17:40:54 +0200
Subject: [PATCH] Change __vfs_read_alt to __vfs_read
For kernel from 4.1 to 4.10 there is no call_read_iter used in new_sync_read.
Why create a new __vfs_read_alt whereas the __vfs_read is exported and seems to do exactly the same.
Remove __vfs_read_alt code and it's dependencies and use the __vfs_read function instead
---
os_dep/osdep_service.c | 32 +-------------------------------
1 file changed, 1 insertion(+), 31 deletions(-)
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 286096a..9dd3d2b 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -40,36 +40,6 @@ atomic_t _malloc_cnt = ATOMIC_INIT(0);
atomic_t _malloc_size = ATOMIC_INIT(0);
#endif /* DBG_MEMORY_LEAK */
-
-static ssize_t new_sync_read(struct file *filp, void __user *buf, __kernel_size_t len, loff_t *ppos)
-{
- struct iovec iov;
- struct kiocb kiocb;
- struct iov_iter iter;
- ssize_t ret;
-
- iov.iov_base = buf;
- iov.iov_len = len;
- init_sync_kiocb(&kiocb, filp);
- kiocb.ki_pos = *ppos;
- iov_iter_init(&iter, READ, &iov, 1, len);
-
- ret = call_read_iter(filp, &kiocb, &iter);
- BUG_ON(ret == -EIOCBQUEUED);
- *ppos = kiocb.ki_pos;
- return ret;
-}
-
-static ssize_t __vfs_read_alt(struct file *file, char __user *buf, size_t count,
- loff_t *pos)
-{
- if (file->f_op->read)
- return file->f_op->read(file, buf, count, pos);
- else if (file->f_op->read_iter)
- return new_sync_read(file, (void *)buf, (__kernel_size_t)count, pos);
- else
- return -EINVAL;
-}
/*
* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE
* @return: one of RTW_STATUS_CODE
@@ -1086,7 +1056,7 @@ static int readFile(struct file *fp,char *buf,int len)
while(sum<len) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
- rlen = __vfs_read_alt(fp, buf+sum, len-sum, &fp->f_pos);
+ rlen = __vfs_read(fp, buf+sum, len-sum, &fp->f_pos);
#else
rlen = fp->f_op->read(fp, buf+sum, len-sum, &fp->f_pos);
#endif

View file

@ -1,27 +0,0 @@
From 9e477ff7fb1626f188e0d3314799371a5cce8681 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Wed, 13 Jun 2018 18:54:09 +0100
Subject: [PATCH] fix vfs_read with 4.14.y+
---
os_dep/osdep_service.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 9dd3d2b..bd1df96 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -1055,7 +1055,9 @@ static int readFile(struct file *fp,char *buf,int len)
return -EPERM;
while(sum<len) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ rlen = kernel_read(fp, buf+sum, len-sum, &fp->f_pos);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
rlen = __vfs_read(fp, buf+sum, len-sum, &fp->f_pos);
#else
rlen = fp->f_op->read(fp, buf+sum, len-sum, &fp->f_pos);
--
2.14.1

View file

@ -1,29 +0,0 @@
From ad504e6bd4df0210904a10d57ddc48670bc41675 Mon Sep 17 00:00:00 2001
From: 5schatten <supervisedthinking@gmail.com>
Date: Thu, 21 Mar 2019 22:26:31 +0100
Subject: [PATCH] Revert "rtl8192du: Fix builds for kernels older than 4.11.0"
This reverts commit 01722435acb1d62c9453b86161d2d8b99d702648.
---
os_dep/osdep_service.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 9efffc4..99a424f 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -34,14 +34,6 @@
#define RT_TAG '1178'
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0))
-static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio,
- struct iov_iter *iter)
-{
- return file->f_op->read_iter(kio, iter);
-}
-#endif
-
#ifdef DBG_MEMORY_LEAK
#include <asm/atomic.h>
atomic_t _malloc_cnt = ATOMIC_INIT(0);

View file

@ -1,25 +0,0 @@
From fb85a57a5cd6241cc8c066c5efc5b43781b0e42d Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Wed, 13 Jun 2018 06:43:10 +0100
Subject: [PATCH] aarch64/4.4.y: implicit declaration of function
'csum_ipv6_magic'
---
core/rtw_br_ext.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c
index da9c5e5..19af0fe 100644
--- a/core/rtw_br_ext.c
+++ b/core/rtw_br_ext.c
@@ -51,6 +51,7 @@
#include <linux/icmpv6.h>
#include <net/ndisc.h>
#include <net/checksum.h>
+#include <net/ip6_checksum.h>
#endif
#endif
--
2.14.1

View file

@ -1,26 +0,0 @@
diff --git a/include/ieee80211.h b/include/ieee80211.h
index 3c28a0b..2268fbd 100644
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -969,18 +969,18 @@ enum ieee80211_state {
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+static __inline int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

View file

@ -1,32 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8192EU"
PKG_VERSION="0a7199b457b25edc4d9534158a068e486b1c8bb0"
PKG_SHA256="defee6fda236bc9d77cd5cf0ceca8e86f820a1f9fa5d63c5ca7c369be1a3513e"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/Mange/rtl8192eu-linux-driver"
PKG_URL="https://github.com/Mange/rtl8192eu-linux-driver/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8192EU Linux 3.x driver"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n \
USER_EXTRA_CFLAGS="-Wno-error=date-time"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,25 +0,0 @@
diff -Naur a/include/ieee80211.h b/include/ieee80211.h
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1314,18 +1314,18 @@
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+static __inline int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

View file

@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8812AU"
PKG_VERSION="d88d8b2e2a1b33ebdd62b8a5de307b37c39d8477"
PKG_SHA256="c5b2fcc6cbf6901e63f75ece49a8ce3219004536cfc585b9815b34d943c9f311"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/MilhouseVH/RTL8812AU"
PKG_URL="https://github.com/MilhouseVH/RTL8812AU/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8812AU Linux 3.x driver"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,38 +0,0 @@
From 92d01b516a77be6f21f6a3611c39f23e03fe4594 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Mon, 10 Jul 2017 20:11:37 +0100
Subject: [PATCH] fix multiple definitions
---
include/ieee80211.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/ieee80211.h b/include/ieee80211.h
index 7a50a07..84aad12 100644
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1481,18 +1481,18 @@ enum ieee80211_state {
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+static __inline int is_multicast_mac_addr(const u8 *addr)
{
return (addr[0] != 0xff) && (0x01 & addr[0]);
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
--
2.7.4

View file

@ -1,35 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8814AU"
PKG_VERSION="a0c44795f06d846b656ebac3310ba8f80f41333d"
PKG_SHA256="b4da15f5160cf402d6b2d274cb8bc9c77ca4b533df63a76c9109fe97233cec03"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/tpircher/rtl8814AU"
PKG_URL="https://github.com/tpircher/rtl8814AU/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="rtl8814AU-$PKG_VERSION*"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_SECTION="driver"
PKG_SHORTDESC="Realtek RTL8814AU Linux drivers"
PKG_LONGDESC="Realtek RTL8814AU Linux drivers"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,38 +0,0 @@
From 9e81b6a530a4ec156a1d517fe543fc43e9dacfc5 Mon Sep 17 00:00:00 2001
From: cdu13a <cdu13a@gmail.com>
Date: Fri, 12 Oct 2018 21:15:23 -0400
Subject: Fix Definitions
---
include/ieee80211.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/ieee80211.h b/include/ieee80211.h
index c374413..0743754 100644
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1388,18 +1388,18 @@ enum ieee80211_state {
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+static __inline int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
--
2.17.1

View file

@ -1,43 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="RTL8821CU"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/smp79/rtl8821CU"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_SECTION="driver"
PKG_LONGDESC="Realtek RTL8821CU Linux driver"
PKG_IS_KERNEL_PKG="yes"
case "$LINUX" in
amlogic-3.14)
PKG_VERSION="178fcbf4f1bf5b94580b5708016d0b2c2ded1720"
PKG_SHA256="29d3e053dd1fad37ee03de65e4ed2b25a4fb9aaf8bb6bd435da477753d03ad26"
PKG_URL="https://github.com/smp79/rtl8821CU/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="rtl8821CU-$PKG_VERSION*"
;;
amlogic-4.9|odroid-go-a-4.4)
PKG_VERSION="f7910283478ac1b508ff163d30e4b374bf99f7cb"
PKG_SHA256="b2128cbc23ecf9b17bbbd9652a2453d73403276a56b11eb8a795d168156cd53e"
PKG_URL="https://github.com/smp79/rtl8821CU/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="rtl8821CU-$PKG_VERSION*"
;;
esac
pre_make_target() {
unset LDFLAGS
}
make_target() {
make \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}

View file

@ -1,28 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020-present Team CoreELEC (https://coreelec.org)
PKG_NAME="RTL8152-aml"
PKG_VERSION="cee2df544a6013a8efe4ed1493f594ca50b8d3c8"
PKG_SHA256="fadfebca469e2203e5aee1c727a7e3916f85a3a5f499c08fce0138bc67c1c92e"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/bb-qq/r8152"
PKG_URL="https://github.com/bb-qq/r8152/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8152/RTL8153/RTL8156 Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
make_target() {
LDFLAGS="" make -C $(kernel_path) M=$PKG_BUILD \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,34 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8188EU-aml"
PKG_VERSION="2d358c5"
PKG_SHA256="adf31d56d3a94bca814f1bd0de24af61fae85d25a259124b5d16c1d23cc72c91"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8188eu"
PKG_URL="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8188eu/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8188EU Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/*/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/*/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/*/core/rtw_ieee80211.c
}
make_target() {
LDFLAGS="" make -C $(kernel_path) M=$PKG_BUILD/rtl8xxx_EU \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,29 +0,0 @@
From b67364bd4236f890238fb44df1bbba228b42ffe1 Mon Sep 17 00:00:00 2001
From: kszaq <kszaquitto@gmail.com>
Date: Mon, 2 Oct 2017 11:13:42 +0200
Subject: [PATCH] Add support for a few USB dongles
---
rtl8xxx_EU/os_dep/linux/usb_intf.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/rtl8xxx_EU/os_dep/linux/usb_intf.c b/rtl8xxx_EU/os_dep/linux/usb_intf.c
index 2fbffd6..4892838 100755
--- a/rtl8xxx_EU/os_dep/linux/usb_intf.c
+++ b/rtl8xxx_EU/os_dep/linux/usb_intf.c
@@ -138,6 +138,12 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
/*=== Customer ID ===*/
/****** 8188EUS ********/
{USB_DEVICE(0x07B8, 0x8179), .driver_info = RTL8188E}, /* Abocom - Abocom */
+ {USB_DEVICE(0x0DF6, 0x0076), .driver_info = RTL8188E}, /* Sitecom N150 v2 */
+ {USB_DEVICE(0x2001, 0x330F), .driver_info = RTL8188E}, /* DLink DWA-125 REV D1 */
+ {USB_DEVICE(0x2001, 0x3310), .driver_info = RTL8188E}, /* Dlink DWA-123 REV D1 */
+ {USB_DEVICE(0x2001, 0x3311), .driver_info = RTL8188E}, /* DLink GO-USB-N150 REV B1 */
+ {USB_DEVICE(0x056E, 0x4008), .driver_info = RTL8188E}, /* Elecom WDC-150SU2M */
+ {USB_DEVICE(0x2357, 0x010c), .driver_info = RTL8188E}, /* TP-Link TL-WN722N v2 */
#endif
#ifdef CONFIG_RTL8812A
--
2.7.4

View file

@ -1,38 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8189ES-aml"
PKG_VERSION="f971e4b"
PKG_SHA256="a87d891e3a42d70429b39f01216775dee95b0dc9093f9576ca7417e74f21ee2b"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8189es"
PKG_URL="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8189es/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8189ES Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/*/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/*/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/*/core/rtw_ieee80211.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD/rtl8189ES \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,39 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="RTL8189FS-aml"
PKG_VERSION="11cdc07dd29ab4055ec76974e246708ae8457605"
PKG_SHA256="ea777e31551fb54446d9591d19c4ada0ce0ba9a6655e0e55c60693dafc4a9801"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8189ftv"
PKG_URL="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8189ftv/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8189FS Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g' $PKG_BUILD/*/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/*/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/*/core/rtw_ieee80211.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD/rtl8189FS \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,38 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8723BS-aml"
PKG_VERSION="ee9d86a"
PKG_SHA256="4d1c5fe0d05edbf5eab96dfe5ff99b7d56c098f4d4d317351fa25e75606de094"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8723bs"
PKG_URL="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8723bs/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8723BS Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/*/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/*/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/*/core/rtw_ieee80211.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD/rtl8723BS \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,38 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8723DS-aml"
PKG_VERSION="fb4adf7"
PKG_SHA256="00da0a7773286df38e8785be2891025e4fa6c4ff5ace9450e54cae85f143847e"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8723ds"
PKG_URL="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8723ds/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8723DS Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/*/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/*/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/*/core/rtw_ieee80211.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD/rtl8723DS \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,40 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="RTL8822BS-aml"
PKG_VERSION="d2a5452a08084b3838083ba1eda3d1aeab82ee7c"
PKG_SHA256="31fafb5eb875de657c3316df1d72496958edfa16438248ec8f3661605f999ce1"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8822bs"
PKG_URL="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8822bs/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8822BU Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/*/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/*/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/*/core/rtw_ieee80211.c
sed -i 's/rtw_drv_log_level/0/g' $PKG_BUILD/rtl8822BS/core/*.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD/rtl8822BS \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,39 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="RTL8822BU-aml"
PKG_VERSION="b655ba8114d7def7e6181bfe4635fbb831e2b8d6"
PKG_SHA256="bbb6dab43a0e21654a7796ce07796677bbfda322d74b6a55dd08e3bde4953208"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_realtek_drivers_8822bu"
PKG_URL="https://github.com/cilynx/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8822BU Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/core/rtw_ieee80211.c
sed -i 's/rtw_drv_log_level/0/g' $PKG_BUILD/core/*.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,26 +0,0 @@
From c50e4cbf3d593f6dc3636b5afe295af215b8890c Mon Sep 17 00:00:00 2001
From: cdu13a <cdu13a@gmail.com>
Date: Thu, 16 Jul 2020 03:53:40 -0400
Subject: add more device id's
---
os_dep/linux/usb_intf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c
index 0c6f3e4..8bba83d 100644
--- a/os_dep/linux/usb_intf.c
+++ b/os_dep/linux/usb_intf.c
@@ -238,7 +238,8 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Alpha - Alpha*/
{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331c, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink DWA-182*/
{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0115, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T4U V3 */
- {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012d, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U V1 */
+ {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012d, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U V1 */
+ {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0138, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U Plus */
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xB822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax EW-7822ULC */
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xC822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax EW-7822UTC */
{USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1841, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS AC1300 USB-AC55 B1 */
--
2.17.1

View file

@ -1,40 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="RTL8822CS-aml"
PKG_VERSION="4e31d08990bc2a84c937bf17d5be4b899ceb70ed"
PKG_SHA256="6df2e60689830f454111e2cd2c2873c05c9ac8e0f39e8eb1934dbcac62263900"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/CoreELEC/RTL8822CS-aml"
PKG_URL="https://github.com/CoreELEC/RTL8822CS-aml/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL8822CS Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
post_unpack() {
sed -i 's/-DCONFIG_CONCURRENT_MODE//g; s/^CONFIG_POWER_SAVING.*$/CONFIG_POWER_SAVING = n/g; s/^CONFIG_RTW_DEBUG.*/CONFIG_RTW_DEBUG = n/g' $PKG_BUILD/rtl88x2CS/Makefile
sed -i 's/^#define CONFIG_DEBUG.*//g' $PKG_BUILD/rtl88x2CS/include/autoconf.h
sed -i 's/#define DEFAULT_RANDOM_MACADDR.*1/#define DEFAULT_RANDOM_MACADDR 0/g' $PKG_BUILD/rtl88x2CS/core/rtw_ieee80211.c
sed -i 's/rtw_drv_log_level/0/g' $PKG_BUILD/rtl88x2CS/core/*.c
}
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD/rtl88x2CS \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
USER_EXTRA_CFLAGS="-fgnu89-inline"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1 +0,0 @@
options dhd firmware_path=/usr/lib/firmware/brcm/ nvram_path=/usr/lib/firmware/brcm/

View file

@ -1 +0,0 @@
options dhd_sdio firmware_path=/usr/lib/firmware/brcm/ nvram_path=/usr/lib/firmware/brcm/

View file

@ -1,58 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-2018 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="ap6xxx-aml"
PKG_VERSION="ba2fbd0174b744521f4a25da796b9f62e9e4f7a7"
PKG_SHA256="60d9f755d2b4d2ae97ac09d92311d527718394e0c02af46b9cdcf30a0dc497b8"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/CoreELEC/ap6xxx-aml"
PKG_URL="https://github.com/CoreELEC/ap6xxx-aml/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="ap6xxx: Linux drivers for AP6xxx WLAN chips used in some devices based on Amlogic SoCs"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
pre_make_target() {
unset LDFLAGS
}
make_target() {
echo
echo "building ap6356s and others"
make -C $PKG_BUILD/bcmdhd.1.363.59.144.x.cn \
PWD=$PKG_BUILD/bcmdhd.1.363.59.144.x.cn \
KDIR=$(kernel_path) \
ARCH=$TARGET_KERNEL_ARCH \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_BCMDHD_DISABLE_WOWLAN=y \
clean dhd
if [ "$PROJECT" = "Amlogic-ng" ]; then
echo
echo "building ap6275s"
make -C $PKG_BUILD/bcmdhd.100.10.315.x \
PWD=$PKG_BUILD/bcmdhd.100.10.315.x \
KDIR=$(kernel_path) \
ARCH=$TARGET_KERNEL_ARCH \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_BCMDHD_DISABLE_WOWLAN=y \
clean bcmdhd_sdio
fi
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' \
-exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}
post_install() {
if [ "$PROJECT" = "Amlogic" ]; then
rm $INSTALL/usr/lib/modprobe.d/dhd_sdio.conf
rm $INSTALL/usr/lib/udev/rules.d/80-dhd_sdio.rules
fi
}

View file

@ -1,18 +0,0 @@
### Broadcom BCM43752 (AP6275S driver with dhd_sdio kernel module)
### by default kernel module dhd is loaded first and retries few
### times until dhd_sdio is loaded (after almost 2 minutes)
### to speed up load module manually
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:4497", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:4496", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:4495", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:A806", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:A804", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:AAE8", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:AAE7", GOTO="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", ENV{SDIO_ID}=="02D0:4362", GOTO="load_module"
GOTO="end"
LABEL="load_module"
ENV{MODALIAS}=="?*", ENV{SUBSYSTEM}=="sdio", RUN{builtin}+="kmod load dhd_sdio"
LABEL="end"

View file

@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="kvimfan-aml"
PKG_VERSION="1.0"
PKG_SHA256=""
PKG_LICENSE="GPL"
PKG_SITE=""
PKG_URL=""
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Khadas VIM2 fan control service"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
pre_make_target() {
unset LDFLAGS
}
make_target() {
kernel_make -C "$(kernel_path)" M="$PKG_BUILD"
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}
post_install() {
enable_service kvimfan.service
}

View file

@ -1,2 +0,0 @@
obj-m := khadas-fan.o

View file

@ -1,360 +0,0 @@
/*
* gpio-fan.c - driver for fans controlled by GPIO.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <linux/time.h>
#include <linux/workqueue.h>
#define KHADAS_FAN_TRIG_TEMP_LEVEL0 50 // 50 degree if not set
#define KHADAS_FAN_TRIG_TEMP_LEVEL1 60 // 60 degree if not set
#define KHADAS_FAN_TRIG_TEMP_LEVEL2 70 // 70 degree if not set
#define KHADAS_FAN_TRIG_MAXTEMP 80
#define KHADAS_FAN_LOOP_SECS 30 * HZ // 30 seconds
#define KHADAS_FAN_LOOP_PULSE 2 // 20 msec
#define KHADAS_FAN_TEST_LOOP_SECS 5 * HZ // 5 seconds
#define KHADAS_FAN_LOOP_NODELAY_SECS 0
#define KHADAS_FAN_GPIO_OFF 0
#define KHADAS_FAN_GPIO_ON 1
enum khadas_fan_mode {
KHADAS_FAN_STATE_MANUAL = 0,
KHADAS_FAN_STATE_AUTO,
};
enum khadas_fan_level {
KHADAS_FAN_LEVEL_0 = 0,
KHADAS_FAN_LEVEL_1,
KHADAS_FAN_LEVEL_2,
KHADAS_FAN_LEVEL_3,
};
enum khadas_fan_enable {
KHADAS_FAN_DISABLE = 0,
KHADAS_FAN_ENABLE,
};
struct khadas_fan_data {
struct platform_device *pdev;
struct class *class;
struct delayed_work work;
struct delayed_work fan_test_work;
enum khadas_fan_enable enable;
enum khadas_fan_mode mode;
enum khadas_fan_level level;
int ctrl_gpio0;
int ctrl_gpio1;
int trig_temp_level0;
int trig_temp_level1;
int trig_temp_level2;
int last_level;
int temp;
};
struct khadas_fan_data *fan_data = NULL;
void khadas_fan_level_set(struct khadas_fan_data *fan_data, int level )
{
if(3 == fan_data->last_level){
gpio_set_value(fan_data->ctrl_gpio0, KHADAS_FAN_GPIO_ON);
gpio_set_value(fan_data->ctrl_gpio1, KHADAS_FAN_GPIO_OFF);
}else if(2 == fan_data->last_level){
gpio_set_value(fan_data->ctrl_gpio0, KHADAS_FAN_GPIO_OFF);
gpio_set_value(fan_data->ctrl_gpio1, KHADAS_FAN_GPIO_ON);
}else if(1 == fan_data->last_level){
gpio_set_value(fan_data->ctrl_gpio0, KHADAS_FAN_GPIO_ON);
gpio_set_value(fan_data->ctrl_gpio1, KHADAS_FAN_GPIO_ON);
}else{
gpio_set_value(fan_data->ctrl_gpio0, KHADAS_FAN_GPIO_OFF);
gpio_set_value(fan_data->ctrl_gpio1, KHADAS_FAN_GPIO_OFF);
}
if (fan_data->last_level > 3 && level > 3)
fan_data->last_level--;
else
fan_data->last_level = level;
}
extern int get_cpu_temp(void);
static void fan_work_func(struct work_struct *_work)
{
struct khadas_fan_data *fan_data = container_of(_work,
struct khadas_fan_data, work.work);
int temp, level =1;
temp = get_cpu_temp();
if(temp < 0){
schedule_delayed_work(&fan_data->work, KHADAS_FAN_LOOP_PULSE);
return;
}
fan_data->temp = fan_data->temp ? (fan_data->temp + temp) / 2 : temp;
if (fan_data->temp < fan_data->trig_temp_level0)
level = 0;
else if (fan_data->temp < fan_data->trig_temp_level0 + 2)
level = 6;
else if (fan_data->temp < fan_data->trig_temp_level0 + 4)
level = 5;
else if (fan_data->temp < fan_data->trig_temp_level0 + 6)
level = 4;
else if (fan_data->temp < fan_data->trig_temp_level1)
level = 3;
else if (fan_data->temp < fan_data->trig_temp_level2)
level = 2;
khadas_fan_level_set(fan_data, level);
if (level > 3)
schedule_delayed_work(&fan_data->work, KHADAS_FAN_LOOP_PULSE);
else
schedule_delayed_work(&fan_data->work, KHADAS_FAN_LOOP_SECS);
}
static void khadas_fan_set(struct khadas_fan_data *fan_data)
{
cancel_delayed_work(&fan_data->work);
if (fan_data->enable == KHADAS_FAN_DISABLE) {
fan_data->last_level = 0;
khadas_fan_level_set(fan_data,0);
return;
}
switch (fan_data->mode) {
case KHADAS_FAN_STATE_MANUAL:
switch(fan_data->level){
case KHADAS_FAN_LEVEL_1:
fan_data->last_level = 3;
khadas_fan_level_set(fan_data,3);
break;
case KHADAS_FAN_LEVEL_2:
fan_data->last_level = 2;
khadas_fan_level_set(fan_data,2);
break;
case KHADAS_FAN_LEVEL_3:
fan_data->last_level = 1;
khadas_fan_level_set(fan_data,1);
break;
default:
fan_data->last_level = 0;
khadas_fan_level_set(fan_data,0);
break;
}
break;
case KHADAS_FAN_STATE_AUTO:
// FIXME: achieve with a better way
schedule_delayed_work(&fan_data->work, KHADAS_FAN_LOOP_PULSE);
break;
default:
break;
}
}
static ssize_t fan_enable_show(struct class *cls,
struct class_attribute *attr, char *buf)
{
return sprintf(buf, "Fan enable: %d\n", fan_data->enable);
}
static ssize_t fan_enable_store(struct class *cls, struct class_attribute *attr,
const char *buf, size_t count)
{
int enable;
if (kstrtoint(buf, 0, &enable))
return -EINVAL;
// 0: manual, 1: auto
if( enable >= 0 && enable < 2 ){
fan_data->enable = enable;
khadas_fan_set(fan_data);
}
return count;
}
static ssize_t fan_mode_show(struct class *cls,
struct class_attribute *attr, char *buf)
{
return sprintf(buf, "Fan mode: %d\n", fan_data->mode);
}
static ssize_t fan_mode_store(struct class *cls, struct class_attribute *attr,
const char *buf, size_t count)
{
int mode;
if (kstrtoint(buf, 0, &mode))
return -EINVAL;
// 0: manual, 1: auto
if( mode >= 0 && mode < 2 ){
fan_data->mode = mode;
khadas_fan_set(fan_data);
}
return count;
}
static ssize_t fan_level_show(struct class *cls,
struct class_attribute *attr, char *buf)
{
return sprintf(buf, "Fan level: %d\n", fan_data->level);
}
static ssize_t fan_level_store(struct class *cls, struct class_attribute *attr,
const char *buf, size_t count)
{
int level;
if (kstrtoint(buf, 0, &level))
return -EINVAL;
if( level >= 0 && level < 4){
fan_data->level = level;
fan_data->last_level = level;
khadas_fan_set(fan_data);
}
return count;
}
static ssize_t fan_temp_show(struct class *cls,
struct class_attribute *attr, char *buf)
{
int temp = -EINVAL;
temp = get_cpu_temp();
return sprintf(buf, "cpu_temp:%d \nFan trigger temperature: pulse-level:%d level0:%d level1:%d level2:%d\n",
temp, fan_data->trig_temp_level0, fan_data->trig_temp_level0 + 6, fan_data->trig_temp_level1, fan_data->trig_temp_level2);
}
static struct class_attribute fan_class_attrs[] = {
__ATTR(enable, 0644, fan_enable_show, fan_enable_store),
__ATTR(mode, 0644, fan_mode_show, fan_mode_store),
__ATTR(level, 0644, fan_level_show, fan_level_store),
__ATTR(temp, 0444, fan_temp_show, NULL),
};
static int khadas_fan_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
int ret;
int i;
printk("khadas_fan_probe\n");
fan_data = devm_kzalloc(dev, sizeof(struct khadas_fan_data), GFP_KERNEL);
if (!fan_data)
return -ENOMEM;
ret = of_property_read_u32(dev->of_node, "trig_temp_level0", &fan_data->trig_temp_level0);
if (ret < 0)
fan_data->trig_temp_level0 = KHADAS_FAN_TRIG_TEMP_LEVEL0;
ret = of_property_read_u32(dev->of_node, "trig_temp_level1", &fan_data->trig_temp_level1);
if (ret < 0)
fan_data->trig_temp_level1 = KHADAS_FAN_TRIG_TEMP_LEVEL1;
ret = of_property_read_u32(dev->of_node, "trig_temp_level2", &fan_data->trig_temp_level2);
if (ret < 0)
fan_data->trig_temp_level2 = KHADAS_FAN_TRIG_TEMP_LEVEL2;
fan_data->ctrl_gpio0 = of_get_named_gpio(dev->of_node, "fan_ctl0", 0);
fan_data->ctrl_gpio1 = of_get_named_gpio(dev->of_node, "fan_ctl1", 0);
if ((gpio_request(fan_data->ctrl_gpio0, "FAN") != 0)|| (gpio_request(fan_data->ctrl_gpio1, "FAN") != 0))
return -EIO;
gpio_direction_output(fan_data->ctrl_gpio0, KHADAS_FAN_GPIO_OFF);
gpio_direction_output(fan_data->ctrl_gpio1, KHADAS_FAN_GPIO_OFF);
fan_data->mode = KHADAS_FAN_STATE_AUTO;
fan_data->level = KHADAS_FAN_LEVEL_0;
fan_data->enable = KHADAS_FAN_ENABLE;
fan_data->last_level = 0;
fan_data->temp = 0;
INIT_DELAYED_WORK(&fan_data->work, fan_work_func);
khadas_fan_level_set(fan_data,0);
schedule_delayed_work(&fan_data->work, KHADAS_FAN_TEST_LOOP_SECS);
fan_data->pdev = pdev;
platform_set_drvdata(pdev, fan_data);
fan_data->class = class_create(THIS_MODULE, "fan");
if (IS_ERR(fan_data->class)) {
return PTR_ERR(fan_data->class);
}
for (i = 0; i < ARRAY_SIZE(fan_class_attrs); i++){
ret = class_create_file(fan_data->class, &fan_class_attrs[i]);
if(0!=ret){
printk("khadas_fan_probe,class_create_file%d failed \n", i);
}
}
dev_info(dev, "trigger temperature is level0:%d, level1:%d, level2:%d.\n", fan_data->trig_temp_level0, fan_data->trig_temp_level1, fan_data->trig_temp_level2);
return 0;
}
static int khadas_fan_remove(struct platform_device *pdev)
{
fan_data->enable = KHADAS_FAN_DISABLE;
khadas_fan_set(fan_data);
return 0;
}
static void khadas_fan_shutdown(struct platform_device *pdev)
{
fan_data->enable = KHADAS_FAN_DISABLE;
khadas_fan_set(fan_data);
}
#ifdef CONFIG_PM
static int khadas_fan_suspend(struct platform_device *pdev, pm_message_t state)
{
cancel_delayed_work(&fan_data->work);
fan_data->last_level = 0;
khadas_fan_level_set(fan_data, 0);
return 0;
}
static int khadas_fan_resume(struct platform_device *pdev)
{
khadas_fan_set(fan_data);
return 0;
}
#endif
static struct of_device_id of_khadas_fan_match[] = {
{ .compatible = "fanctl", },
{},
};
static struct platform_driver khadas_fan_driver = {
.probe = khadas_fan_probe,
#ifdef CONFIG_PM
.suspend = khadas_fan_suspend,
.resume = khadas_fan_resume,
#endif
.remove = khadas_fan_remove,
.shutdown = khadas_fan_shutdown,
.driver = {
.name = "fanctl",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(of_khadas_fan_match),
},
};
module_platform_driver(khadas_fan_driver);
MODULE_AUTHOR("kenny <kenny@khadas.com>");
MODULE_DESCRIPTION("khadas GPIO Fan driver");
MODULE_LICENSE("GPL");

View file

@ -1,12 +0,0 @@
[Unit]
Description=Khadas VIM fan control module loader
ConditionPathExists=/proc/device-tree/fan/compatible
After=kernel-overlays.service
[Service]
Type=oneshot
ExecStart=/bin/sh -c '[ `cat /proc/device-tree/fan/compatible` = "fanctl" ] && /sbin/modprobe khadas_fan'
RemainAfterExit=yes
[Install]
WantedBy=basic.target

View file

@ -1,17 +0,0 @@
amvdec_avs2
amvdec_avs
amvdec_mavs
amvdec_h264
amvdec_h264mvc
amvdec_h265
amvdec_mh264
amvdec_mjpeg
amvdec_mmjpeg
amvdec_mmpeg12
amvdec_mmpeg4
amvdec_mpeg12
amvdec_mpeg4
amvdec_ports
amvdec_real
amvdec_vc1
amvdec_vp9

View file

@ -1,45 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
PKG_NAME="media_modules-aml"
PKG_VERSION="7d412c8b21023c1b7372c7206f5d09208147044f"
PKG_SHA256="d7b632cbd71dc651c188cc7827f6d30ea570e8bc0b2eacf9d8e6462190b490dc"
PKG_LICENSE="GPL"
PKG_SITE="https://coreelec.org"
PKG_URL="https://github.com/CoreELEC/media_modules-aml/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="$PKG_NAME: Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
pre_make_target() {
unset LDFLAGS
}
make_target() {
kernel_make -C $(kernel_path) M=$PKG_BUILD/drivers \
CONFIG_AMLOGIC_MEDIA_VDEC_MPEG12=m \
CONFIG_AMLOGIC_MEDIA_VDEC_MPEG2_MULTI=m \
CONFIG_AMLOGIC_MEDIA_VDEC_MPEG4=m \
CONFIG_AMLOGIC_MEDIA_VDEC_MPEG4_MULTI=m \
CONFIG_AMLOGIC_MEDIA_VDEC_VC1=m \
CONFIG_AMLOGIC_MEDIA_VDEC_H264=m \
CONFIG_AMLOGIC_MEDIA_VDEC_H264_MULTI=m \
CONFIG_AMLOGIC_MEDIA_VDEC_H264_MVC=m \
CONFIG_AMLOGIC_MEDIA_VDEC_H265=m \
CONFIG_AMLOGIC_MEDIA_VDEC_VP9=m \
CONFIG_AMLOGIC_MEDIA_VDEC_MJPEG=m \
CONFIG_AMLOGIC_MEDIA_VDEC_MJPEG_MULTI=m \
CONFIG_AMLOGIC_MEDIA_VDEC_REAL=m \
CONFIG_AMLOGIC_MEDIA_VDEC_AVS=m \
CONFIG_AMLOGIC_MEDIA_VDEC_AVS_MULTI=m \
CONFIG_AMLOGIC_MEDIA_VDEC_AVS2=m \
CONFIG_AMLOGIC_MEDIA_VENC_H264=m \
CONFIG_AMLOGIC_MEDIA_VENC_H265=m
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
}

View file

@ -1,100 +0,0 @@
diff --git a/drivers/amvdec_ports/aml_vcodec_vfm.c b/drivers/amvdec_ports/aml_vcodec_vfm.c
index e7b85fb..6d1bdc2 100644
--- a/drivers/amvdec_ports/aml_vcodec_vfm.c
+++ b/drivers/amvdec_ports/aml_vcodec_vfm.c
@@ -57,8 +57,6 @@ static void vdec_vf_put(struct vframe_s *vf, void *op_arg)
return;
}
- atomic_set(&vf->use_cnt, 1);
-
vfq_push(&vfm->vf_que_recycle, vf);
/* schedule capture work. */
@@ -100,7 +98,7 @@ void video_vf_put(char *receiver, struct vdec_v4l2_buffer *fb, int id)
fb->m.mem[1].addr, fb->m.mem[1].size,
fb->m.mem[2].addr, fb->m.mem[2].size);
- if (vfp && vf && atomic_dec_and_test(&vf->use_cnt))
+ if (vfp && vf)
vf_put(vf, receiver);
}
diff --git a/drivers/amvdec_ports/decoder/vdec_h264_if.c b/drivers/amvdec_ports/decoder/vdec_h264_if.c
index 02848b8..6a3d076 100644
--- a/drivers/amvdec_ports/decoder/vdec_h264_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_h264_if.c
@@ -593,8 +593,6 @@ static void vdec_h264_get_vf(struct vdec_h264_inst *inst, struct vdec_v4l2_buffe
return;
}
- atomic_set(&vf->use_cnt, 1);
-
fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle;
fb->vf_handle = (unsigned long)vf;
fb->status = FB_ST_DISPLAY;
diff --git a/drivers/amvdec_ports/decoder/vdec_hevc_if.c b/drivers/amvdec_ports/decoder/vdec_hevc_if.c
index 59ce85f..11a1d6f 100644
--- a/drivers/amvdec_ports/decoder/vdec_hevc_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_hevc_if.c
@@ -407,8 +407,6 @@ static void vdec_hevc_get_vf(struct vdec_hevc_inst *inst, struct vdec_v4l2_buffe
return;
}
- atomic_set(&vf->use_cnt, 1);
-
fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle;
fb->vf_handle = (unsigned long)vf;
fb->status = FB_ST_DISPLAY;
diff --git a/drivers/amvdec_ports/decoder/vdec_mjpeg_if.c b/drivers/amvdec_ports/decoder/vdec_mjpeg_if.c
index 8bc5faa..fda0b33 100644
--- a/drivers/amvdec_ports/decoder/vdec_mjpeg_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_mjpeg_if.c
@@ -352,8 +352,6 @@ static void vdec_mjpeg_get_vf(struct vdec_mjpeg_inst *inst, struct vdec_v4l2_buf
return;
}
- atomic_set(&vf->use_cnt, 1);
-
fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle;
fb->vf_handle = (unsigned long)vf;
fb->status = FB_ST_DISPLAY;
diff --git a/drivers/amvdec_ports/decoder/vdec_mpeg12_if.c b/drivers/amvdec_ports/decoder/vdec_mpeg12_if.c
index cdde95b..ce76cec 100644
--- a/drivers/amvdec_ports/decoder/vdec_mpeg12_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_mpeg12_if.c
@@ -344,8 +344,6 @@ static void vdec_mpeg12_get_vf(struct vdec_mpeg12_inst *inst, struct vdec_v4l2_b
return;
}
- atomic_set(&vf->use_cnt, 1);
-
fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle;
fb->vf_handle = (unsigned long)vf;
fb->status = FB_ST_DISPLAY;
diff --git a/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c b/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c
index 7a40a4a..80a140b 100644
--- a/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c
@@ -353,8 +353,6 @@ static void vdec_mpeg4_get_vf(struct vdec_mpeg4_inst *inst, struct vdec_v4l2_buf
return;
}
- atomic_set(&vf->use_cnt, 1);
-
fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle;
fb->vf_handle = (unsigned long)vf;
fb->status = FB_ST_DISPLAY;
diff --git a/drivers/amvdec_ports/decoder/vdec_vp9_if.c b/drivers/amvdec_ports/decoder/vdec_vp9_if.c
index 5b3bbab..823426c 100644
--- a/drivers/amvdec_ports/decoder/vdec_vp9_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_vp9_if.c
@@ -397,8 +397,6 @@ static void vdec_vp9_get_vf(struct vdec_vp9_inst *inst, struct vdec_v4l2_buffer
return;
}
- atomic_set(&vf->use_cnt, 1);
-
fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle;
fb->vf_handle = (unsigned long)vf;
fb->status = FB_ST_DISPLAY;

View file

@ -1,43 +0,0 @@
From b99d31bfbc2cc973355ab5541908f0ee820b24fa Mon Sep 17 00:00:00 2001
From: Portisch <hugo.portisch@yahoo.de>
Date: Fri, 27 Dec 2019 20:11:58 +0100
Subject: [PATCH] multi decoders: limit maximum number of decoder in parallel
to 1 Kodi can only handle one decoder (12/2019). Because of threading
issues in Kodi it is needed to limit the multi decoder instances to a
maximum of 1. If Kodi do implement multiple decoder support in parallel
this decoder limit needs to be reverted.
---
drivers/frame_provider/decoder/utils/vdec.h | 2 +-
drivers/frame_provider/decoder/utils/vdec_profile.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/frame_provider/decoder/utils/vdec.h b/drivers/frame_provider/decoder/utils/vdec.h
index 18d7cd1..56f044a 100644
--- a/drivers/frame_provider/decoder/utils/vdec.h
+++ b/drivers/frame_provider/decoder/utils/vdec.h
@@ -45,7 +45,7 @@ struct device *get_vdec_device(void);
int vdec_module_init(void);
void vdec_module_exit(void);
-#define MAX_INSTANCE_MUN 9
+#define MAX_INSTANCE_MUN 1
#define VDEC_DEBUG_SUPPORT
diff --git a/drivers/frame_provider/decoder/utils/vdec_profile.c b/drivers/frame_provider/decoder/utils/vdec_profile.c
index d00987a..55e5213 100644
--- a/drivers/frame_provider/decoder/utils/vdec_profile.c
+++ b/drivers/frame_provider/decoder/utils/vdec_profile.c
@@ -42,8 +42,6 @@ static uint dec_time_stat_reset;
struct dentry *root, *event;
-#define MAX_INSTANCE_MUN 9
-
struct vdec_profile_time_stat_s {
int time_6ms_less_cnt;
int time_6_9ms_cnt;
--
2.17.1

View file

@ -1,33 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="mt7601u-aml"
PKG_VERSION="4e61a61"
PKG_SHA256="814a63d8654f87a76cc06425ad2120daa32646f5220341a26296e4a6643b013a"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_mtk_drivers_mt7601"
PKG_URL="https://github.com/khadas/android_hardware_wifi_mtk_drivers_mt7601/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="mt7601u Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make -C $(kernel_path) M=$PKG_BUILD \
ARCH=$TARGET_KERNEL_ARCH \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
mkdir -p $INSTALL/$(get_full_firmware_dir)
cp $PKG_BUILD/RT2870STA_7601.dat $INSTALL/$(get_full_firmware_dir)
}

View file

@ -1,13 +0,0 @@
diff --git a/include/os/rt_linux.h b/include/os/rt_linux.h
index 0303698..36dd603 100755
--- a/include/os/rt_linux.h
+++ b/include/os/rt_linux.h
@@ -159,7 +159,7 @@ typedef struct usb_ctrlrequest devctrlrequest;
#ifdef ALLWINNER
#define STA_PROFILE_PATH "/system/vendor/modules/RT2870STA_7601.dat"
#else
-#define STA_PROFILE_PATH "/system/etc/wifi/RT2870STA_7601.dat"
+#define STA_PROFILE_PATH "/lib/firmware/RT2870STA_7601.dat"
#endif
#define STA_DRIVER_VERSION "JEDI.L0.MP1.mt7601u.v1.2"
#define DRIVER_ROLE "STA"

View file

@ -1,35 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="mt7603u-aml"
PKG_VERSION="0c53dfb"
PKG_SHA256="9e3eab02f3c3dd7de373c5d631c2069771e6ad783ecda36a484030ab4ec0ccec"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/khadas/android_hardware_wifi_mtk_drivers_mt7603"
PKG_URL="https://github.com/khadas/android_hardware_wifi_mtk_drivers_mt7603/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="mt7603u Linux driver"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make LINUX_SRC=$(kernel_path) \
ARCH=$TARGET_KERNEL_ARCH \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
RT28xx_DIR=$PKG_BUILD \
-f $PKG_BUILD/Makefile
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
mkdir -p $INSTALL/$(get_full_firmware_dir)
cp $PKG_BUILD/conf/MT7603USTA.dat $INSTALL/$(get_full_firmware_dir)
}

Some files were not shown because too many files have changed in this diff Show more