Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1148097pxb; Thu, 19 Aug 2021 22:04:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOJ5tZSNG+zK2MGUmv3+/T2xfwIoBOkVvNqvTK2fYL7Kc3PoaaxM2noEos1kAjp+Y4jqVJ X-Received: by 2002:a05:6402:482:: with SMTP id k2mr20635644edv.188.1629435865234; Thu, 19 Aug 2021 22:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629435865; cv=none; d=google.com; s=arc-20160816; b=jnvsIKXZ3FPWpmgKorD0AWQA0DwOfmqA4x3kKklWfWLVHOviw45YyY8FiCkkvA6BtL mc5R7jKizkOVaUtfHmoatzmnPIg7+dFDgvaIWrZEvLjwZ/FnRYE8Uqt3ZBPyXfSPLLc0 20822XlEBnZTXXsxb1TDSk25yrwKK2qQKcUiJzsAKdPM6x7Y/U10rysoYdJ/BbAJ+xxa qIVIp2yIKTs3MIXJEI9TjNo9Mv9LGFyD4yvBpQnPmQHlh2Gj1g7xFFPMwklRKkxxRYVP cRjIx2iaRm2JKX6AMro7gdQi1yz5t2v0FBSeHKBQxu8Rce4jttlqftVP185w9Qo323yH UQ4g== 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=DuFJTMIgnE6qkb5/qXuxRtYziawNZCDPFG0x0p2dOEM=; b=E3KvFEX7GBj7zj9L3XFLXnDEk0/1ezKkbpQuSKwhAuT6Fis4U95ACoLd4aXyRp/sg1 d5fIz2uCLo+5piYgzvSkPwZcoicF2loetnrDAGu+k35i0kjrGO1F4nSLupbiDTuNCoKv sFK0iJHL+nq/Jd1jNr91t/0c+rGRcwwvS8o8hE9NvVDzsMFCAELjUaVGDmVfyIgXHV1o tBjFEm753GRVCTwXCf3jsdXph2mgAjjG0+N4P+p7/MHDPP7a1z6796h/lOB23BWKX0RX 3Bqp/Q4c54UG6KKsNNH6HZrI1vGS86YtLl8SHvqL3GfO6+CvgyCW/2H5AghkUMNJfzgB pXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@quicinc.com header.s=qcdkim header.b=LFqOQRLK; 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=fail (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 r25si5375605eds.112.2021.08.19.22.03.59; Thu, 19 Aug 2021 22:04:25 -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=fail header.i=@quicinc.com header.s=qcdkim header.b=LFqOQRLK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238536AbhHTE7j (ORCPT + 99 others); Fri, 20 Aug 2021 00:59:39 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:43416 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237899AbhHTE72 (ORCPT ); Fri, 20 Aug 2021 00:59:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1629435531; x=1660971531; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=IWJ0A04ElihV+hsa8p2cu+aTFCm2Gzo/yxHhJJUCiV0=; b=LFqOQRLKXZdgDAlofSmiQj3WDUDAlnLvMKl2l6F80YX4imcSlFj7OUNf v7fPTz3TWMyS66mYJhitSRtNfhB1oR2kh9A/2chfTowdkTJMmVSm5jtvi XNwOW4ErNmkRhKSXsVfhZOhUBq6Aew255eIWg5CbF1HJUxLx2U2WN3Lui M=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 19 Aug 2021 21:58:51 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2021 21:58:51 -0700 Received: from nalasex01c.na.qualcomm.com (10.47.97.35) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Thu, 19 Aug 2021 21:58:51 -0700 Received: from fenglinw-gv.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.858.15; Thu, 19 Aug 2021 21:58:48 -0700 From: Fenglin Wu To: , , CC: , , , Yimin Peng Subject: [PATCH V1 7/9] spmi: pmic-arb: support updating interrupt type flags Date: Fri, 20 Aug 2021 12:58:02 +0800 Message-ID: <1629435488-10228-8-git-send-email-quic_fenglinw@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629435488-10228-1-git-send-email-quic_fenglinw@quicinc.com> References: <1629435488-10228-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: nasanexm03h.na.qualcomm.com (10.85.0.50) To nalasex01c.na.qualcomm.com (10.47.97.35) 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; } -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.