mbox series

[0/8] rtw88: Add SAR implementation

Message ID 20200207092844.29175-1-yhchuang@realtek.com
Headers show
Series rtw88: Add SAR implementation | expand

Message

Tony Chuang Feb. 7, 2020, 9:28 a.m. UTC
From: Yan-Hsuan Chuang <yhchuang@realtek.com>

Add SAR implemention that allows driver to set SAR power from
three different sources:
  1. From vendor command
  2. From static SAR configuration
  3. From dynamic SAR

SAR sources will provide driver a list of target power in dBm
which should be translated into power indexes. Then driver
will just treat those indexes as another power limit to force
the power output being lower then SAR restriction.

For either vendor command, static or dynamic SAR, driver stores
the values in tx_pwr_sar_{2,5}g[regd][path][rs][ch]. Whenever
the channel is changed or a new SAR table is applied, driver
will configure the power indexes.

To check if SAR power is configured properly, append a column
to debugfs "tx_pwr_tbl". But for dynamic SAR, the profile ID
may change, so add a new debugfs "sar" to display SAR power.


Ping-Ke Shih (8):
  rtw88: sar: add SAR of TX power limit
  nl80211: vendor-cmd: realtek: Add vendor command to set SAR power
    limit
  rtw88: vndcmd: sar: Apply SAR power limit via vendor command
  rtw88: sar: Load static SAR table from ACPI WRDS method
  rtw88: sar: Load dynamic SAR table from ACPI methods
  rtw88: sar: apply dynamic SAR table to tx power limit
  rtw88: sar: add sar_work to poll if dynamic SAR table is changed
  rtw88: sar: dump sar information via debugfs

 drivers/net/wireless/realtek/rtw88/Makefile |   2 +
 drivers/net/wireless/realtek/rtw88/debug.c  |  30 +-
 drivers/net/wireless/realtek/rtw88/main.c   |  10 +
 drivers/net/wireless/realtek/rtw88/main.h   |  26 +
 drivers/net/wireless/realtek/rtw88/phy.c    | 173 ++++-
 drivers/net/wireless/realtek/rtw88/phy.h    |   3 +
 drivers/net/wireless/realtek/rtw88/sar.c    | 778 ++++++++++++++++++++
 drivers/net/wireless/realtek/rtw88/sar.h    |  15 +
 drivers/net/wireless/realtek/rtw88/vndcmd.c | 131 ++++
 drivers/net/wireless/realtek/rtw88/vndcmd.h |  10 +
 include/uapi/nl80211-vnd-realtek.h          |  72 ++
 11 files changed, 1218 insertions(+), 32 deletions(-)
 create mode 100644 drivers/net/wireless/realtek/rtw88/sar.c
 create mode 100644 drivers/net/wireless/realtek/rtw88/sar.h
 create mode 100644 drivers/net/wireless/realtek/rtw88/vndcmd.c
 create mode 100644 drivers/net/wireless/realtek/rtw88/vndcmd.h
 create mode 100644 include/uapi/nl80211-vnd-realtek.h