pogo_transport: Fix HES mistriggered cases

There are two cases for the HES mistriggered events.

Case #1: H1S state 0 reported during the acc detection
[ 4164.863428] EV:H1S state 1
[ 4164.863633] H1S: accessory detection 0, mfg 0
[ 4164.863637] QUEUE EVENT 3
[ 4164.864567] POGO ACC IRQ triggered
[ 4164.864665] Pogo acc threaded irq running, acc_detect 0
[ 4164.864768] POGO ACC IRQ triggered
[ 4164.864816] Pogo acc threaded irq running, acc_detect 0
[ 4164.864961] POGO ACC IRQ triggered
[ 4164.864999] Pogo acc threaded irq running, acc_detect 1
[ 4164.865002] QUEUE EVENT 4
[ 4164.865082] EV:H1S state 0
[ 4164.865086] EV:ACC_GPIO_ACTIVE
[ 4164.865094] pending state change STANDBY -> STANDBY_ACC_DEBOUNCED @ 20 ms
[ 4164.867384] POGO ACC IRQ triggered
[ 4164.867434] Pogo acc threaded irq running, acc_detect 0
[ 4164.888241] [ 5805] state change STANDBY -> STANDBY_ACC_DEBOUNCED [delayed 20 ms] []

Case #2: H1S stays at 1 during the acc detection
[  861.585046] EV:H1S state 1
[  861.586088] POGO ACC IRQ triggered
[  861.586189] Pogo acc threaded irq running, acc_detect 0
[  861.586318] POGO ACC IRQ triggered
[  861.586358] Pogo acc threaded irq running, acc_detect 0
[  861.586391] POGO ACC IRQ triggered
[  861.586430] Pogo acc threaded irq running, acc_detect 1
[  861.586433] QUEUE EVENT 4
[  861.586571] EV:ACC_GPIO_ACTIVE
[  861.586584] pending state change STANDBY -> STANDBY_ACC_DEBOUNCED @ 20 ms
[  861.588522] POGO ACC IRQ triggered
[  861.588672] Pogo acc threaded irq running, acc_detect 0
[  861.609863] [ 1063] state change STANDBY -> STANDBY_ACC_DEBOUNCED [delayed 20 ms] []
[  865.464562] POGO ACC IRQ triggered
[  865.464805] Pogo acc threaded irq running, acc_detect 1
[  865.464818] QUEUE EVENT 4
[  865.465221] EV:ACC_GPIO_ACTIVE
[  865.465232] pending state change STANDBY_ACC_DEBOUNCED -> STANDBY_ACC_DEBOUNCED @ 20 ms
[  865.471192] POGO ACC IRQ triggered
[  865.471393] Pogo acc threaded irq running, acc_detect 0
[  865.486007] [ 1072] state change STANDBY_ACC_DEBOUNCED -> STANDBY_ACC_DEBOUNCED [delayed 20 ms] []
[  865.602370] POGO IRQ triggered
[  865.602636] Pogo threaded irq running, pogo_gpio 0

For Case #1, run acc detaching process when the ACC_GPIO_ACTIVE event is
triggered.

For Case #2, disable acc regulator when the POGO IRQ is triggered (GPIO
active) and continue to normal dock detection.

Bug: 288341638
Change-Id: I6f5c45ff892cec8d59f45eb7694db879f1978361
Signed-off-by: Kyle Tso <kyletso@google.com>
1 file changed