Skip to content

Commit

Permalink
rtw88: 8822c: add FW IQK support
Browse files Browse the repository at this point in the history
Add support for doing IQK in firmware

Ideally the RF component's I/Q vectors should be orthogonal,
but usually they are not. So we need to calibrate for the RF
components, ex. PA/LNA, ADC/DAC.

And if the I/Q vectors are more orthogonal, the mixed signal
will have less deviation. This helps with those rates with
higher modulation (MCS8-9), because they have more strict
EVM/SNR requirement. Also the better of the quality of the
signal, the longer it can propagate, and the better throughput
performance we can get.

Signed-off-by: Yan-Hsuan Chuang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
Yan-Hsuan Chuang authored and Kalle Valo committed Sep 13, 2019
1 parent bc61ae9 commit 1ac3294
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/net/wireless/realtek/rtw88/rtw8822c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,22 @@ static void rtw8822c_false_alarm_statistics(struct rtw_dev *rtwdev)

static void rtw8822c_do_iqk(struct rtw_dev *rtwdev)
{
struct rtw_iqk_para para = {0};
u8 iqk_chk;
int counter;

para.clear = 1;
rtw_fw_do_iqk(rtwdev, &para);

for (counter = 0; counter < 300; counter++) {
iqk_chk = rtw_read8(rtwdev, REG_RPT_CIP);
if (iqk_chk == 0xaa)
break;
msleep(20);
}
rtw_write8(rtwdev, REG_IQKSTAT, 0x0);

rtw_dbg(rtwdev, RTW_DBG_RFK, "iqk counter=%d\n", counter);
}

/* for coex */
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/realtek/rtw88/rtw8822c.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ struct rtw8822c_efuse {
#define REG_TXF7 0x1ab0
#define REG_CCK_SOURCE 0x1abc
#define BIT_NBI_EN BIT(30)
#define REG_IQKSTAT 0x1b10
#define REG_TXANT 0x1c28
#define REG_ENCCK 0x1c3c
#define BIT_CCK_BLK_EN BIT(1)
Expand All @@ -197,6 +198,7 @@ struct rtw8822c_efuse {
#define REG_OFDM_FACNT3 0x2d0c
#define REG_OFDM_FACNT4 0x2d10
#define REG_OFDM_FACNT5 0x2d20
#define REG_RPT_CIP 0x2d9c
#define REG_OFDM_TXCNT 0x2de0
#define REG_ORITXCODE2 0x4100
#define REG_3WIRE2 0x410c
Expand Down

0 comments on commit 1ac3294

Please sign in to comment.