diff options
author | Sean Rhodes <sean@starlabs.systems> | 2024-08-29 20:29:44 +0100 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2024-10-14 15:32:06 +0000 |
commit | 229d8fa2868a36ded96910df3291de36bfc096f3 (patch) | |
tree | 453c15458482f391d225db890aab840328e7932e /src | |
parent | bede28b17df3aa3af4adc9c2396abd4070785cda (diff) |
drivers/usb/acpi: Add AOLD Method for Intel Bluetooth
Add AOLD Method, which returns an integer based on
whether Audio Offload is enabled. Leave the existing
control of Audio Offload in `soc/soc_chip.h`. Add
`cnvi_bt_audio_offload` in the USB ACPI `chip.h` to
control the aforementioned return value.
The value in `soc/soc_chip.h` and `chip.h` should
match.
Change-Id: Idb804fb1cf0edef4a98479a6261ca68255dbf075
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84134
Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/usb/acpi/chip.h | 3 | ||||
-rw-r--r-- | src/drivers/usb/acpi/intel_bluetooth.c | 30 | ||||
-rw-r--r-- | src/drivers/usb/acpi/usb_acpi.c | 2 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h index 5e41d24f50..afd99715b9 100644 --- a/src/drivers/usb/acpi/chip.h +++ b/src/drivers/usb/acpi/chip.h @@ -49,6 +49,7 @@ struct drivers_usb_acpi_config { /* Intel Bluetooth */ bool is_intel_bluetooth; + bool cnvi_bt_audio_offload; /* GPIO used to take device out of reset or to put it into reset. */ struct acpi_gpio reset_gpio; @@ -87,7 +88,7 @@ struct drivers_usb_acpi_config { bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld); /* Intel Bluetooth */ -void acpi_device_intel_bt(unsigned int reset_gpio); +void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload); void acpi_device_intel_bt_common(void); #endif /* __USB_ACPI_CHIP_H__ */ diff --git a/src/drivers/usb/acpi/intel_bluetooth.c b/src/drivers/usb/acpi/intel_bluetooth.c index 773f1ad743..1775286be4 100644 --- a/src/drivers/usb/acpi/intel_bluetooth.c +++ b/src/drivers/usb/acpi/intel_bluetooth.c @@ -53,7 +53,7 @@ static void get_feature_flag(void *arg) void (*uuid_callbacks1[])(void *) = { check_reset_delay, set_reset_delay }; void (*uuid_callbacks2[])(void *) = { get_feature_flag }; -void acpi_device_intel_bt(unsigned int reset_gpio) +void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload) { /* * Name (RDLY, 0x69) @@ -231,6 +231,34 @@ void acpi_device_intel_bt(unsigned int reset_gpio) acpigen_emit_namestring("BTRT"); } acpigen_pop_len(); + +/* + * Method (AOLD, 0, Serialized) + * { + * Name (AODS, Package (0x03) + * { + * Zero, + * 0x12, + * Zero // Audio Offload - 0: Disabled + * 1: Enabled + * }) + * Return (AODS) + * } + */ + acpigen_write_method_serialized("AOLD", 0); + { + acpigen_write_name("AODS"); + acpigen_write_package(3); + { + acpigen_write_integer(0); + acpigen_write_integer(0x12); + acpigen_write_integer(audio_offload); + } + acpigen_pop_len(); + + acpigen_write_return_namestr("AODS"); + } + acpigen_pop_len(); } void acpi_device_intel_bt_common(void) diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index f1622921c9..0087cbed54 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -108,7 +108,7 @@ static void usb_acpi_fill_ssdt_generator(const struct device *dev) } if (config->is_intel_bluetooth) - acpi_device_intel_bt(config->reset_gpio.pins[0]); + acpi_device_intel_bt(config->reset_gpio.pins[0], config->cnvi_bt_audio_offload); acpigen_pop_len(); |