Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84146?usp=email )
Change subject: drivers/usb/acpi: Add a Power Resource for Intel Bluetooth ......................................................................
drivers/usb/acpi: Add a Power Resource for Intel Bluetooth
Add a Power Resource for Intel Bluetooth, that can reset the Bluetooth using the delay configured in the DSM.
Change-Id: I3b25fd180e21100e3cb001fc6ba0da7f47b2ad12 Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/84146 Reviewed-by: Matt DeVillier matt.devillier@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/usb/acpi/usb_acpi.c 1 file changed, 67 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Matt DeVillier: Looks good to me, approved
diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index b01c949..3a9db30 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -129,6 +129,73 @@ };
acpigen_write_dsm_uuid_arr(uuid_callbacks, ARRAY_SIZE(uuid_callbacks)); +/* + * PowerResource (BTRT, 0x05, 0x0000) + * { + * Method (_STA, 0, NotSerialized) + * { + * Return (One) + * } + * Method (_ON, 0, NotSerialized) + * { + * } + * Method (_OFF, 0, NotSerialized) + * { + * } + * Method (_RST, 0, NotSerialized) + * { + * Local0 = Acquire (CNMT, 0x03E8) + * If ((Local0 == Zero)) + * { + * BTRK (Zero) + * Sleep (RDLY) + * BTRK (One) + * Sleep (RDLY) + * } + * Release (CNMT) + * } + * } + */ + acpigen_write_power_res("BTRT", 5, 0, NULL, 0); + { + acpigen_write_method("_STA", 0); + { + acpigen_write_return_integer(1); + } + acpigen_pop_len(); + + acpigen_write_method("_ON", 0); + acpigen_pop_len(); + + acpigen_write_method("_OFF", 0); + acpigen_pop_len(); + + acpigen_write_method("_RST", 0); + { + acpigen_write_store(); + acpigen_write_acquire("CNMT", 0x03e8); + acpigen_emit_byte(LOCAL0_OP); + + acpigen_write_if_lequal_op_int(LOCAL0_OP, 0); + { + acpigen_emit_namestring("BTRK"); + acpigen_emit_byte(0); + + acpigen_emit_ext_op(SLEEP_OP); + acpigen_emit_namestring("RDLY"); + + acpigen_emit_namestring("BTRK"); + acpigen_emit_byte(1); + + acpigen_emit_ext_op(SLEEP_OP); + acpigen_emit_namestring("RDLY"); + } + acpigen_pop_len(); + acpigen_write_release("CNMT"); + } + acpigen_pop_len(); + } + acpigen_write_power_res_end(); }
static bool usb_acpi_add_gpios_to_crs(struct drivers_usb_acpi_config *cfg)