Commit 0b8db87d authored by Yan-Hsuan Chuang's avatar Yan-Hsuan Chuang Committed by Kalle Valo

rtw88: use rtw_phy_pg_cfg_pair struct, not arrays

Use proper struct for BB PG tables.

TODO: we need to find a way to store the tables that have
      condition values.
Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 7436a470
......@@ -20,15 +20,6 @@ union phy_table_tile {
struct phy_cfg_pair cfg;
};
struct phy_pg_cfg_pair {
u32 band;
u32 rf_path;
u32 tx_num;
u32 addr;
u32 bitmask;
u32 data;
};
static const u32 db_invert_table[12][8] = {
{10, 13, 16, 20,
25, 32, 40, 50},
......@@ -1226,10 +1217,8 @@ static void rtw_phy_store_tx_power_by_rate(struct rtw_dev *rtwdev,
void rtw_parse_tbl_bb_pg(struct rtw_dev *rtwdev, const struct rtw_table *tbl)
{
const struct phy_pg_cfg_pair *p = tbl->data;
const struct phy_pg_cfg_pair *end = p + tbl->size / 6;
BUILD_BUG_ON(sizeof(struct phy_pg_cfg_pair) != sizeof(u32) * 6);
const struct rtw_phy_pg_cfg_pair *p = tbl->data;
const struct rtw_phy_pg_cfg_pair *end = p + tbl->size;
for (; p < end; p++) {
if (p->addr == 0xfe || p->addr == 0xffe) {
......
......@@ -66,6 +66,15 @@ struct rtw_txpwr_lmt_cfg_pair {
s8 txpwr_lmt;
};
struct rtw_phy_pg_cfg_pair {
u32 band;
u32 rf_path;
u32 tx_num;
u32 addr;
u32 bitmask;
u32 data;
};
#define RTW_DECL_TABLE_PHY_COND_CORE(name, cfg, path) \
const struct rtw_table name ## _tbl = { \
.data = name, \
......
......@@ -1762,53 +1762,53 @@ static const u32 rtw8822c_bb[] = {
RTW_DECL_TABLE_PHY_COND(rtw8822c_bb, rtw_phy_cfg_bb);
static const u32 rtw8822c_bb_pg_type0[] = {
0, 0, 0, 0x00000c20, 0xffffffff, 0x484c5054,
0, 0, 0, 0x00000c24, 0xffffffff, 0x54585c60,
0, 0, 0, 0x00000c28, 0xffffffff, 0x44484c50,
0, 0, 0, 0x00000c2c, 0xffffffff, 0x5054585c,
0, 0, 0, 0x00000c30, 0xffffffff, 0x4044484c,
0, 0, 1, 0x00000c34, 0xffffffff, 0x5054585c,
0, 0, 1, 0x00000c38, 0xffffffff, 0x4044484c,
0, 0, 0, 0x00000c3c, 0xffffffff, 0x5054585c,
0, 0, 0, 0x00000c40, 0xffffffff, 0x4044484c,
0, 0, 0, 0x00000c44, 0xffffffff, 0x585c383c,
0, 0, 1, 0x00000c48, 0xffffffff, 0x484c5054,
0, 0, 1, 0x00000c4c, 0xffffffff, 0x383c4044,
0, 1, 0, 0x00000e20, 0xffffffff, 0x484c5054,
0, 1, 0, 0x00000e24, 0xffffffff, 0x54585c60,
0, 1, 0, 0x00000e28, 0xffffffff, 0x44484c50,
0, 1, 0, 0x00000e2c, 0xffffffff, 0x5054585c,
0, 1, 0, 0x00000e30, 0xffffffff, 0x4044484c,
0, 1, 1, 0x00000e34, 0xffffffff, 0x5054585c,
0, 1, 1, 0x00000e38, 0xffffffff, 0x4044484c,
0, 1, 0, 0x00000e3c, 0xffffffff, 0x5054585c,
0, 1, 0, 0x00000e40, 0xffffffff, 0x4044484c,
0, 1, 0, 0x00000e44, 0xffffffff, 0x585c383c,
0, 1, 1, 0x00000e48, 0xffffffff, 0x484c5054,
0, 1, 1, 0x00000e4c, 0xffffffff, 0x383c4044,
1, 0, 0, 0x00000c24, 0xffffffff, 0x54585c60,
1, 0, 0, 0x00000c28, 0xffffffff, 0x44484c50,
1, 0, 0, 0x00000c2c, 0xffffffff, 0x5054585c,
1, 0, 0, 0x00000c30, 0xffffffff, 0x4044484c,
1, 0, 1, 0x00000c34, 0xffffffff, 0x5054585c,
1, 0, 1, 0x00000c38, 0xffffffff, 0x4044484c,
1, 0, 0, 0x00000c3c, 0xffffffff, 0x5054585c,
1, 0, 0, 0x00000c40, 0xffffffff, 0x4044484c,
1, 0, 0, 0x00000c44, 0xffffffff, 0x585c383c,
1, 0, 1, 0x00000c48, 0xffffffff, 0x484c5054,
1, 0, 1, 0x00000c4c, 0xffffffff, 0x383c4044,
1, 1, 0, 0x00000e24, 0xffffffff, 0x54585c60,
1, 1, 0, 0x00000e28, 0xffffffff, 0x44484c50,
1, 1, 0, 0x00000e2c, 0xffffffff, 0x5054585c,
1, 1, 0, 0x00000e30, 0xffffffff, 0x4044484c,
1, 1, 1, 0x00000e34, 0xffffffff, 0x5054585c,
1, 1, 1, 0x00000e38, 0xffffffff, 0x4044484c,
1, 1, 0, 0x00000e3c, 0xffffffff, 0x5054585c,
1, 1, 0, 0x00000e40, 0xffffffff, 0x4044484c,
1, 1, 0, 0x00000e44, 0xffffffff, 0x585c383c,
1, 1, 1, 0x00000e48, 0xffffffff, 0x484c5054,
1, 1, 1, 0x00000e4c, 0xffffffff, 0x383c4044
static const struct rtw_phy_pg_cfg_pair rtw8822c_bb_pg_type0[] = {
{ 0, 0, 0, 0x00000c20, 0xffffffff, 0x484c5054, },
{ 0, 0, 0, 0x00000c24, 0xffffffff, 0x54585c60, },
{ 0, 0, 0, 0x00000c28, 0xffffffff, 0x44484c50, },
{ 0, 0, 0, 0x00000c2c, 0xffffffff, 0x5054585c, },
{ 0, 0, 0, 0x00000c30, 0xffffffff, 0x4044484c, },
{ 0, 0, 1, 0x00000c34, 0xffffffff, 0x5054585c, },
{ 0, 0, 1, 0x00000c38, 0xffffffff, 0x4044484c, },
{ 0, 0, 0, 0x00000c3c, 0xffffffff, 0x5054585c, },
{ 0, 0, 0, 0x00000c40, 0xffffffff, 0x4044484c, },
{ 0, 0, 0, 0x00000c44, 0xffffffff, 0x585c383c, },
{ 0, 0, 1, 0x00000c48, 0xffffffff, 0x484c5054, },
{ 0, 0, 1, 0x00000c4c, 0xffffffff, 0x383c4044, },
{ 0, 1, 0, 0x00000e20, 0xffffffff, 0x484c5054, },
{ 0, 1, 0, 0x00000e24, 0xffffffff, 0x54585c60, },
{ 0, 1, 0, 0x00000e28, 0xffffffff, 0x44484c50, },
{ 0, 1, 0, 0x00000e2c, 0xffffffff, 0x5054585c, },
{ 0, 1, 0, 0x00000e30, 0xffffffff, 0x4044484c, },
{ 0, 1, 1, 0x00000e34, 0xffffffff, 0x5054585c, },
{ 0, 1, 1, 0x00000e38, 0xffffffff, 0x4044484c, },
{ 0, 1, 0, 0x00000e3c, 0xffffffff, 0x5054585c, },
{ 0, 1, 0, 0x00000e40, 0xffffffff, 0x4044484c, },
{ 0, 1, 0, 0x00000e44, 0xffffffff, 0x585c383c, },
{ 0, 1, 1, 0x00000e48, 0xffffffff, 0x484c5054, },
{ 0, 1, 1, 0x00000e4c, 0xffffffff, 0x383c4044, },
{ 1, 0, 0, 0x00000c24, 0xffffffff, 0x54585c60, },
{ 1, 0, 0, 0x00000c28, 0xffffffff, 0x44484c50, },
{ 1, 0, 0, 0x00000c2c, 0xffffffff, 0x5054585c, },
{ 1, 0, 0, 0x00000c30, 0xffffffff, 0x4044484c, },
{ 1, 0, 1, 0x00000c34, 0xffffffff, 0x5054585c, },
{ 1, 0, 1, 0x00000c38, 0xffffffff, 0x4044484c, },
{ 1, 0, 0, 0x00000c3c, 0xffffffff, 0x5054585c, },
{ 1, 0, 0, 0x00000c40, 0xffffffff, 0x4044484c, },
{ 1, 0, 0, 0x00000c44, 0xffffffff, 0x585c383c, },
{ 1, 0, 1, 0x00000c48, 0xffffffff, 0x484c5054, },
{ 1, 0, 1, 0x00000c4c, 0xffffffff, 0x383c4044, },
{ 1, 1, 0, 0x00000e24, 0xffffffff, 0x54585c60, },
{ 1, 1, 0, 0x00000e28, 0xffffffff, 0x44484c50, },
{ 1, 1, 0, 0x00000e2c, 0xffffffff, 0x5054585c, },
{ 1, 1, 0, 0x00000e30, 0xffffffff, 0x4044484c, },
{ 1, 1, 1, 0x00000e34, 0xffffffff, 0x5054585c, },
{ 1, 1, 1, 0x00000e38, 0xffffffff, 0x4044484c, },
{ 1, 1, 0, 0x00000e3c, 0xffffffff, 0x5054585c, },
{ 1, 1, 0, 0x00000e40, 0xffffffff, 0x4044484c, },
{ 1, 1, 0, 0x00000e44, 0xffffffff, 0x585c383c, },
{ 1, 1, 1, 0x00000e48, 0xffffffff, 0x484c5054, },
{ 1, 1, 1, 0x00000e4c, 0xffffffff, 0x383c4044, },
};
RTW_DECL_TABLE_BB_PG(rtw8822c_bb_pg_type0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment