[media] cxd2841er: force 8MHz bandwidth for DVB-C if specified bw not supported
authorAbylay Ospan <aospan@netup.ru>
Thu, 21 Jul 2016 13:56:25 +0000 (10:56 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 22 Sep 2016 15:47:57 +0000 (12:47 -0300)
if specified DVB-C bandwidth not supported then force 8MHz.
Should work for most cases.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/cxd2841er.c

index 0b64158c306ec0321d6e5f60f7471947a846fc26..5afb9c508f657df6162560b776e5c276d9fd9d12 100644 (file)
@@ -2763,6 +2763,14 @@ static int cxd2841er_sleep_tc_to_active_c_band(struct cxd2841er_priv *priv,
        u8 b10_b6[3];
        u32 iffreq;
 
+       if (bandwidth != 6000000 &&
+                       bandwidth != 7000000 &&
+                       bandwidth != 8000000) {
+               dev_info(&priv->i2c->dev, "%s(): unsupported bandwidth %d. Forcing 8Mhz!\n",
+                               __func__, bandwidth);
+               bandwidth = 8000000;
+       }
+
        dev_dbg(&priv->i2c->dev, "%s() bw=%d\n", __func__, bandwidth);
        cxd2841er_write_reg(priv, I2C_SLVT, 0x00, 0x10);
        switch (bandwidth) {