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

Message ID 20190308222148.15194-1-chemobejk@gmail.com (mailing list archive)
State Rejected, archived
Delegated to: Sean Young
Headers

Commit Message

Stefan Becker March 8, 2019, 10:21 p.m. UTC
  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.

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 drivers/media/dvb-frontends/si2168.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Sean Young March 16, 2019, 8:59 a.m. UTC | #1
On Sat, Mar 09, 2019 at 12:21:48AM +0200, Stefan Becker wrote:
> 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

> 
> Signed-off-by: Stefan Becker <chemobejk@gmail.com>
> ---
>  drivers/media/dvb-frontends/si2168.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
> index 324493e05f9f..8aeb024057dc 100644
> --- a/drivers/media/dvb-frontends/si2168.c
> +++ b/drivers/media/dvb-frontends/si2168.c
> @@ -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;
> -- 
> 2.20.1
  

Patch

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 324493e05f9f..8aeb024057dc 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -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;