usb: typec: fusb302: Check vconn is off when we start toggling
PATCH v2 4/8 usb: typec: fusb302: Check vconn is off when we start toggling
Quoted 5 lines · Hans de Goede
The datasheet says the vconn MUST be off when we start toggling. The
tcpm.cstate-machine is responsible to make sure vconn is off, but lets add aWARN_ONcheck to catch any cases where vconn is not off for some reason.
Curious - have you seen this happening ?
Quoted 10 lines
Signed-off-by Hans de Goede <[email protected]>--- drivers/usb/typec/tcpm/fusb302.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/typec/tcpm/fusb302.c +0
-0
drivers/usb/typec/tcpm/fusb302.c static int fusb302_set_toggling(struct fusb302_chip *chip, · line 611
Quoted 5 lines
drivers/usb/typec/tcpm/fusb302.c +2
-0@@ -607,6 +607,8 @@ static int fusb302_set_toggling(struct fusb302_chip *chip,return ret; chip->intr_togdone = false; }else { +/* Datasheet says vconn MUST be off when toggling */ +WARN_ON (chip->vconn_on);
Personally I am not a friend of WARN_ON. I prefer WARN statements telling me what is wrong.
Quoted 6 lines
drivers/usb/typec/tcpm/fusb302.c +0
-0/* unmask TOGDONE interrupt */ ret =fusb302_i2c_clear_bits (chip,FUSB_REG_MASKA ,FUSB_REG_MASKA_TOGDONE );Signature · 1 line
2.20.1