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: 10149131 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 1C562602B3 for ; Mon, 8 Jan 2018 07:34:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F3652870C for ; Mon, 8 Jan 2018 07:34:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03CC0288CA; Mon, 8 Jan 2018 07:34:42 +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 7B3792870C for ; Mon, 8 Jan 2018 07:34:41 +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=CgGokaUoyqX2w0FtkzxEKpl1XHI+qGQcOuyQk8uvft4=; b=EhHG4zX3mdvnPC Eo8ABRKexLf+dntCeFFeteTnlEQtwCxG1uXtTjHvNOUhQesIzPDiJjBpvu+Mn/h613WvesNP/0UHH P1RODCgxvWXtw4nysilZm6y8Ly5QylL30rgpB0oYa+Rodj3DgThwvblxfB6lAemB85fPG/ctO9wlU pEncEZt7dgOS5T4bLsG//iaBHzyGkNGWDL6hc1Bw6Hx/jOeDMNW4EP1Tn5qdw+DRXSvwqD47e8eZv 8yRytHTiKUYUvHg+CFY/Pc9/R8f0cwyzLMUZedQbTH+f8xhmRkI612oTD1ppKcsHPLs9OvrHVTR/c IZL6RLs7iz1bJuzqFwuA==; 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 1eYRwx-0002pM-Ox; Mon, 08 Jan 2018 07:34:27 +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-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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, \