All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: si2168: add parameter to disable DVB-T support
@ 2019-03-08 22:21 Stefan Becker
  2019-03-16  8:59 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Becker @ 2019-03-08 22:21 UTC (permalink / raw)
  To: linux-media; +Cc: Antti Palosaari, Mauro Carvalho Chehab, 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.

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: si2168: add parameter to disable DVB-T support
  2019-03-08 22:21 [PATCH] media: si2168: add parameter to disable DVB-T support Stefan Becker
@ 2019-03-16  8:59 ` Sean Young
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2019-03-16  8:59 UTC (permalink / raw)
  To: Stefan Becker; +Cc: linux-media, Antti Palosaari, Mauro Carvalho Chehab

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-16  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08 22:21 [PATCH] media: si2168: add parameter to disable DVB-T support Stefan Becker
2019-03-16  8:59 ` Sean Young

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.