summaryrefslogtreecommitdiff
path: root/src/drivers/usb/acpi
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2024-10-02 13:53:33 +0100
committerMartin L Roth <gaumless@gmail.com>2024-10-09 01:23:03 +0000
commitac5d5172ab3c10567eaa71d8a8ca9891e6c492bd (patch)
treeb4b8ee1f00150cb87a98c9f6c771abaf42bca85c /src/drivers/usb/acpi
parent7a39531af6ad2a3dccd2a277542c91c5d049a195 (diff)
drivers/usb/acpi: Move the CNMT Mutex to USB
The Intel Bluetooth driver can be combined with either CNVi, or full PCI wireless cards such as the AX210. Move it to the USB code so it can be used by either or. Change-Id: Ib456b1870501182b2d8788e5d53bbf4d7981f91b Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84627 Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/usb/acpi')
-rw-r--r--src/drivers/usb/acpi/chip.h1
-rw-r--r--src/drivers/usb/acpi/intel_bluetooth.c22
-rw-r--r--src/drivers/usb/acpi/usb_acpi.c7
3 files changed, 25 insertions, 5 deletions
diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h
index ad2e3cd485..8d2ed919fa 100644
--- a/src/drivers/usb/acpi/chip.h
+++ b/src/drivers/usb/acpi/chip.h
@@ -88,5 +88,6 @@ bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld);
/* Intel Bluetooth */
void acpi_device_intel_bt(void);
+void acpi_device_intel_bt_common(void);
#endif /* __USB_ACPI_CHIP_H__ */
diff --git a/src/drivers/usb/acpi/intel_bluetooth.c b/src/drivers/usb/acpi/intel_bluetooth.c
index 6cd27f1c81..38ef0bb390 100644
--- a/src/drivers/usb/acpi/intel_bluetooth.c
+++ b/src/drivers/usb/acpi/intel_bluetooth.c
@@ -139,15 +139,15 @@ void acpi_device_intel_bt(void)
* }
* Method (_RST, 0, NotSerialized)
* {
- * Local0 = Acquire (CNMT, 0x03E8)
+ * Local0 = Acquire (\_SB.PCI0.CNMT, 1000)
* If ((Local0 == Zero))
* {
* BTRK (Zero)
* Sleep (RDLY)
* BTRK (One)
* Sleep (RDLY)
- * }
- * Release (CNMT)
+ * Release (\_SB.PCI0.CNMT)
+ }
* }
* }
*/
@@ -168,7 +168,7 @@ void acpi_device_intel_bt(void)
acpigen_write_method("_RST", 0);
{
acpigen_write_store();
- acpigen_write_acquire("CNMT", 0x03e8);
+ acpigen_write_acquire("\\_SB.PCI0.CNMT", 1000);
acpigen_emit_byte(LOCAL0_OP);
acpigen_write_if_lequal_op_int(LOCAL0_OP, 0);
@@ -184,11 +184,23 @@ void acpi_device_intel_bt(void)
acpigen_emit_ext_op(SLEEP_OP);
acpigen_emit_namestring("RDLY");
+
+ acpigen_write_release("\\_SB.PCI0.CNMT");
}
acpigen_pop_len();
- acpigen_write_release("CNMT");
}
acpigen_pop_len();
}
acpigen_write_power_res_end();
}
+
+void acpi_device_intel_bt_common(void)
+{
+ acpigen_write_scope("\\_SB.PCI0");
+/*
+ * Mutex (CNMT, 0)
+ */
+ acpigen_write_mutex("CNMT", 0);
+
+ acpigen_pop_len();
+}
diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c
index 1fb6368852..6d72fe7e56 100644
--- a/src/drivers/usb/acpi/usb_acpi.c
+++ b/src/drivers/usb/acpi/usb_acpi.c
@@ -112,6 +112,13 @@ static void usb_acpi_fill_ssdt_generator(const struct device *dev)
acpigen_pop_len();
+ /*
+ * This is generated outside of the USB Device Scope to make it easier for
+ * other code to access it i.e. CNVi driver.
+ */
+ if (config->is_intel_bluetooth)
+ acpi_device_intel_bt_common();
+
printk(BIOS_INFO, "%s: %s at %s\n", path,
config->desc ? : dev->chip_ops->name, dev_path(dev));
}