Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtw88: 8723d: Add cfg_ldo25 to control LDO25

Implement rtw_chip_ops::cfg_ldo25 to enable/disable LDO25 with proper
voltage.

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-7-yhchuang@realtek.com

authored by

Ping-Ke Shih and committed by
Kalle Valo
1afb5eb7 9874f685

+21 -1
+5
drivers/net/wireless/realtek/rtw88/reg.h
··· 37 37 #define REG_LDO_EFUSE_CTRL 0x0034 38 38 #define BIT_MASK_EFUSE_BANK_SEL (BIT(8) | BIT(9)) 39 39 40 + #define BIT_LDO25_VOLTAGE_V25 0x03 41 + #define BIT_MASK_LDO25_VOLTAGE GENMASK(6, 4) 42 + #define BIT_SHIFT_LDO25_VOLTAGE 4 43 + #define BIT_LDO25_EN BIT(7) 44 + 40 45 #define REG_GPIO_MUXCFG 0x0040 41 46 #define BIT_FSPI_EN BIT(19) 42 47 #define BIT_BT_AOD_GPIO3 BIT(9)
+15
drivers/net/wireless/realtek/rtw88/rtw8723d.c
··· 14 14 #include "reg.h" 15 15 #include "debug.h" 16 16 17 + static void rtw8723d_cfg_ldo25(struct rtw_dev *rtwdev, bool enable) 18 + { 19 + u8 ldo_pwr; 20 + 21 + ldo_pwr = rtw_read8(rtwdev, REG_LDO_EFUSE_CTRL + 3); 22 + if (enable) { 23 + ldo_pwr &= ~BIT_MASK_LDO25_VOLTAGE; 24 + ldo_pwr = (BIT_LDO25_VOLTAGE_V25 << 4) | BIT_LDO25_EN; 25 + } else { 26 + ldo_pwr &= ~BIT_LDO25_EN; 27 + } 28 + rtw_write8(rtwdev, REG_LDO_EFUSE_CTRL + 3, ldo_pwr); 29 + } 30 + 17 31 static struct rtw_chip_ops rtw8723d_ops = { 18 32 .read_rf = rtw_phy_read_rf_sipi, 19 33 .write_rf = rtw_phy_write_rf_reg_sipi, 20 34 .set_antenna = NULL, 35 + .cfg_ldo25 = rtw8723d_cfg_ldo25, 21 36 .config_bfee = NULL, 22 37 .set_gid_table = NULL, 23 38 .cfg_csi_rate = NULL,
+1 -1
drivers/net/wireless/realtek/rtw88/rtw8822b.c
··· 1030 1030 u8 ldo_pwr; 1031 1031 1032 1032 ldo_pwr = rtw_read8(rtwdev, REG_LDO_EFUSE_CTRL + 3); 1033 - ldo_pwr = enable ? ldo_pwr | BIT(7) : ldo_pwr & ~BIT(7); 1033 + ldo_pwr = enable ? ldo_pwr | BIT_LDO25_EN : ldo_pwr & ~BIT_LDO25_EN; 1034 1034 rtw_write8(rtwdev, REG_LDO_EFUSE_CTRL + 3, ldo_pwr); 1035 1035 } 1036 1036