mb/google/brya: Check power state before process _ON method for BT
According to ACPI spec, OSPM will not check _STA first and may run the _ON method repeatedly, even if the resource is already on. GPIO CNV_BTEN, CNV_BT_IF_SELECT and BT_RESRT_GPIO are already enabled before entering OS, but OS still try to run method _ON during boot up process. Therefore, try to check the GPIO state first to avoid unnecessary operation and interfere touch enabling sequence. BUG=b:454848201 TEST="rebuild and dump dsdt to check asl code generate as expected" Change-Id: I8bd517c3a5ca46c7c8b8ad436af5e4be2295b631 Signed-off-by: Simon Yang <simon1.yang@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89849 Reviewed-by: Eric Lai <ericllai@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
0f7c54d7d1
commit
bb3e59051a
1 changed files with 17 additions and 8 deletions
|
|
@ -8,11 +8,17 @@
|
|||
#define BT_RESET_GPIO GPP_D4
|
||||
#endif
|
||||
|
||||
/* Delay in milliseconds for BT_RESET */
|
||||
#ifndef BT_RESET_DELAY_MS
|
||||
#define BT_RESET_DELAY_MS 105
|
||||
#endif
|
||||
|
||||
#define CNV_BTEN GPP_VGPIO_0
|
||||
#define CNV_BT_IF_SELECT GPP_VGPIO_5
|
||||
|
||||
External (\_SB.PCI0.CTXS, MethodObj)
|
||||
External (\_SB.PCI0.STXS, MethodObj)
|
||||
External (\_SB.PCI0.GTXS, MethodObj)
|
||||
|
||||
Scope (\_SB.PCI0.XHCI.RHUB.HS10)
|
||||
{
|
||||
|
|
@ -25,18 +31,21 @@ Scope (\_SB.PCI0.XHCI.RHUB.HS10)
|
|||
|
||||
Method (_ON, 0, NotSerialized) // _ON_: Power On
|
||||
{
|
||||
\_SB.PCI0.STXS(CNV_BTEN);
|
||||
\_SB.PCI0.STXS(CNV_BT_IF_SELECT);
|
||||
\_SB.PCI0.STXS(BT_RESET_GPIO);
|
||||
Sleep (105)
|
||||
If (LEqual (\_SB.PCI0.GTXS(BT_RESET_GPIO), 0)) {
|
||||
\_SB.PCI0.STXS(CNV_BTEN)
|
||||
\_SB.PCI0.STXS(CNV_BT_IF_SELECT)
|
||||
\_SB.PCI0.STXS(BT_RESET_GPIO)
|
||||
}
|
||||
}
|
||||
|
||||
Method (_OFF, 0, NotSerialized) // _OFF: Power Off
|
||||
{
|
||||
\_SB.PCI0.CTXS(CNV_BTEN);
|
||||
\_SB.PCI0.CTXS(CNV_BT_IF_SELECT);
|
||||
\_SB.PCI0.CTXS(BT_RESET_GPIO);
|
||||
Sleep (105)
|
||||
If (LEqual (\_SB.PCI0.GTXS(BT_RESET_GPIO), 1)) {
|
||||
\_SB.PCI0.CTXS(CNV_BTEN)
|
||||
\_SB.PCI0.CTXS(CNV_BT_IF_SELECT)
|
||||
\_SB.PCI0.CTXS(BT_RESET_GPIO)
|
||||
Sleep (BT_RESET_DELAY_MS)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue