I am attempting to build the linux drivers for a Raspberrry Pi 3 with osmc installed, for a TBS5280 DVB-T2/T Freeview HD Dual Tuner USB TV.
The driver source has been taken from https://github.com/tbsdtv/media_build.git
uname -r => 4.4.27-2-osmc
The build fails in media_build/v4l/si2168.c with errors:
tbsdriver/media_build/v4l/si2168.c: In function 'si2168_select':
tbsdriver/media_build/v4l/si2168.c:670:9: error: implicit declaration of function 'i2c_mux_priv' [-Werror=implicit-function-declaration]
struct i2c_client *client = i2c_mux_priv(muxc);
^
tbsdriver/media_build/v4l/si2168.c:670:30: warning: initialization makes pointer from integer without a cast
struct i2c_client *client = i2c_mux_priv(muxc);
^
tbsdriver/media_build/v4l/si2168.c: In function 'si2168_deselect':
tbsdriver/media_build/v4l/si2168.c:690:30: warning: initialization makes pointer from integer without a cast
struct i2c_client *client = i2c_mux_priv(muxc);
^
tbsdriver/media_build/v4l/si2168.c: In function 'si2168_probe':
tbsdriver/media_build/v4l/si2168.c:817:2: error: implicit declaration of function 'i2c_mux_alloc' [-Werror=implicit-function-declaration]
dev->muxc = i2c_mux_alloc(client->adapter, &client->dev,
^
tbsdriver/media_build/v4l/si2168.c:818:13: error: 'I2C_MUX_LOCKED' undeclared (first use in this function)
1, 0, I2C_MUX_LOCKED,
^
tbsdriver/media_build/v4l/si2168.c:818:13: note: each undeclared identifier is reported only once for each function it appears in
tbsdriver/media_build/v4l/si2168.c:824:11: error: dereferencing pointer to incomplete type
dev->muxc->priv = client;
^
tbsdriver/media_build/v4l/si2168.c:825:2: error: implicit declaration of function 'i2c_mux_add_adapter' [-Werror=implicit-function-declaration]
ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0);
^
tbsdriver/media_build/v4l/si2168.c:832:34: error: dereferencing pointer to incomplete type
*config->i2c_adapter = dev->muxc->adapter[0];
^
tbsdriver/media_build/v4l/si2168.c: In function 'si2168_remove':
tbsdriver/media_build/v4l/si2168.c:866:2: error: implicit declaration of function 'i2c_mux_del_adapters' [-Werror=implicit-function-declaration]
i2c_mux_del_adapters(dev->muxc);
^
Looking in si2183.c, I find these calls are wrapped in #defines
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
and I had hoped I could insert these #defines and the appropriate code into si2168.c, however it is not that simple a diff (the block at si2183.c:1458 does not have an exact analogue in si2168.c)
Can anyone help with backporting this code to a 4.4 kernel ?
It also occurred to me that si2168 may not be required for the TBS5280 DVB-T2/T. Is there a method to just build the drivers for this ?
Thanks