From patchwork Mon Jan 8 07:33:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixun Lan X-Patchwork-Id: 10149129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 19B58602B3 for ; Mon, 8 Jan 2018 07:34:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B8302870C for ; Mon, 8 Jan 2018 07:34:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3A1D288C6; Mon, 8 Jan 2018 07:34:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A2582870C for ; Mon, 8 Jan 2018 07:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WNiy8zeemYzb+paprdtr/ldETzqac4N5hooqUubcFFg=; b=DPX9rHiqytuSYY vHL6Kf2sOKtOANmQwmbe8hY9F/YlK+SsSLNy4gutt3FHwd5W+hayV+3IkJbK/rpclK23qitoUqJx3 87M0vgiev2vmu8QRv31GcMMxwcvED+BnzvnNh9SsHnVIff2JH58bjVjonnEcXbLqwqjL6lbQbPb2J WfEw5rC6uM4TPyErFioqzhT+0mn/zo+G2u9JPvcjqc35yvU1XKxWn66j6CDhe+MfZI0OTOBUnYwO5 tQHu4duMgFzhxWK5RHiPSidGkbIfzYICnSAC6ahsaUbm2hSMEr3230K63Wo7jZn4heFekBCQbc5nO KDWvF2XMxKbNtSPR874w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYRwS-0002VC-3u; Mon, 08 Jan 2018 07:33:56 +0000 Received: from mail-sh2.amlogic.com ([58.32.228.45]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYRvz-0002CO-IH; Mon, 08 Jan 2018 07:33:29 +0000 Received: from localhost.localdomain (10.18.20.170) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server id 15.0.1320.4; Mon, 8 Jan 2018 15:32:28 +0800 From: Yixun Lan To: Linus Walleij Subject: [PATCH 1/2] pinctrl: meson: introduce a macro to have name/groups seperated Date: Mon, 8 Jan 2018 15:33:27 +0800 Message-ID: <20180108073328.205769-2-yixun.lan@amlogic.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108073328.205769-1-yixun.lan@amlogic.com> References: <20180108073328.205769-1-yixun.lan@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.18.20.170] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180107_233327_662455_4DE7AB60 X-CRM114-Status: UNSURE ( 7.07 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Martin Blumenstingl , Kevin Hilman , Yixun Lan , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Carlo Caione , linux-amlogic@lists.infradead.org, Xingyu Chen , Jerome Brunet Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We introduce a macro FUNCTION_EX here, the main motivation is trying to have the possibility to expand the macro with the same of the '.name' number but different multiple '.groups/.num_groups' numbers. With this change, the meson pinctrl drivr is capable of have one uniform 'function' name but with different pin 'groups', as we face the sitiuation that two pin groups may live inside different hardware domain (EE vs AO domain), which mean we couldn't put them in one single group. Signed-off-by: Yixun Lan --- drivers/pinctrl/meson/pinctrl-meson.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h index 12a391109329..d8f705098810 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.h +++ b/drivers/pinctrl/meson/pinctrl-meson.h @@ -124,13 +124,15 @@ struct meson_pinctrl { struct device_node *of_node; }; -#define FUNCTION(fn) \ +#define FUNCTION_EX(fn, ex) \ { \ .name = #fn, \ - .groups = fn ## _groups, \ - .num_groups = ARRAY_SIZE(fn ## _groups), \ + .groups = fn ## ex ## _groups, \ + .num_groups = ARRAY_SIZE(fn ## ex ## _groups), \ } +#define FUNCTION(fn) FUNCTION_EX(fn, ) + #define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \ { \ .name = n, \