Skip to content

Commit 2aa670b

Browse files
author
Wang Jie
committed
mfd: fusb302: fix dp detection error when increasing i2c frequency
If the timer_mux is started again after the N_DEBOUNCE_CNT+1 detection is completed, the PD detection process may be mistakenly closed in the fusb_state_src_send_caps(), resulting in failure to detect dp. step1: when fusb_state_attach_wait_source set conn_state to "attached_source", it will restart timer_mux_machine (1) with 2ms. Many i2c communications go on. conn_state == policy_src_send_caps step2: policy_src_send_caps would wait timer_mux_machine (T_NO_RESPONSE) to disabled PD detection until policy_send_data run succeed to close timer_mux_machine. state_machine_typec() static void fusb_state_src_send_caps(struct fusb30x_chip *chip, u32 evt) switch (chip->sub_state) { case 1: tmp = policy_send_data(chip); if (tmp == tx_success) { .... chip->timer_mux = T_DISABLED; /* (2) close timer_mux */ } .... default: if (evt & EVENT_TIMER_MUX) { .... set_state(chip, disabled); /* (3) just designed for T_NO_RESPONSE */ } When (1) timerout event triggered before (2), it would mistakenly into (3). solution: The N_DEBOUNCE_CNT+1 test is complete, do not start the timer_mux again. Signed-off-by: Wang Jie <dave.wang@rock-chips.com> Change-Id: I401ca594c875e8e5342b0e2cdfb602500c980a91
1 parent 5d21dac commit 2aa670b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mfd/fusb302.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,8 +1692,8 @@ static void fusb_state_attach_wait_source(struct fusb30x_chip *chip, u32 evt)
16921692
set_state(chip, attached_source);
16931693
} else {
16941694
set_state_unattached(chip);
1695-
return;
16961695
}
1696+
return;
16971697
}
16981698

16991699
chip->timer_mux = 2;

0 commit comments

Comments
 (0)