Skip to contentSkip to conversation

tuners/xc5000: fix MODE_AIR in xc5000_set_params()

media Dan Carpenter 2 participants 2 messages Jan 13, 2013 – Feb 5, 2013

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

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

---
Static checker stuff. Untested.

drivers/media/tuners/xc5000.c +1 -0
index dc93cf3..d6be1b6 100644
@@ -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__);
#1 lore raw

Em Sun, 13 Jan 2013 22:31:33 +0300
Dan Carpenter <[email protected]> escreveu:

Quoted 12 lines

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

---
Static checker stuff. Untested.

drivers/media/tuners/xc5000.c +0 -0
index dc93cf3..d6be1b6 100644

drivers/media/tuners/xc5000.c static int xc5000_set_params(struct dvb_frontend *fe) · line 788

Quoted 4 lines
drivers/media/tuners/xc5000.c +1 -0
@@ -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