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:
parent
c731ef0e47
commit
9b80b36c4a
1 changed files with 14 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue