summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2024-10-04 11:30:27 +0100
committerSean Rhodes <sean@starlabs.systems>2024-10-22 09:19:26 +0000
commit8db613811582d9c2866838b155219f8534256444 (patch)
treee73be49ccb7056e8302dbd3026fea03670715a19 /src/drivers
parent5775ed215e59fe0d45b422e19458e63f7d46329e (diff)
drivers/usb/acpi: Account for the lack of a reset gpio
Adjust the DSM to return 0x00 (unsupported) when no reset gpio is passed to the driver. Leave the _RST method to comply with the ACPI specification but omit the BTRT method as it won't do anything. Change-Id: I9f8e98fb4f5a22b2f7617b131a3d71cf90f5bc80 Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84658 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/usb/acpi/intel_bluetooth.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/src/drivers/usb/acpi/intel_bluetooth.c b/src/drivers/usb/acpi/intel_bluetooth.c
index 2cd06b22d9..90f163673f 100644
--- a/src/drivers/usb/acpi/intel_bluetooth.c
+++ b/src/drivers/usb/acpi/intel_bluetooth.c
@@ -36,7 +36,13 @@ static void set_reset_delay(void *arg)
acpigen_write_store_op_to_namestr(ARG3_OP, "RDLY");
}
-void (*uuid_callbacks1[])(void *) = { check_reset_delay, set_reset_delay };
+static void not_supported(void *arg)
+{
+ acpigen_write_return_singleton_buffer(0x00);
+}
+
+void (*reset_supported[])(void *) = { check_reset_delay, set_reset_delay };
+void (*reset_unsupported[])(void *) = { not_supported };
void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, bool audio_offload)
{
@@ -82,8 +88,12 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
* }
* }
*/
+
struct dsm_uuid uuid_callbacks[] = {
- DSM_UUID("aa10f4e0-81ac-4233-abf6-3b2ac50e28d9", uuid_callbacks1, 2, NULL),
+ DSM_UUID("aa10f4e0-81ac-4233-abf6-3b2ac50e28d9",
+ reset_gpio ? reset_supported : reset_unsupported,
+ reset_gpio ? ARRAY_SIZE(reset_supported) : ARRAY_SIZE(reset_unsupported),
+ NULL),
};
acpigen_write_dsm_uuid_arr(uuid_callbacks, ARRAY_SIZE(uuid_callbacks));
@@ -152,27 +162,29 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
acpigen_write_method("_RST", 0);
{
- acpigen_write_store();
- acpigen_write_acquire("\\_SB.PCI0.CNMT", 1000);
- acpigen_emit_byte(LOCAL0_OP);
+ if (reset_gpio) {
+ acpigen_write_store();
+ acpigen_write_acquire("\\_SB.PCI0.CNMT", 1000);
+ acpigen_emit_byte(LOCAL0_OP);
- acpigen_write_if_lequal_op_int(LOCAL0_OP, 0);
- {
- acpigen_emit_namestring("BTRK");
- acpigen_emit_byte(0);
+ 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_ext_op(SLEEP_OP);
+ acpigen_emit_namestring("RDLY");
- acpigen_emit_namestring("BTRK");
- acpigen_emit_byte(1);
+ acpigen_emit_namestring("BTRK");
+ acpigen_emit_byte(1);
- acpigen_emit_ext_op(SLEEP_OP);
- acpigen_emit_namestring("RDLY");
+ acpigen_emit_ext_op(SLEEP_OP);
+ acpigen_emit_namestring("RDLY");
- acpigen_write_release("\\_SB.PCI0.CNMT");
+ acpigen_write_release("\\_SB.PCI0.CNMT");
+ }
+ acpigen_pop_len();
}
- acpigen_pop_len();
}
acpigen_pop_len();
}
@@ -195,7 +207,6 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
{
acpigen_soc_set_tx_gpio(reset_gpio);
}
-
acpigen_write_else();
{
acpigen_soc_clear_tx_gpio(reset_gpio);