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>
This commit is contained in:
parent
7a39531af6
commit
ac5d5172ab
4 changed files with 26 additions and 21 deletions
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,21 +12,6 @@ static const char *cnvi_wifi_acpi_name(const struct device *dev)
|
|||
return "CNVW";
|
||||
}
|
||||
|
||||
static void cnvw_fill_ssdt(const struct device *dev)
|
||||
{
|
||||
const char *scope = acpi_device_path(dev);
|
||||
|
||||
acpi_device_write_pci_dev(dev);
|
||||
|
||||
acpigen_write_scope(scope);
|
||||
/*
|
||||
* Mutex (CNMT, 0)
|
||||
*/
|
||||
acpigen_write_mutex("CNMT", 0);
|
||||
|
||||
acpigen_write_scope_end();
|
||||
}
|
||||
|
||||
static struct device_operations cnvi_wifi_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
|
|
@ -34,7 +19,7 @@ static struct device_operations cnvi_wifi_ops = {
|
|||
.ops_pci = &pci_dev_ops_pci,
|
||||
.scan_bus = scan_static_bus,
|
||||
.acpi_name = cnvi_wifi_acpi_name,
|
||||
.acpi_fill_ssdt = cnvw_fill_ssdt,
|
||||
.acpi_fill_ssdt = acpi_device_write_pci_dev,
|
||||
};
|
||||
|
||||
static const unsigned short wifi_pci_device_ids[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue