Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2428171pxb; Fri, 17 Sep 2021 09:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ7SXvGUeG/NTixS3abo586vygyyGzClH9/zTB44TtGu56pYYWdtZCqCpDXOcczmXZnLuG X-Received: by 2002:a7b:cf09:: with SMTP id l9mr11112955wmg.115.1631896292858; Fri, 17 Sep 2021 09:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631896292; cv=none; d=google.com; s=arc-20160816; b=qLPtBfUlZTRYETDCCuGrUfGsxYB82wWP0aICZ5PSm7q7XIlL8svUBXtReQ0hnW9nio lhn7iwLZGiMSOlYp14rb11kBFYgP6v+5pK5We6iH8IXB1v1vXSAKEGVAU866q//Q30xO PxxBC73UOA/YxAB7NIJV6Po96zcm4cJiY2qtqJITV3RphE3AK36ImEhCV9JG28E43UYc xFVMf15G1PgAh7ItBfUPZwPrueQ11FKqGPYQP2eFyFYPkSteSpCdXwgDJz74OP6pRQB3 bdFmodNI6cx52Aen7oI3cUc8Q9oCZpzj1/x4Cv/3xc1tfq+jswiBWTHmfKNxwADSqd/A sCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kOj1T/M9/T/1A0YLEYHMt7zmOnXmigoTevu8jxHooAU=; b=bFqfMusF48/8TxI5clnOyDL51/XI6Ta2bJTIhF5qSL627lZ0gHXs4Bb9Y6as5hZTbo wNekzULNFBza/PkZyqPTO1NVZrPsyAM8yOnLNC/3Hv6VePjigOzAg75w/eiKkSy5DDG2 Uppdu3r6m6qUjxVFO0gG4VG63D1hUuH/R+hIKNh3GVggmnGuj76RL+nD5kIulr+OLPQy Li6b93Rum1o4BciMtAkL1UUhjRGt/d31ieB2uiPEv+6RiAFlvr2L7JgqpjWe2H6Y147T AWuO9uv0Bnmt2hp6Wself7lUMg+y4dPKGItP9AMno5KwttFGez8zLri69BgO1gWQ/0Iv wyhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Odl4i+Wc; 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=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si6254964edi.530.2021.09.17.09.30.51; Fri, 17 Sep 2021 09:31:32 -0700 (PDT) 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=@quicinc.com header.s=qcdkim header.b=Odl4i+Wc; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245136AbhIQGfK (ORCPT + 99 others); Fri, 17 Sep 2021 02:35:10 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:14950 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238174AbhIQGeu (ORCPT ); Fri, 17 Sep 2021 02:34:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1631860409; x=1663396409; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=kOj1T/M9/T/1A0YLEYHMt7zmOnXmigoTevu8jxHooAU=; b=Odl4i+Wc7HX4FxpZXEVk0wwCX5nQu2iFR+uYEQtxFCjfu2GdOfYuqX6a jrudeTwa/F+KS12kazDOMQPXxADRPVLiJDN02kJGaD5d4a8FNmOgLruCt OAELanGWvDa5nNd/OiAmUrzmCSbuj3trWReBD54LbYaQlbAvRjKZMJAUs U=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 16 Sep 2021 23:33:29 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 23:33:28 -0700 Received: from fenglinw-gv.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Thu, 16 Sep 2021 23:33:26 -0700 From: Fenglin Wu To: , , CC: , , , Yimin Peng Subject: [RESEND PATCH v1 7/9] spmi: pmic-arb: support updating interrupt type flags Date: Fri, 17 Sep 2021 14:33:02 +0800 Message-ID: <1631860384-26608-8-git-send-email-quic_fenglinw@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631860384-26608-1-git-send-email-quic_fenglinw@quicinc.com> References: <1631860384-26608-1-git-send-email-quic_fenglinw@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yimin Peng Have the qpnpint_irq_set_type function clear unwanted high/low trigger bits when updating the interrupt flags. Signed-off-by: Yimin Peng Signed-off-by: Subbaraman Narayanamurthy Signed-off-by: Fenglin Wu --- drivers/spmi/spmi-pmic-arb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index 9239830..988204c 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -636,8 +636,12 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type) type.type |= BIT(irq); if (flow_type & IRQF_TRIGGER_RISING) type.polarity_high |= BIT(irq); + else + type.polarity_high &= ~BIT(irq); if (flow_type & IRQF_TRIGGER_FALLING) type.polarity_low |= BIT(irq); + else + type.polarity_low &= ~BIT(irq); flow_handler = handle_edge_irq; } else { @@ -646,10 +650,13 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type) return -EINVAL; type.type &= ~BIT(irq); /* level trig */ - if (flow_type & IRQF_TRIGGER_HIGH) + if (flow_type & IRQF_TRIGGER_HIGH) { type.polarity_high |= BIT(irq); - else + type.polarity_low &= ~BIT(irq); + } else { type.polarity_low |= BIT(irq); + type.polarity_high &= ~BIT(irq); + } flow_handler = handle_level_irq; } -- 2.7.4