rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 29 Feb 2016 22:04:51 +0000 (17:04 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 10 Mar 2016 13:29:05 +0000 (15:29 +0200)
The 8723bu does not like REG_AFE_XTAL_CTRL being set, so skip this for
now, to match the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c

index 9b5b768ee33bae0c475b8271ee636ea2307f72c0..a41f7f0e5b0baf07973a3ba83ec636a3bda0c8d0 100644 (file)
@@ -2998,6 +2998,7 @@ static int rtl8xxxu_init_phy_regs(struct rtl8xxxu_priv *priv,
 static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
 {
        u8 val8, ldoa15, ldov12d, lpldo, ldohci12;
+       u16 val16;
        u32 val32;
 
        /*
@@ -3018,16 +3019,18 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
                udelay(2);
        }
 
-       val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
-       val8 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
-       rtl8xxxu_write8(priv, REG_SYS_FUNC, val8);
+       val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+       val16 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
+       rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
 
-       /* AFE_XTAL_RF_GATE (bit 14) if addressing as 32 bit register */
-       val32 = rtl8xxxu_read32(priv, REG_AFE_XTAL_CTRL);
-       val32 &= ~AFE_XTAL_RF_GATE;
-       if (priv->has_bluetooth)
-               val32 &= ~AFE_XTAL_BT_GATE;
-       rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
+       if (priv->rtlchip != 0x8723b) {
+               /* AFE_XTAL_RF_GATE (bit 14) if addressing as 32 bit register */
+               val32 = rtl8xxxu_read32(priv, REG_AFE_XTAL_CTRL);
+               val32 &= ~AFE_XTAL_RF_GATE;
+               if (priv->has_bluetooth)
+                       val32 &= ~AFE_XTAL_BT_GATE;
+               rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
+       }
 
        /* 6. 0x1f[7:0] = 0x07 */
        val8 = RF_ENABLE | RF_RSTB | RF_SDMRSTB;