drivers/usb/bluetooth: Skip calling _ON when device is already enabled

Add a check in the _ON method, similar to coreboot's ONSK handling
in its RTD3 driver, to determine whether the enable GPIO is already
asserted.

This prevents the OS from repeatedly invoking _ON, which can happen
because USB Bluetooth takes around 200ms to initialize after the
GPIO is enabled.

Change-Id: I424bc5f4c5b990fd5cb54daa3d6207828386c6f2
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87239
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Sean Rhodes 2025-04-09 12:28:22 +01:00 committed by Matt DeVillier
commit 9b80b36c4a

View file

@ -110,6 +110,9 @@ void acpi_device_intel_bt(const struct acpi_gpio *enable_gpio,
* }
* Method (_ON, 0, NotSerialized)
* {
* If ((\_SB.PCI0.GBTE() == 1))
* Return (1)
* }
* \_SB.PCI0.SBTE(1)
* }
* Method (_OFF, 0, NotSerialized)
@ -126,7 +129,7 @@ void acpi_device_intel_bt(const struct acpi_gpio *enable_gpio,
* \_SB.PCI0.BTRK (One)
* Sleep (RDLY)
* Release (\_SB.PCI0.CNMT)
}
* }
* }
* }
*/
@ -149,6 +152,16 @@ void acpi_device_intel_bt(const struct acpi_gpio *enable_gpio,
acpigen_write_method("_ON", 0);
{
if (enable_gpio->pin_count) {
acpigen_write_store();
acpigen_emit_namestring("\\_SB.PCI0.GBTE");
acpigen_emit_byte(LOCAL0_OP);
acpigen_write_if_lequal_op_int(LOCAL0_OP, 1);
{
acpigen_write_return_integer(1);
}
acpigen_pop_len();
acpigen_emit_namestring("\\_SB.PCI0.SBTE");
acpigen_emit_byte(1);
}