drivers/usb/intel_bluetooth: Relocate BTRK to \_SB.PCI0

Move BTRK to \_SB.PCI0 so that the CNVi driver can correctly
access it.

Change-Id: I044b745dce41c9d7a86384b42543ad93485d85ce
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84990
Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Sean Rhodes 2024-10-24 14:15:50 +01:00 committed by Lean Sheng Tan
commit d33244c3af
4 changed files with 38 additions and 36 deletions

View file

@ -91,6 +91,7 @@ bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld);
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);
void acpi_device_intel_bt_common(unsigned int enable_gpio,
unsigned int reset_gpio);
#endif /* __USB_ACPI_CHIP_H__ */

View file

@ -117,9 +117,9 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
* Local0 = Acquire (\_SB.PCI0.CNMT, 1000)
* If ((Local0 == Zero))
* {
* BTRK (Zero)
* \_SB.PCI0.BTRK (Zero)
* Sleep (RDLY)
* BTRK (One)
* \_SB.PCI0.BTRK (One)
* Sleep (RDLY)
* Release (\_SB.PCI0.CNMT)
}
@ -169,13 +169,13 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
acpigen_write_if_lequal_op_int(LOCAL0_OP, 0);
{
acpigen_emit_namestring("BTRK");
acpigen_emit_namestring("\\_SB.PCI0.BTRK");
acpigen_emit_byte(0);
acpigen_emit_ext_op(SLEEP_OP);
acpigen_emit_namestring("RDLY");
acpigen_emit_namestring("BTRK");
acpigen_emit_namestring("\\_SB.PCI0.BTRK");
acpigen_emit_byte(1);
acpigen_emit_ext_op(SLEEP_OP);
@ -190,31 +190,6 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
}
acpigen_write_power_res_end();
/*
* Method (BTRK, 1, Serialized)
* {
* If (Arg0 == 1)
* {
* STXS (reset_gpio)
* } Else {
* CTXS (reset_gpio)
* }
* }
*/
acpigen_write_method_serialized("BTRK", 1);
{
acpigen_write_if_lequal_op_int(ARG0_OP, 1);
{
acpigen_soc_set_tx_gpio(reset_gpio);
}
acpigen_write_else();
{
acpigen_soc_clear_tx_gpio(reset_gpio);
}
acpigen_pop_len();
}
acpigen_pop_len();
/*
* Name (_PRR, Package (0x01)
* {
@ -283,7 +258,7 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, boo
acpigen_pop_len();
}
void acpi_device_intel_bt_common(unsigned int enable_gpio)
void acpi_device_intel_bt_common(unsigned int enable_gpio, unsigned int reset_gpio)
{
acpigen_write_scope("\\_SB.PCI0");
/*
@ -335,5 +310,30 @@ void acpi_device_intel_bt_common(unsigned int enable_gpio)
}
acpigen_pop_len();
/*
* Method (BTRK, 1, Serialized)
* {
* If (Arg0 == 1)
* {
* STXS (reset_gpio)
* } Else {
* CTXS (reset_gpio)
* }
* }
*/
acpigen_write_method_serialized("BTRK", 1);
{
acpigen_write_if_lequal_op_int(ARG0_OP, 1);
{
acpigen_soc_set_tx_gpio(reset_gpio);
}
acpigen_write_else();
{
acpigen_soc_clear_tx_gpio(reset_gpio);
}
acpigen_pop_len();
}
acpigen_pop_len();
acpigen_pop_len();
}

View file

@ -119,7 +119,8 @@ 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(config->enable_gpio.pins[0]);
acpi_device_intel_bt_common(config->enable_gpio.pins[0],
config->reset_gpio.pins[0]);
printk(BIOS_INFO, "%s: %s at %s\n", path,
config->desc ? : dev->chip_ops->name, dev_path(dev));

View file

@ -131,7 +131,7 @@ static void cnvw_fill_ssdt(const struct device *dev)
* Local2 = Zero
* If ((GBTE() == One))
* {
* BTRK (Zero)
* \_SB.PCI0.BTRK (Zero)
* Sleep (105)
* Local2 = One
* }
@ -143,7 +143,7 @@ static void cnvw_fill_ssdt(const struct device *dev)
* PRRS = CNVI_PLDR_COMPLETE
* If ((Local2 == One))
* {
* BTRK (One)
* \_SB.PCI0.BTRK (One)
* Sleep (105)
* }
* }
@ -211,7 +211,7 @@ static void cnvw_fill_ssdt(const struct device *dev)
acpigen_write_store_int_to_op(0, LOCAL2_OP);
acpigen_write_if_lequal_namestr_int("\\_SB.PCI0.GBTE", 1);
{
acpigen_emit_namestring("BTRK");
acpigen_emit_namestring("\\_SB.PCI0.BTRK");
acpigen_emit_byte(0);
acpigen_write_sleep(105);
@ -251,7 +251,7 @@ static void cnvw_fill_ssdt(const struct device *dev)
acpigen_write_if_lequal_op_int(LOCAL2_OP, 1);
{
acpigen_emit_namestring("BTRK");
acpigen_emit_namestring("\\_SB.PCI0.BTRK");
acpigen_emit_byte(1);
acpigen_write_sleep(105);
}