From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9745C982DA for ; Mon, 21 Sep 2026 05:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1U2gugEVA3yAm9R75YDCA/RqtUOcaCCixQ4ONyR/1dk=; b=LKgXPoV94L5dOIbXxDAaWd3KU4 u76Zx2c2bRRIstdtUVtZAwcmnQCQtiMkmHQG0NOOqLvQu56Wy0Bd5wO4fYk9On/hl3wIs6Jh8eXtr p9h1RqGBvkALGrsp7YdBW5e2Zo+M4GjlNEm/l2TcgUyqNyuXcMQxOonog3Ar1qlwS8sRnpbmK/ypO kyZLc7YAO25zoai1ipmat3W9AKcdYJbna4/heuGnyL6OJtPxTe/CiOZ4H5VaX1mRfZM5oTpOHJSBN 3YHazUF9efskptPjPEj/5lp3zHIDvBEcIFK/laVUkbONiFJt8+RaiRSgpTQi4zmzYcAE5yaxRE7wG r4oH+bKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8VZ7-00000000ocE-16wF; Mon, 21 Sep 2026 04:23:41 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8VZ0-00000000oV4-0DpU for linux-arm-kernel@lists.infradead.org; Mon, 21 Sep 2026 04:23:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 50D9844AA1; Mon, 21 Sep 2026 04:23:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 1488DC4AF15; Mon, 21 Sep 2026 04:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1789964613; bh=DHOOUWew6XqstWVudeHYH34B8AdGFHQzXLMLdRJhDzs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rKiTDvXFRXLfuvVDrn3FnKb+hYqV+OD/fAUANM6wBkL2z83o0nOg49Em5bZyuBti0 tjJ3zwEQEGAl7undb2nUmuZ6MNhcONTbkhCpk/f/hW6pf5cRdDV1pXoC+jjS97HZxJ vhlY+VhkVue/5cDNMkZW89kRuYrlnvar2AOpVyV+tKKs9Tab70SNUhabjq/AnqE1Fe VEWtethkt+8aom+QmVJ4pBc82Vdr1n9HoYtszz1iGsnTS2Nv0Ovxcuxwdu1FfpcEj9 H6Bp2EJWfcjjwUGCWaUdtiTt95XzXnRRkpefM7fkNLYOM/i9qldyK3klBM32hJ6b5a fToxGLMlVEkqQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE991C982DA; Mon, 21 Sep 2026 04:23:32 +0000 (UTC) From: Long Zhao via B4 Relay Date: Mon, 21 Sep 2026 12:23:30 +0800 Subject: [PATCH v8 11/18] gpio: pl061: use IRQ_TYPE_LEVEL_MASK and IRQ_TYPE_EDGE_BOTH MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260921-cv75-v5-v8-11-282ff5d98dda@ambarella.com> References: <20260921-cv75-v5-v8-0-282ff5d98dda@ambarella.com> In-Reply-To: <20260921-cv75-v5-v8-0-282ff5d98dda@ambarella.com> To: Arnd Bergmann , Krzysztof Kozlowski , Alexandre Belloni , soc@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Long Zhao , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Jerome Brunet , Linus Walleij , Bartosz Golaszewski , Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Catalin Marinas , Will Deacon , Long Zhao , Lee Jones , mfd@lists.linux.dev, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789964608; l=1319; i=longzhao@ambarella.com; s=20260730; h=from:subject:message-id; bh=nz51yActj1YXpv3NW2G+jZPYSgBHFOPI8W4g4YsvTL4=; b=uKCp/46nsRO5BF/rtCpHTEFHOuSWs4cyunvPht6xRRVU1PnHLtQLijpPhG92Ufs7PJYr/fp25 utNTH4rmibLDMpgHGX6Xy/HeqaUQTAPelYEYno50LWM3YnnwhTz8fx5 X-Developer-Key: i=longzhao@ambarella.com; a=ed25519; pk=/xGhPTOX0/eYsyTWzyjjgAIW1Z/YD+IlnOnvcdRozow= X-Endpoint-Received: by B4 Relay for longzhao@ambarella.com/20260730 with auth_id=903 X-Original-From: Long Zhao X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: longzhao@ambarella.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Long Zhao Use the standard IRQ_TYPE_LEVEL_MASK and IRQ_TYPE_EDGE_BOTH helpers instead of open-coded edge and level comparisons. Signed-off-by: Long Zhao --- drivers/gpio/gpio-pl061.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 66aea0856bc4..2913daf46aff 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -167,9 +167,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) if (offset < 0 || offset >= PL061_GPIO_NR) return -EINVAL; - if ((trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) && - (trigger & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))) - { + if ((trigger & IRQ_TYPE_LEVEL_MASK) && (trigger & IRQ_TYPE_EDGE_BOTH)) { dev_err(gc->parent, "trying to configure line %d for both level and edge " "detection, choose one!\n", @@ -184,7 +182,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) regmap_read(pl061->regmap, GPIOIS, &gpiois); regmap_read(pl061->regmap, GPIOIBE, &gpioibe); - if (trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { + if (trigger & IRQ_TYPE_LEVEL_MASK) { bool polarity = trigger & IRQ_TYPE_LEVEL_HIGH; /* Disable edge detection */ -- 2.34.1