From 94dab507e05695a703ea9540f34f537dc720f721 Mon Sep 17 00:00:00 2001 From: Frank Wang Date: Wed, 17 Nov 2021 09:34:52 +0800 Subject: [PATCH] usb: typec: fusb302: fix i_comp and i_bc_lvl interrupt The software utilizes I_COMP and I_BC_LVL interrupts to determine an attach and what type of port is attached. and I_COMP interrupt also alerts software that a SRC detach has occurred. So unmask I_COMP for SRC and I_BC_LVL for SNK. Fixes: 48242e30532b ("usb: typec: fusb302: Revert "Resolve fixed power role contract setup") Signed-off-by: Frank Wang Change-Id: Ib4cf3b752d0db116f2603d5e1f3ee5c7d114714a --- drivers/usb/typec/tcpm/fusb302.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index ebc46b9f776c..ff82b6ae6850 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c @@ -668,7 +668,7 @@ static int tcpm_set_cc(struct tcpc_dev *dev, enum typec_cc_status cc) ret = fusb302_i2c_mask_write(chip, FUSB_REG_MASK, FUSB_REG_MASK_BC_LVL | FUSB_REG_MASK_COMP_CHNG, - FUSB_REG_MASK_COMP_CHNG); + FUSB_REG_MASK_BC_LVL); if (ret < 0) { fusb302_log(chip, "cannot set SRC interrupt, ret=%d", ret); @@ -680,9 +680,9 @@ static int tcpm_set_cc(struct tcpc_dev *dev, enum typec_cc_status cc) ret = fusb302_i2c_mask_write(chip, FUSB_REG_MASK, FUSB_REG_MASK_BC_LVL | FUSB_REG_MASK_COMP_CHNG, - FUSB_REG_MASK_BC_LVL); + FUSB_REG_MASK_COMP_CHNG); if (ret < 0) { - fusb302_log(chip, "cannot set SRC interrupt, ret=%d", + fusb302_log(chip, "cannot set SNK interrupt, ret=%d", ret); goto done; }