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

rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection()

So far this is just for 8723BU. It includes writing to a number of
registers I have seen no description for so far.

0x0064
0x0930
0x0944
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 22a31d45
...@@ -2670,6 +2670,38 @@ static void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv) ...@@ -2670,6 +2670,38 @@ static void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv)
} }
} }
static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
{
u32 val32;
val32 = rtl8xxxu_read32(priv, 0x64);
val32 &= ~(BIT(20) | BIT(24));
rtl8xxxu_write32(priv, 0x64, val32);
val32 = rtl8xxxu_read32(priv, REG_GPIO_MUXCFG);
val32 &= ~BIT(4);
val32 |= BIT(3);
rtl8xxxu_write32(priv, REG_GPIO_MUXCFG, val32);
val32 = rtl8xxxu_read32(priv, REG_LEDCFG0);
val32 &= ~BIT(23);
val32 |= BIT(24);
rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
val32 = rtl8xxxu_read32(priv, 0x0944);
val32 |= (BIT(0) | BIT(1));
rtl8xxxu_write32(priv, 0x0944, val32);
val32 = rtl8xxxu_read32(priv, 0x0930);
val32 &= 0xffffff00;
val32 |= 0x77;
rtl8xxxu_write32(priv, 0x0930, val32);
val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
val32 |= BIT(11);
rtl8xxxu_write32(priv, REG_PWR_DATA, val32);
}
static int static int
rtl8xxxu_init_mac(struct rtl8xxxu_priv *priv, struct rtl8xxxu_reg8val *array) rtl8xxxu_init_mac(struct rtl8xxxu_priv *priv, struct rtl8xxxu_reg8val *array)
{ {
...@@ -4621,6 +4653,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw) ...@@ -4621,6 +4653,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write32(priv, REG_HIMR1, 0x00); rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
} }
if (priv->fops->phy_init_antenna_selection)
priv->fops->phy_init_antenna_selection(priv);
ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table); ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
dev_dbg(dev, "%s: init_mac %i\n", __func__, ret); dev_dbg(dev, "%s: init_mac %i\n", __func__, ret);
if (ret) if (ret)
...@@ -6380,6 +6415,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = { ...@@ -6380,6 +6415,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.load_firmware = rtl8723bu_load_firmware, .load_firmware = rtl8723bu_load_firmware,
.power_on = rtl8723au_power_on, .power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_auto_llt_table, .llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.writeN_block_size = 1024, .writeN_block_size = 1024,
}; };
......
...@@ -764,5 +764,6 @@ struct rtl8xxxu_fileops { ...@@ -764,5 +764,6 @@ struct rtl8xxxu_fileops {
int (*load_firmware) (struct rtl8xxxu_priv *priv); int (*load_firmware) (struct rtl8xxxu_priv *priv);
int (*power_on) (struct rtl8xxxu_priv *priv); int (*power_on) (struct rtl8xxxu_priv *priv);
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page); int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
int writeN_block_size; int writeN_block_size;
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册