<yhchuang@xxxxxxxxxxx> wrote: > From: Ping-Ke Shih <pkshih@xxxxxxxxxxx> > > Originally, there are three factors of TX power: > 1) TX base power, calibrated manually and programmed in efuse. > 2) By-rate power, an offset to increase power depends on TX rate. > 3) TX limit power, an offset to contraint the max power. > > So, driver can get the TX power index by using: > TX_POWER_IDX = tx_base_power + min(by-rate, limit) > > To take SAR into consideration, we can treat it as another limit of > the TX power. Then driver can get the TX power by using: > TX_POWER_IDX = tx_base_power + min(by-rate, limit, sar) > > Note that the values stored in driver are not presented in dBm, so > driver needs to also convert the power limit indexes of SAR with > tx_scale_factor, then get the difference to the TX base power. > rtw_phy_set_tx_power_sar() will convert the values of SAR power in unit of > 0.125d Bm (sar_q3) and store them in tx_pwr_sar_{2,5}g[regd][path][rs][ch]. > > Since certain SAR tables have single one table that isn't regulatory domain > specific, parser can apply to all 'regd' or only one domain RTW_REGD_WW > that SAR TX power limit can be applied no matter which regulatory domain > is selected. Because driver get 'sar' argument by > rtw_phy_get_tx_power_limit() with rule > sar = is_existing(tx_pwr_sar_{2,5}g[regd]) ? tx_pwr_sar_{2,5}g[regd] : > tx_pwr_sar_{2,5}g[RTW_REGD_WW]; > > There are various sources of SAR table, but it is expected to adopt only > one source. So, save current source of rtw_sar_sources to prevent more > than one source are adopted. > > Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx> > Signed-off-by: Yan-Hsuan Chuang <yhchuang@xxxxxxxxxxx> I'll drop these from my queue now. Please resend once there's a concensus what interface to use. 7 patches set to Changes Requested. 11370071 [1/8] rtw88: sar: add SAR of TX power limit 11370073 [3/8] rtw88: vndcmd: sar: Apply SAR power limit via vendor command 11370075 [4/8] rtw88: sar: Load static SAR table from ACPI WRDS method 11370083 [5/8] rtw88: sar: Load dynamic SAR table from ACPI methods 11370079 [6/8] rtw88: sar: apply dynamic SAR table to tx power limit 11370081 [7/8] rtw88: sar: add sar_work to poll if dynamic SAR table is changed 11370085 [8/8] rtw88: sar: dump sar information via debugfs -- https://patchwork.kernel.org/patch/11370071/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches