I don't know if this will help or not, because I use these drivers with Tvheadend on a separate system, that is running on Ubuntu Server. So this is how I build the drivers in Ubuntu, which may or may not work with LibreELEC. I suspect at the very least it will require some modification, or may not be applicable at all - you are talking about a patch file and I am not sure exactly what you are referring to. But anyway this is the script I have to run (using sudo) every time there is a Ubuntu kernel update:
#! /bin/bash
(( UID != 0 )) && { echo "Error: needs root (use sudo)"; exit 1; } #Use this to check for root
cd /usr/src
rm -rf old-media || { echo "Error deleting old-media directory"; exit 1; }
mv media old-media || { echo "Error renaming /usr/src/media to old-media"; exit 1; }
rm -rf old-media_build || { echo "Error deleting old-media directory"; exit 1; }
mv media_build old-media_build || { echo "Error renaming /usr/src/media_build to old-media_build"; exit 1; }
git clone https://github.com/tbsdtv/media_build.git || { echo "Error running git clone"; exit 1; }
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media || { echo "Error running git clone --depth=1"; exit 1; }
cd media_build || { echo "Error changing to /usr/src/media_build directory"; exit 1; }
# nano backports/backports.txt
sed -i 's/^add v6.8-ccs.patch/# add v6.8-ccs.patch/' backports/backports.txt || { echo "Error commenting out add v6.8-ccs.patch in /usr/src/media_build/backports/backports.txt"; exit 1; }
make dir DIR=../media || { echo "Error creating new /usr/src/media directory"; exit 1; }
make allyesconfig || { echo "Error running make allyesconfig"; exit 1; }
sed -i -r 's/(^CONFIG.*_RC.*=)./\1n/g' v4l/.config || { echo "Error doing first sed replacement"; exit 1; }
sed -i -r 's/(^CONFIG.*_IR.*=)./\1n/g' v4l/.config || { echo "Error doing second sed replacement"; exit 1; }
make -j4 || { echo "Error running make -j4"; exit 1; }
make install || { echo "Error running make install"; exit 1; }
read -p "Reboot (y/N)? "
[[ "$REPLY" == y ]] && reboot
Display More
Note the script backs up the current media and media_build directories before replacing them, just in case you might need them for some reason. I don't know why you would since they will no longer work after a kernel update but I just like the security of not totally blowing them away. If the make -j4 fails try just make, it will be slower but it may succeed. And, don't be surprised if you see a lot of error messages fly by, that Git archive must contain drivers for every device ever made by TBS and possibly a few related companies, and many of those drivers appear to be old and unsupported so they throw a lot of warnings and errors, but as long as the drivers for your TBS6985 card build correctly that's all that is necessary (and I do have a TBS6985 card, and it works for me). I have found that it's best to just go do something else while the script runs, if it makes it to the "Reboot (y/N)?" prompt you should be good to go after a reboot, but if you sit and watch it run you will swear it's never going to succeed with all the errors and warnings it throws.
Oh, and one other word of advice, if you find the card is flaky or that recordings fail part way through, it may be it is sharing interrupts (IRQs) with another device and that will cause all kinds of issues with that card. LibreELEC may take steps to make sure that doesn't happen, but in case they don't see this article: Do you run one or more TBS PCIe cards under Linux? Check your IRQs…
Hope this helps!
(By the way, I am not a programmer or a coder, so please don't ask me to explain all this, I had a lot of help with it and now I am in my senior years so even a lot of what I once knew I've forgotten!)