All of lore.kernel.org
 help / color / mirror / Atom feed
* [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params()
@ 2013-01-13 19:31 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-01-13 19:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Michael Krufky, Devin Heitmueller, Tim Gardner, linux-media,
	kernel-janitors

There is a missing break so we use XC_RF_MODE_CABLE instead of
XC_RF_MODE_AIR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff.  Untested.

diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index dc93cf3..d6be1b6 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -785,6 +785,7 @@ static int xc5000_set_params(struct dvb_frontend *fe)
 			return -EINVAL;
 		}
 		priv->rf_mode = XC_RF_MODE_AIR;
+		break;
 	case SYS_DVBC_ANNEX_A:
 	case SYS_DVBC_ANNEX_C:
 		dprintk(1, "%s() QAM modulation\n", __func__);

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

* [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params()
@ 2013-01-13 19:31 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-01-13 19:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Michael Krufky, Devin Heitmueller, Tim Gardner, linux-media,
	kernel-janitors

There is a missing break so we use XC_RF_MODE_CABLE instead of
XC_RF_MODE_AIR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff.  Untested.

diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index dc93cf3..d6be1b6 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -785,6 +785,7 @@ static int xc5000_set_params(struct dvb_frontend *fe)
 			return -EINVAL;
 		}
 		priv->rf_mode = XC_RF_MODE_AIR;
+		break;
 	case SYS_DVBC_ANNEX_A:
 	case SYS_DVBC_ANNEX_C:
 		dprintk(1, "%s() QAM modulation\n", __func__);

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

* Re: [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params()
  2013-01-13 19:31 ` Dan Carpenter
@ 2013-02-05 23:00   ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2013-02-05 23:00 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael Krufky, Devin Heitmueller, Tim Gardner, linux-media,
	kernel-janitors

Em Sun, 13 Jan 2013 22:31:33 +0300
Dan Carpenter <dan.carpenter@oracle.com> escreveu:

> There is a missing break so we use XC_RF_MODE_CABLE instead of
> XC_RF_MODE_AIR.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Untested.
> 
> diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
> index dc93cf3..d6be1b6 100644
> --- a/drivers/media/tuners/xc5000.c
> +++ b/drivers/media/tuners/xc5000.c
> @@ -785,6 +785,7 @@ static int xc5000_set_params(struct dvb_frontend *fe)
>  			return -EINVAL;
>  		}
>  		priv->rf_mode = XC_RF_MODE_AIR;
> +		break;

There one small change with this patch. On this part of the code:

static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode)
{
        dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode,
                rf_mode == XC_RF_MODE_AIR ? "ANTENNA" : "CABLE");

        if ((rf_mode != XC_RF_MODE_AIR) && (rf_mode != XC_RF_MODE_CABLE)) {
                rf_mode = XC_RF_MODE_CABLE;
                printk(KERN_ERR
                        "%s(), Invalid mode, defaulting to CABLE",
                        __func__);
        }
        return xc_write_reg(priv, XREG_SIGNALSOURCE, rf_mode);
}

It will set the value for XREG_SIGNALSOURCE with a different value.

While I didn't test it, such change makes sense, by looking at xc5000
"open source" datasheet.

So, it looks correct on my eyes.

While the datasheet doesn't give any glue, my guess is that changing from
"cable" to "air" will just optimize the tuner's sensibility for either
air (where signals can be weaker) or cable, so I bet that the effects of
a change like that won't be easily noticed.

I'll apply it, in order to give people some chance to test it.

Cheers,
Mauro

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

* Re: [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params()
@ 2013-02-05 23:00   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2013-02-05 23:00 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael Krufky, Devin Heitmueller, Tim Gardner, linux-media,
	kernel-janitors

Em Sun, 13 Jan 2013 22:31:33 +0300
Dan Carpenter <dan.carpenter@oracle.com> escreveu:

> There is a missing break so we use XC_RF_MODE_CABLE instead of
> XC_RF_MODE_AIR.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Untested.
> 
> diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
> index dc93cf3..d6be1b6 100644
> --- a/drivers/media/tuners/xc5000.c
> +++ b/drivers/media/tuners/xc5000.c
> @@ -785,6 +785,7 @@ static int xc5000_set_params(struct dvb_frontend *fe)
>  			return -EINVAL;
>  		}
>  		priv->rf_mode = XC_RF_MODE_AIR;
> +		break;

There one small change with this patch. On this part of the code:

static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode)
{
        dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode,
                rf_mode = XC_RF_MODE_AIR ? "ANTENNA" : "CABLE");

        if ((rf_mode != XC_RF_MODE_AIR) && (rf_mode != XC_RF_MODE_CABLE)) {
                rf_mode = XC_RF_MODE_CABLE;
                printk(KERN_ERR
                        "%s(), Invalid mode, defaulting to CABLE",
                        __func__);
        }
        return xc_write_reg(priv, XREG_SIGNALSOURCE, rf_mode);
}

It will set the value for XREG_SIGNALSOURCE with a different value.

While I didn't test it, such change makes sense, by looking at xc5000
"open source" datasheet.

So, it looks correct on my eyes.

While the datasheet doesn't give any glue, my guess is that changing from
"cable" to "air" will just optimize the tuner's sensibility for either
air (where signals can be weaker) or cable, so I bet that the effects of
a change like that won't be easily noticed.

I'll apply it, in order to give people some chance to test it.

Cheers,
Mauro

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

end of thread, other threads:[~2013-02-05 23:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-13 19:31 [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params() Dan Carpenter
2013-01-13 19:31 ` Dan Carpenter
2013-02-05 23:00 ` Mauro Carvalho Chehab
2013-02-05 23:00   ` Mauro Carvalho Chehab

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.