summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw88/rtw8723d.c
diff options
context:
space:
mode:
authorPing-Ke Shih <pkshih@realtek.com>2020-04-20 13:50:53 +0800
committerKalle Valo <kvalo@codeaurora.org>2020-04-21 15:59:23 +0300
commit44baa97ca820dbc81dfde076937d15bc725a3a54 (patch)
treeef03db79864a82e48d7641b679b64af743b66709 /drivers/net/wireless/realtek/rtw88/rtw8723d.c
parent1afb5eb7a00dab15551bbfb24c4e8a750da21827 (diff)
rtw88: 8723d: Add new chip op efuse_grant() to control efuse access
8723D devices need to grant efuse access before dumping physical efuse map, other chips don't need it, so keep this ops as blank. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200420055054.14592-8-yhchuang@realtek.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/rtw8723d.c')
-rw-r--r--drivers/net/wireless/realtek/rtw88/rtw8723d.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.c b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
index 04f8d73e4e6c..756454d69fad 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -28,11 +28,24 @@ static void rtw8723d_cfg_ldo25(struct rtw_dev *rtwdev, bool enable)
rtw_write8(rtwdev, REG_LDO_EFUSE_CTRL + 3, ldo_pwr);
}
+static void rtw8723d_efuse_grant(struct rtw_dev *rtwdev, bool on)
+{
+ if (on) {
+ rtw_write8(rtwdev, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON);
+
+ rtw_write16_set(rtwdev, REG_SYS_FUNC_EN, BIT_FEN_ELDR);
+ rtw_write16_set(rtwdev, REG_SYS_CLKR, BIT_LOADER_CLK_EN | BIT_ANA8M);
+ } else {
+ rtw_write8(rtwdev, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF);
+ }
+}
+
static struct rtw_chip_ops rtw8723d_ops = {
.read_rf = rtw_phy_read_rf_sipi,
.write_rf = rtw_phy_write_rf_reg_sipi,
.set_antenna = NULL,
.cfg_ldo25 = rtw8723d_cfg_ldo25,
+ .efuse_grant = rtw8723d_efuse_grant,
.config_bfee = NULL,
.set_gid_table = NULL,
.cfg_csi_rate = NULL,