Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5632512pxb; Sun, 7 Nov 2021 16:50:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMqJm25NthzcODkVSfu9O8MT4VZqAWLg4IgmaEmJEWmPtg57fGiLht9prghf1db9pOzBsE X-Received: by 2002:a17:906:7d09:: with SMTP id u9mr93935105ejo.120.1636332619891; Sun, 07 Nov 2021 16:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636332619; cv=none; d=google.com; s=arc-20160816; b=QxWYCOH+mqlsc5RZRk/ukyif/lE002z66dZxYRWAzilQnUL+Q/o/6h2C9jsNsDleFR Nuy31dm3LW2mxzbmgs3/LXXVQTtBytaON9XMgqirI9UfulOF0yymmwfnxFKuLiR6ODMq vukNIXcNEVvyjQTLeH1UHm9Vg9n2LvlbcWimXcKwntSiBiKKBKzMI/1czUY2KsPIPSxO dWbIznynE4NFtIFneoPntz2wberklGB3F8BMiC6GElNJcrFcZ7b4yxTZkuyuQBGKqIoJ 6hjz2gGNfd5Z30GyehlPLlTVo0YTlrqwKXEaLvozJ7qi+tyon8EjB93wAC/nVDalZ7Oz SDZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:to:from:date :dkim-signature; bh=ztn7OXEvHys1kWorp/vlxSHz7XWFXoKB43XIadc1I2k=; b=Cu49fIw0rZQoPTA6aHJ7qq8uctLPL9GbFHaijlr2c37PJ+gBhm5/GHHkyRkhBh/wBK q5OG9HDCzbyWhLOg4r1Ngd56tQMtutA2RM7W7fx0zz4pVB6MR6o1ShWJIIVT2dGnlA2x SjoFO6Lvrjhz8kK7TneNuluEJQuM9V8HymBHBe6Cos3dNU9SlEoDdkpbl58i8spc8UlG QNZrO7B2qVVj45X+2wmF4T6e7DvEC5WVUBmF3VJPuZTJmPIWsWyJhu4EqPmgu7WeXs2W fiidIkIpwAP72UXigkhiJFw4N3GgeUgiayPJMG5BPUD2Sb9A/s1KEXQ9oXNRfKx4WS79 IKpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=oqFaWNSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si23239530eds.594.2021.11.07.16.49.56; Sun, 07 Nov 2021 16:50:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=oqFaWNSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236232AbhKGTJm (ORCPT + 99 others); Sun, 7 Nov 2021 14:09:42 -0500 Received: from vps.xff.cz ([195.181.215.36]:41350 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbhKGTJk (ORCPT ); Sun, 7 Nov 2021 14:09:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1636311444; bh=wy8oGQ/IddhtpuNDv1H1qik8p/4msedKxLoUzVvtIP4=; h=Date:From:To:Subject:X-My-GPG-KeyId:References:From; b=oqFaWNSlHR1aVbQM9c1jy+nJb8eLvHo3CuYpIvlBCHpMK3Wa33pG0F4YRm4PG66Zs heNvziTOwtGUw9PO2wpD5fkhQQZZjNVxvoKg9hZl7zn3sV2I+0xYmcJaAK5EvcxDXo GzKuDSdtsDuXkpk0WaARiHR0HelWEHp3RxiSzdyM= Date: Sun, 7 Nov 2021 19:57:24 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Badhri Jagan Sridharan , "open list:USB TYPEC PORT CONTROLLER DRIVERS" , open list Subject: Re: [PATCH 06/15] usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts Message-ID: <20211107185724.ik6wthsl3e6qlbj3@core> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Badhri Jagan Sridharan , "open list:USB TYPEC PORT CONTROLLER DRIVERS" , open list X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED References: <20211107185435.2540185-1-megous@megous.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211107185435.2540185-1-megous@megous.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sun, Nov 07, 2021 at 07:54:33PM +0100, megous hlavni wrote: > The masks are swapped (interrupts are enabled when the mask is 0). Please ignore the 06/15 in the subject. This is just a single patch from my local series and I forgot to edit the subject. kind regards, o. > This caused inability of the driver to recognize cable unplug events > in host mode (where only comparator interrupt is generated, and VBUS > interrupt is not). > > Signed-off-by: Ondrej Jirman > --- > drivers/usb/typec/tcpm/fusb302.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c > index 7a2a17866a823..72f9001b07921 100644 > --- a/drivers/usb/typec/tcpm/fusb302.c > +++ b/drivers/usb/typec/tcpm/fusb302.c > @@ -669,25 +669,27 @@ 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); > goto done; > } > chip->intr_comp_chng = true; > + chip->intr_bc_lvl = false; > break; > case TYPEC_CC_RD: > 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", > ret); > goto done; > } > chip->intr_bc_lvl = true; > + chip->intr_comp_chng = false; > break; > default: > break; > -- > 2.33.1 >