summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2024-08-30 13:49:54 +0100
committerFelix Held <felix-coreboot@felixheld.de>2024-10-01 16:37:51 +0000
commit2ec9addc301151319cd73fe10b1e0acbccb8201b (patch)
treea389ceff3ab19c6edd710221faa709af43140dee /src
parentf0e1b8b149332cefc429369da181a26069cc6bbb (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/usb/acpi/usb_acpi.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c
index b01c9492b3..3a9db30dbf 100644
--- a/src/drivers/usb/acpi/usb_acpi.c
+++ b/src/drivers/usb/acpi/usb_acpi.c
@@ -129,6 +129,73 @@ static void acpi_device_intel_bt(void)
};
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)