diff options
author | Jeremy Compostella <jeremy.compostella@intel.com> | 2024-10-28 14:03:29 -0700 |
---|---|---|
committer | Jérémy Compostella <jeremy.compostella@intel.com> | 2024-11-27 21:27:53 +0000 |
commit | 354cba21a41aa868b7b41804c2859f920d2e1b17 (patch) | |
tree | 31e69334fa56cf9150617fa16b4be72ec45ad1ce /src/drivers | |
parent | 8943e40b18911552b28e841394068bed80612829 (diff) |
drivers/wifi: Support Bluetooth Per-Platform Antenna Gain
The ACPI BPAG method provide information to controls the antenna gain
method to be used per country.
The antenna gain mode is a bit field (0 - disabled, 1 -enabled)
defined as follow:
- Bit 0 - Antenna gain in EU
- Bit 1 - Antenna gain in China Mainland
The implementation follows document 559910 Intel Connectivity
Platforms BIOS Guideline revision 9.2 specification.
BUG=b:346600091
TEST=BPAG method is added to the bluetooth companion device and return
the data supplied by the SAR binary blob
Change-Id: Iebe95815c944d045f4cf686abcd1874a8a45e210
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84941
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/wifi/generic/acpi.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 9ed17e0b5c..0a5bee728f 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -666,6 +666,41 @@ static void sar_emit_wbem(const struct wbem_profile *wbem) acpigen_write_package_end(); } +static void sar_emit_bpag(const struct bpag_profile *bpag) +{ + if (bpag == NULL) + return; + + /* + * Name ("BPAG", Package () { + * Revision, + * Package () { + * Domain Type, // 0x12:Bluetooth + * Bluetooth Per-Platform Antenna Gain Mode + * } + * }) + */ + if (bpag->revision == 0 || bpag->revision > BPAG_REVISION) { + printk(BIOS_ERR, "Unsupported BPAG table revision: %d\n", + bpag->revision); + return; + } + + acpigen_write_name("BPAG"); + acpigen_write_package(2); + acpigen_write_dword(bpag->revision); + + /* + * Emit 'Domain Type' + 'Antenna Gain Mode' + */ + acpigen_write_package(2); + acpigen_write_dword(DOMAIN_TYPE_BLUETOOTH); + acpigen_write_dword(bpag->antenna_gain_country_enablement); + + acpigen_write_package_end(); + acpigen_write_package_end(); +} + static void emit_wifi_sar_acpi_structures(const struct device *dev, union wifi_sar_limits *sar_limits) { @@ -798,6 +833,7 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco if (path) { /* Bluetooth device under USB Hub scope or PCIe root port */ acpigen_write_scope(path); sar_emit_brds(sar_limits.bsar); + sar_emit_bpag(sar_limits.bpag); acpigen_write_scope_end(); } else { printk(BIOS_ERR, "Failed to get %s Bluetooth companion ACPI path\n", |