drivers/usb/intel_bluetooth: Guard BTRK if no GPIO passed

Don't attempt any GPIO operations of there isn't a reset
GPIO specified.

Change-Id: I9c97963e61f790f2d9c55d8ec1a384a5779782b4
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86401
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-02-13 09:14:47 +00:00
commit 970d983083

View file

@ -328,17 +328,19 @@ void acpi_device_intel_bt_common(const struct acpi_gpio *enable_gpio,
*/
acpigen_write_method("BTRK", 1);
{
acpigen_write_if_lequal_op_int(ARG0_OP, 1);
{
/* De-assert reset */
acpigen_disable_tx_gpio(reset_gpio);
if (reset_gpio->pin_count) {
acpigen_write_if_lequal_op_int(ARG0_OP, 1);
{
/* De-assert reset */
acpigen_disable_tx_gpio(reset_gpio);
}
acpigen_write_else();
{
/* Assert Reset */
acpigen_enable_tx_gpio(reset_gpio);
}
acpigen_pop_len();
}
acpigen_write_else();
{
/* Assert Reset */
acpigen_enable_tx_gpio(reset_gpio);
}
acpigen_pop_len();
}
acpigen_pop_len();