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 24813C433EF for ; Mon, 10 Jan 2022 14:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WQn3sSYqDTAxRTIjV/Cy4wlbf0Ou1Obqc+EoQLEZ/dk=; b=WBEblugPsjVzue vzXNKYIkShFh/23fpJbHCNdTiQ1fwvcN0IiuMvyYgpAXKB/CZlbXqoocEzsmirKCc1kFAy+kdgnLD see//UHRUDB1MBAo0RfIJkntQmOj59C7b1Qo/qAfswT1f8DQt6heyfvSsnJfPvLapXn681Fbbd9i9 i6EDCmIJZloVMJGRrJhBbTcPHnP7xx3WRaTtI/E2Fq4aTfpR5/rK/6d68Ru3OOUfibkQj1EvHrAoe 1PszA2RVjyn9q09vqnruz38J+voHyhRhjVrMx/ZwxArmDoTE79qtTZxbgjeNUP56cnmlMDmSBQ0g7 OJ24ozkCiKkQZAN9KMyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6w4M-00BvWO-FN; Mon, 10 Jan 2022 14:54:46 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6w4G-00BvTa-Ct; Mon, 10 Jan 2022 14:54:43 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E55E612D3; Mon, 10 Jan 2022 14:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E53CBC36AE5; Mon, 10 Jan 2022 14:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641826478; bh=2GFKBVlGVyrdt8jr/lsSHz+rU5gODeLSDcA2EU57NWs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PoPa3loZBSqTs8x3vUnx56qvt9faJ7woF1rTSqBULcv0F3Uapc6wCySo1zGJZ1910 etZDPtHPvKNrWDPtDIHzwPsi2XRmvIfgatpye+GpUT/ZhXPzGEm+LFs33hAwR1KbDe 863e+QTz5DBgYnAbXDGLqlipxHEKIP1K3ybR+URQH6xgCfLOvYoNsWKhpTZp166XE6 vp6G/5r6frFNhWqVTc3Im0Q1r5R2HJT19zFPjBLTcE3XVIb66409LXQpbtJL5qXjRa W7dis9BSK9t+3Ti1CfzjM/IAAg6IVP3IW/mVVKYdH+dWwAh01GGnvh6Erq27lwIBaT B+ycFyhNYpNqw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n6w4D-00H9tA-1H; Mon, 10 Jan 2022 14:54:37 +0000 Date: Mon, 10 Jan 2022 14:54:36 +0000 Message-ID: <87lezntzdf.wl-maz@kernel.org> From: Marc Zyngier To: qianggui.song Cc: Thomas Gleixner , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , , , Subject: Re: [PATCH 4/4] irqchip/meson-gpio: Add support for meson s4 SoCs In-Reply-To: <835a3f28-ec6a-9cd2-d574-5ef87b630fb3@amlogic.com> References: <20220108084218.31877-1-qianggui.song@amlogic.com> <20220108084218.31877-5-qianggui.song@amlogic.com> <87r19itrjx.wl-maz@kernel.org> <835a3f28-ec6a-9cd2-d574-5ef87b630fb3@amlogic.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: Qianggui.Song@amlogic.com, tglx@linutronix.de, khilman@baylibre.com, narmstrong@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220110_065440_617914_A93A6DA9 X-CRM114-Status: GOOD ( 30.74 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 10 Jan 2022 12:32:23 +0000, qianggui.song wrote: > > > > On 1/8/22 7:06 PM, Marc Zyngier wrote: > > > > On Sat, 08 Jan 2022 08:42:18 +0000, > > Qianggui Song wrote: > >> > >> The meson s4 SoCs support 12 gpio irq lines compared with previous > >> serial chips and have something different, details are as below. > >> > >> IRQ Number: > >> - 80:68 13 pins on bank Z > >> - 67:48 20 pins on bank X > >> - 47:36 12 pins on bank H > >> - 35:24 12 pins on bank D > >> - 23:22 2 pins on bank E > >> - 21:14 8 pins on bank C > >> - 13:0 13 pins on bank B > >> > >> - PADCTRL_GPIO_IRQ_CTRL0 > >> bit[31]: enable/disable the whole irq lines > > > > s/the whole/all the/ > Okay > > > >> bit[12-23]: single edge trigger > >> bit[0-11]: poll trigger > >> > >> - PADCTRL_GPIO_IRQ_CTRL[X] > >> - bit[0-16]: 7 bits to chooge gpio source for irq line 2*[X] - 2 > > > > choose? > yes it is choose > > > >> - bit[16-22]:7 bits to chooge gpio source for irq line 2*[X] - 1 > >> where X = 1-6 > >> > >> - PADCTRL_GPIO_IRQ_CTRL[7] > >> bit[0-11]: both edge trigger > > > > This information would fit better in the code than in the commit > > message. > > > will copy this to code. > >> > >> Signed-off-by: Qianggui Song > >> --- > >> drivers/irqchip/irq-meson-gpio.c | 51 ++++++++++++++++++++++++++++++++ > >> 1 file changed, 51 insertions(+) > >> > >> diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c > >> index 98419428fcbd..c5d20a866c37 100644 > >> --- a/drivers/irqchip/irq-meson-gpio.c > >> +++ b/drivers/irqchip/irq-meson-gpio.c > >> @@ -42,6 +42,11 @@ > >> #define REG_PIN_SEL_SHIFT(x) (((x) % 4) * 8) > >> #define REG_FILTER_SEL_SHIFT(x) ((x) * 4) > >> +/* use for s4 chips */ > > > > s/use/Used/ > okay > > > >> +#define REG_EDGE_POL_S4 0x1c > >> +#define REG_EDGE_POL_MASK_S4(x) \ > >> + ({typeof(x) _x = (x); BIT(_x) | BIT(12 + (_x)); }) > > > > Why on Earth should this macro handle multiple types? > If I use #define REG_EDGE_POL_MASK_S4(x) (BIT(x) | BIT(12 + (x)), when > run git format-patch -1 --stdout | ./script/checkpath.pl --strict -, > will get a message > CHECK: Macro argument reuse 'x' - possible side-effects? Well, either expand the macro directly in the code (after all, there is only one use for it) or make this a C function instead of a macro. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel