I don’t have my OSMC working directory / modified images anymore - cleaned everything and only got a kernel.deb file left. As previously reported it’s useless in my scenario and I already have optimized/stripped self-compiled FFmpeg & Kodi under my Linux arm distro - SoftFloat that are performing better/faster than OSMC.
Sorry, I cannot:
Ever since I originally patched stb0899_drv.c I was using the source from the media_tree and not the
one from the official kernel tree - which has some more modifications, but still doesn’t work without the patch.
The patch itself was created for the source from media_tree!
Every time (in the last 2 years or so) I was upgrading the kernel I just substituted the stb0899_drv.c that came with the kernel with my patched one, then recompiled the stb0899_drv.c driver only.
Original file from media_tree that I was first patching and still using:
https://git.linuxtv.org/media_tree.git/plain/drivers/media/dvb-frontends/stb0899_drv.c
It hasn’t been modified since 2014:
https://git.linuxtv.org/media_tree.git/log/?qt=grep&q=stb0899_drv.c
And here is the patch (diff):
diff -u stb0899_drv.c stb0899_drv-PATCHED_OK.c > stb0899_drv.patch
cat stb0899_drv.patch
--- stb0899_drv.c 2017-09-12 23:19:21.000000000 +0300
+++ stb0899_drv-PATCHED_OK.c 2017-09-12 23:11:01.184163331 +0300
@@ -306,19 +306,22 @@
.len = 6
};
- struct i2c_msg msg_1 = {
- .addr = state->config->demod_address,
- .flags = 0,
- .buf = buf_1,
- .len = 2
- };
- struct i2c_msg msg_r = {
- .addr = state->config->demod_address,
- .flags = I2C_M_RD,
- .buf = buf,
- .len = 4
- };
+ struct i2c_msg msg[] = {
+ {
+ .addr = state->config->demod_address,
+ .flags = 0,
+ .buf = buf_1,
+ .len = 2
+ }, {
+ .addr = state->config->demod_address,
+ .flags = I2C_M_RD,
+ .buf = buf,
+ .len = 4
+ }
+ };
+
+
tmpaddr = stb0899_reg_offset & 0xff00;
if (!(stb0899_reg_offset & 0x8))
@@ -327,6 +330,8 @@
buf_1[0] = GETBYTE(tmpaddr, BYTE1);
buf_1[1] = GETBYTE(tmpaddr, BYTE0);
+ /* Write address */
+
status = i2c_transfer(state->i2c, &msg_0, 1);
if (status < 1) {
if (status != -ERESTARTSYS)
@@ -337,28 +342,16 @@
}
/* Dummy */
- status = i2c_transfer(state->i2c, &msg_1, 1);
- if (status < 1)
- goto err;
-
- status = i2c_transfer(state->i2c, &msg_r, 1);
- if (status < 1)
+ status = i2c_transfer(state->i2c, msg, 2);
+ if (status < 2)
goto err;
buf_1[0] = GETBYTE(stb0899_reg_offset, BYTE1);
buf_1[1] = GETBYTE(stb0899_reg_offset, BYTE0);
/* Actual */
- status = i2c_transfer(state->i2c, &msg_1, 1);
- if (status < 1) {
- if (status != -ERESTARTSYS)
- printk(KERN_ERR "%s ERR(2), Device=[0x%04x], Base address=[0x%08x], Offset=[0x%04x], Status=%d\n",
- __func__, stb0899_i2cdev, stb0899_base_addr, stb0899_reg_offset, status);
- goto err;
- }
-
- status = i2c_transfer(state->i2c, &msg_r, 1);
- if (status < 1) {
+ status = i2c_transfer(state->i2c, msg, 2);
+ if (status < 2) {
if (status != -ERESTARTSYS)
printk(KERN_ERR "%s ERR(3), Device=[0x%04x], Base address=[0x%08x], Offset=[0x%04x], Status=%d\n",
__func__, stb0899_i2cdev, stb0899_base_addr, stb0899_reg_offset, status);
@@ -485,8 +478,15 @@
(((reg & 0xff00) == 0xf200) || ((reg & 0xff00) == 0xf600)))
_stb0899_read_reg(state, (reg | 0x00ff));
- dprintk(state->verbose, FE_DEBUGREG, 1,
- "%s [0x%04x]: %*ph", __func__, reg, count, buf);
+ if (unlikely(*state->verbose >= FE_DEBUGREG)) {
+ int i;
+
+ printk(KERN_DEBUG "%s [0x%04x]:", __func__, reg);
+ for (i = 0; i < count; i++) {
+ printk(" %02x", buf[i]);
+ }
+ printk("\n");
+ }
return 0;
err:
@@ -515,8 +515,14 @@
buf[1] = reg & 0xff;
memcpy(&buf[2], data, count);
- dprintk(state->verbose, FE_DEBUGREG, 1,
- "%s [0x%04x]: %*ph", __func__, reg, count, data);
+ if (unlikely(*state->verbose >= FE_DEBUGREG)) {
+ int i;
+
+ printk(KERN_DEBUG "%s [0x%04x]:", __func__, reg);
+ for (i = 0; i < count; i++)
+ printk(" %02x", data[i]);
+ printk("\n");
+ }
ret = i2c_transfer(state->i2c, &i2c_msg, 1);
/*
@@ -601,19 +607,13 @@
return 0;
}
-static void stb0899_detach(struct dvb_frontend *fe)
-{
- struct stb0899_state *state = fe->demodulator_priv;
-
- /* post process event */
- stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0);
-}
-
static void stb0899_release(struct dvb_frontend *fe)
{
struct stb0899_state *state = fe->demodulator_priv;
dprintk(state->verbose, FE_DEBUG, 1, "Release Frontend");
+ /* post process event */
+ stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0);
kfree(state);
}
@@ -1579,7 +1579,7 @@
return DVBFE_ALGO_CUSTOM;
}
-static const struct dvb_frontend_ops stb0899_ops = {
+static struct dvb_frontend_ops stb0899_ops = {
.delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS },
.info = {
.name = "STB0899 Multistandard",
@@ -1596,7 +1596,6 @@
FE_CAN_QPSK
},
- .detach = stb0899_detach,
.release = stb0899_release,
.init = stb0899_init,
.sleep = stb0899_sleep,
The official kernel tree driver file was modified 2016 and I’ve never used it, actually it doesn’t work with the Technisat DVB adapter, nor did I attempt to patch it! The patch is rejected and I’m not a maintainer but just a simple (happy too - got a working DVB adapter) user
https://github.com/torvalds/linux/blob/master/drivers/media/dvb-frontends/stb0899_drv.c