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: 48242e3053 ("usb: typec: fusb302: Revert "Resolve fixed power role contract setup")
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Ib4cf3b752d0db116f2603d5e1f3ee5c7d114714a
This commit is contained in:
Frank Wang
2021-11-17 09:34:52 +08:00
committed by Tao Huang
parent 0909f637bb
commit 94dab507e0

View File

@@ -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;
}