diff options
Diffstat (limited to 'src/drivers/usb')
-rw-r--r-- | src/drivers/usb/acpi/chip.h | 6 | ||||
-rw-r--r-- | src/drivers/usb/acpi/intel_bluetooth.c | 108 | ||||
-rw-r--r-- | src/drivers/usb/acpi/usb_acpi.c | 6 |
3 files changed, 110 insertions, 10 deletions
diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h index afd99715b9..a27ce4468c 100644 --- a/src/drivers/usb/acpi/chip.h +++ b/src/drivers/usb/acpi/chip.h @@ -88,7 +88,9 @@ struct drivers_usb_acpi_config { bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld); /* Intel Bluetooth */ -void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload); -void acpi_device_intel_bt_common(void); +void acpi_device_intel_bt(unsigned int reset_gpio, + unsigned int enable_gpio, + bool audio_offload); +void acpi_device_intel_bt_common(unsigned int enable_gpio); #endif /* __USB_ACPI_CHIP_H__ */ diff --git a/src/drivers/usb/acpi/intel_bluetooth.c b/src/drivers/usb/acpi/intel_bluetooth.c index 1775286be4..49b2138ba7 100644 --- a/src/drivers/usb/acpi/intel_bluetooth.c +++ b/src/drivers/usb/acpi/intel_bluetooth.c @@ -13,10 +13,15 @@ * BIT(1) Check Tile Activation * * Check/Set Reset Delay (aa10f4e0-81ac-4233-abf6-3b2ac50e28d9) - * Arg2 == 0: Return a package with the following bit set + * Arg2 == 0: Return a package with the following bit set * BIT(0) Indicates whether the device supports other functions * BIT(1) Check Bluetooth reset timing - * Arg2 == 1: Set the reset delay based on Arg3 + * + * Arg2 == 1: Set the reset delay based on Arg3 + * + * Arg2 == 3: Set the reset method based on Arg3 (Not supported by this driver) + * WDISABLE2 (BT_RF_KILL_N) + * VSEC (PCI Config Space) */ static void check_reset_delay(void *arg) @@ -53,7 +58,7 @@ static void get_feature_flag(void *arg) void (*uuid_callbacks1[])(void *) = { check_reset_delay, set_reset_delay }; void (*uuid_callbacks2[])(void *) = { get_feature_flag }; -void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload) +void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, bool audio_offload) { /* * Name (RDLY, 0x69) @@ -129,13 +134,15 @@ void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload) * { * Method (_STA, 0, NotSerialized) * { - * Return (One) + * Return (\_SB.PCI0.GBTE()) * } * Method (_ON, 0, NotSerialized) * { + * \_SB.PCI0.SBTE(1) * } * Method (_OFF, 0, NotSerialized) * { + * \_SB.PCI0.SBTE(0) * } * Method (_RST, 0, NotSerialized) * { @@ -155,14 +162,34 @@ void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload) { acpigen_write_method("_STA", 0); { - acpigen_write_return_integer(1); + if (enable_gpio) { + acpigen_write_store(); + acpigen_emit_namestring("\\_SB.PCI0.GBTE"); + acpigen_emit_byte(LOCAL0_OP); + + acpigen_write_return_op(LOCAL0_OP); + } else { + acpigen_write_return_integer(1); + } } acpigen_pop_len(); acpigen_write_method("_ON", 0); + { + if (enable_gpio) { + acpigen_emit_namestring("\\_SB.PCI0.SBTE"); + acpigen_emit_byte(1); + } + } acpigen_pop_len(); acpigen_write_method("_OFF", 0); + { + if (enable_gpio) { + acpigen_emit_namestring("\\_SB.PCI0.SBTE"); + acpigen_emit_byte(0); + } + } acpigen_pop_len(); acpigen_write_method("_RST", 0); @@ -233,6 +260,32 @@ void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload) acpigen_pop_len(); /* + * Name (_PR0, Package (0x01) + * { + * BTRT + * }) + */ + acpigen_write_name("_PR0"); + { + acpigen_write_package(1); + acpigen_emit_namestring("BTRT"); + } + acpigen_pop_len(); + +/* + * Name (_PR3, Package (0x01) + * { + * BTRT + * }) + */ + acpigen_write_name("_PR3"); + { + acpigen_write_package(1); + acpigen_emit_namestring("BTRT"); + } + acpigen_pop_len(); + +/* * Method (AOLD, 0, Serialized) * { * Name (AODS, Package (0x03) @@ -261,7 +314,7 @@ void acpi_device_intel_bt(unsigned int reset_gpio, bool audio_offload) acpigen_pop_len(); } -void acpi_device_intel_bt_common(void) +void acpi_device_intel_bt_common(unsigned int enable_gpio) { acpigen_write_scope("\\_SB.PCI0"); /* @@ -269,5 +322,48 @@ void acpi_device_intel_bt_common(void) */ acpigen_write_mutex("CNMT", 0); +/* + * Method (SBTE, 1, Serialized) + * { + * If (Arg0 == 1) + * { + * STXS(enable_gpio) + * } Else { + * CTXS(enable_gpio) + * } + * } + */ + acpigen_write_method_serialized("SBTE", 1); + { + if (enable_gpio) { + acpigen_write_if_lequal_op_int(ARG0_OP, 1); + { + acpigen_soc_set_tx_gpio(enable_gpio); + } + acpigen_write_else(); + { + acpigen_soc_clear_tx_gpio(enable_gpio); + } + acpigen_pop_len(); + } + } + acpigen_pop_len(); + +/* + * Method (GBTE, 0, NotSerialized) + * { + * Return (GTXS (enable_gpio)) + * } + */ + acpigen_write_method("GBTE", 0); + { + acpigen_emit_byte(RETURN_OP); + if (enable_gpio) + acpigen_soc_get_tx_gpio(enable_gpio); + else + acpigen_emit_byte(0); + } + acpigen_pop_len(); + acpigen_pop_len(); } diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index 0087cbed54..8960e3d05b 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -108,7 +108,9 @@ static void usb_acpi_fill_ssdt_generator(const struct device *dev) } if (config->is_intel_bluetooth) - acpi_device_intel_bt(config->reset_gpio.pins[0], config->cnvi_bt_audio_offload); + acpi_device_intel_bt(config->reset_gpio.pins[0], + config->enable_gpio.pins[0], + config->cnvi_bt_audio_offload); acpigen_pop_len(); @@ -117,7 +119,7 @@ static void usb_acpi_fill_ssdt_generator(const struct device *dev) * other code to access it i.e. CNVi driver. */ if (config->is_intel_bluetooth) - acpi_device_intel_bt_common(); + acpi_device_intel_bt_common(config->enable_gpio.pins[0]); printk(BIOS_INFO, "%s: %s at %s\n", path, config->desc ? : dev->chip_ops->name, dev_path(dev)); |