提交 c7a5a190 编写于 作者: J Jes Sorensen 提交者: Kalle Valo

rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration

Newer generation chips require the firmware be notified before we
start the IQK calibration.
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 8da91571
...@@ -1497,7 +1497,7 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, ...@@ -1497,7 +1497,7 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv,
} while (retry--); } while (retry--);
if (!retry) { if (!retry) {
dev_dbg(dev, "%s: Mailbox busy\n", __func__); dev_info(dev, "%s: Mailbox busy\n", __func__);
retval = -EBUSY; retval = -EBUSY;
goto error; goto error;
} }
...@@ -3877,6 +3877,20 @@ static void rtl8xxxu_phy_iqcalibrate(struct rtl8xxxu_priv *priv, ...@@ -3877,6 +3877,20 @@ static void rtl8xxxu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
} }
} }
static void rtl8xxxu_prepare_calibrate(struct rtl8xxxu_priv *priv, u8 start)
{
struct h2c_cmd h2c;
if (priv->fops->mbox_ext_width < 4)
return;
memset(&h2c, 0, sizeof(struct h2c_cmd));
h2c.bt_wlan_calibration.cmd = H2C_8723B_BT_WLAN_CALIBRATION;
h2c.bt_wlan_calibration.data = start;
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_wlan_calibration));
}
static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv) static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
{ {
struct device *dev = &priv->udev->dev; struct device *dev = &priv->udev->dev;
...@@ -3888,6 +3902,8 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv) ...@@ -3888,6 +3902,8 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
s32 reg_tmp = 0; s32 reg_tmp = 0;
bool simu; bool simu;
rtl8xxxu_prepare_calibrate(priv, 1);
memset(result, 0, sizeof(result)); memset(result, 0, sizeof(result));
candidate = -1; candidate = -1;
...@@ -3975,6 +3991,8 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv) ...@@ -3975,6 +3991,8 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg, rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg,
priv->bb_recovery_backup, RTL8XXXU_BB_REGS); priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
rtl8xxxu_prepare_calibrate(priv, 0);
} }
static void rtl8723a_phy_lc_calibrate(struct rtl8xxxu_priv *priv) static void rtl8723a_phy_lc_calibrate(struct rtl8xxxu_priv *priv)
......
...@@ -727,6 +727,10 @@ struct h2c_cmd { ...@@ -727,6 +727,10 @@ struct h2c_cmd {
u8 arg; u8 arg;
__le16 mask_lo; __le16 mask_lo;
} __packed ramask; } __packed ramask;
struct {
u8 cmd;
u8 data;
} __packed bt_wlan_calibration;
}; };
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册