Skip to contentSkip to conversation

media: si2168: add parameter to disable DVB-T support

PATCH NAK Stefan Becker 2 participants 2 messages Mar 8, 2019 – Mar 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: si2168: add parameter to disable DVB-T support

Some DVB clients are broken and only recognize the DVB-T/T2 support in the frontend. Thus they are unable to use the frontend in DVB-C mode. One example is the incomplete DVBv5 API support added in mythtv 0.30:

https://code.mythtv.org/trac/ticket/12638

The boolean module parameter "disable_dvb_t" removes DVB-T and DVB-T2 from the delsys list in dvb_frontend_ops and thus forces the client to recognize a DVB-C frontend.

---
 drivers/media/dvb-frontends/si2168.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/dvb-frontends/si2168.c +9 -0
index 324493e05f9f..8aeb024057dc 100644
@@ -14,10 +14,15 @@
  *    GNU General Public License for more details.
  */
 
+#include <linux/module.h>
 #include <linux/delay.h>
 
 #include "si2168_priv.h"
 
+static bool disable_dvb_t;
+module_param(disable_dvb_t, bool, 0644);
+MODULE_PARM_DESC(disable_dvb_t, "Disable DVB-T/T2 support (default: enabled)");
+
 static const struct dvb_frontend_ops si2168_ops;
 
 /* execute firmware command */
@@ -800,6 +805,10 @@ static int si2168_probe(struct i2c_client *client,
 
 	/* create dvb_frontend */
 	memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));
+	if (disable_dvb_t) {
+		memset(dev->fe.ops.delsys, 0, sizeof(dev->fe.ops.delsys));
+		dev->fe.ops.delsys[0] = SYS_DVBC_ANNEX_A;
+	}
 	dev->fe.demodulator_priv = client;
 	*config->i2c_adapter = dev->muxc->adapter[0];
 	*config->fe = &dev->fe;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 9 lines · Stefan Becker

Some DVB clients are broken and only recognize the DVB-T/T2 support in the frontend. Thus they are unable to use the frontend in DVB-C mode. One example is the incomplete DVBv5 API support added in mythtv 0.30:

   https://code.mythtv.org/trac/ticket/12638

The boolean module parameter "disable_dvb_t" removes DVB-T and DVB-T2 from the delsys list in dvb_frontend_ops and thus forces the client to recognize a DVB-C frontend.

This is wrong in a few ways. DVBv5 has been around for sometime and clients really should be updated by now. If if there were an option to disable DVB-T and DVB-T2 then that would not exist in a specific frontend.

NAK

Sean

Quoted 39 lines
---
 drivers/media/dvb-frontends/si2168.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/dvb-frontends/si2168.c +9 -0
index 324493e05f9f..8aeb024057dc 100644
@@ -14,10 +14,15 @@
  *    GNU General Public License for more details.
  */
 
+#include <linux/module.h>
 #include <linux/delay.h>
 
 #include "si2168_priv.h"
 
+static bool disable_dvb_t;
+module_param(disable_dvb_t, bool, 0644);
+MODULE_PARM_DESC(disable_dvb_t, "Disable DVB-T/T2 support (default: enabled)");
+
 static const struct dvb_frontend_ops si2168_ops;
 
 /* execute firmware command */
@@ -800,6 +805,10 @@ static int si2168_probe(struct i2c_client *client,
 
 	/* create dvb_frontend */
 	memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));
+	if (disable_dvb_t) {
+		memset(dev->fe.ops.delsys, 0, sizeof(dev->fe.ops.delsys));
+		dev->fe.ops.delsys[0] = SYS_DVBC_ANNEX_A;
+	}
 	dev->fe.demodulator_priv = client;
 	*config->i2c_adapter = dev->muxc->adapter[0];
 	*config->fe = &dev->fe;
Signature · 1 line
2.20.1