From patchwork Tue Nov 10 08:56:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7589011 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 657E0C05C6 for ; Tue, 10 Nov 2015 08:56:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 143232070B for ; Tue, 10 Nov 2015 08:56:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65D8B20605 for ; Tue, 10 Nov 2015 08:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751138AbbKJI4y (ORCPT ); Tue, 10 Nov 2015 03:56:54 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:25212 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751133AbbKJI4w (ORCPT ); Tue, 10 Nov 2015 03:56:52 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 10 Nov 2015 17:56:50 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 80599545AB; Tue, 10 Nov 2015 17:56:50 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 62163480A4; Tue, 10 Nov 2015 17:56:50 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 5A1FC480A3; Tue, 10 Nov 2015 17:56:50 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAN20950; Tue, 10 Nov 2015 17:56:50 +0900 X-IronPort-AV: E=Sophos;i="5.20,269,1444662000"; d="scan'";a="199449118" Received: from mail-pu1apc01lp0022.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.22]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 10 Nov 2015 17:56:49 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by SIXPR06MB1022.apcprd06.prod.outlook.com (10.160.239.156) with Microsoft SMTP Server (TLS) id 15.1.318.15; Tue, 10 Nov 2015 08:56:45 +0000 Message-ID: <87io5ajkz9.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH][RFC] pinctrl: sh-pfc: share/reuse same PORT_GP_x() macros User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Laurent Pinchart , Linus Walleij CC: , , Geert Uytterhoeven MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 10 Nov 2015 08:56:45 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HK2PR02CA0027.apcprd02.prod.outlook.com (25.163.104.165) To SIXPR06MB1022.apcprd06.prod.outlook.com (25.160.239.156) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1022; 2:URZ1i10RCfPsSP5xRPP+t68eCeKNYOF/GnYSsHNnpu7fQeEap8jIwQfIzZz2Asl6cn2W07ZtpADVycnXjnDPSxZDfPD9w5AOlnCSHfIvwNlSArAcywOorynq6dv+g6LuzA2Nfwxau72xFjV7Lc6eq6pvbVr+zFAV8RZlG6/3wWs=; 3:2DUwlf+VSpCngFT2PWSRpXZrrlQzpvQcYGEdPF4WANYoJ2Fk2jSKylvflbUmhWzanWD+ryVUuJQiNAcqZj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qp34nLJsbeli6T9iQlgxZ9OZ+pXxcCkV98VVjodxnXXBtaOR1aZtkykw2b5NGIwxDES+iS98lc21WWjmIllxUIbK0+XgACla4wGCu+6DNqvbS0NJQudfovMp4Jutx5N9iF2MJO1g3gsVNtBecexG/z6yKIgXKOwUWTHnf/IbS4KfPuJIw9kUwQsZTmJzDKuUme6Z25SuOKdHFqjIKYfCrZwwRdS3y2C/4ARJ5UHRvvaTI/BsivZOfeQRlXYm1zPvJvU1gQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:SIXPR06MB1022; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB1022; X-Forefront-PRVS: 07562C22DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(50466002)(87976001)(101416001)(189998001)(40100003)(122386002)(83506001)(66066001)(47776003)(50986999)(105586002)(92566002)(229853001)(106356001)(54356999)(23726002)(53416004)(42186005)(46406003)(77096005)(575784001)(86362001)(97736004)(5004730100002)(36756003)(33646002)(5001770100001)(5001960100002)(5008740100001)(5007970100001)(69596002)(19580395003)(19580405001)(81156007)(4001350100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB1022; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB1022; 23:wj33iXLJ3dbRETCHKCt5Jqk3atdmeWssF6qpP9S9W?= =?us-ascii?Q?/MF2SeM5EakLy/N/TdIm4lCC7Y0L4IRs2xHilzOR8qWWfSVW2kacxVxYJt3q?= =?us-ascii?Q?nq4GVc72YBThwlsUQKkONVJ8rLotmgNG2ObXp5thiAYxF1jH1tCiT9wq6wY6?= =?us-ascii?Q?pnEcofzRBVY/uKrIpscqp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=?us-ascii?Q?cE3D4M=3D?= X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1022; 5:vIHq9xYrgpZCH+NbWtpGjmy9FLVulxGLOFNO4IAumkBiKFcPDOzdKUbsfvSRWhykcHp+MC4a83eVSUK1EKtZBZ0wFJezvGlNlAF97o8yn+ITvQyegw7piecYFSPJ1jXznLu9yQh1lr4+CAGJS4zq0w==; 24:F0UlUxSCTWLUzpIWQr/2RiQ6REQSzxFfS4rnafGKwyuJFpURHzhD+Y+zAnuMiiu7N7ucZRvcAe9uAXenIc7Z98j4aosIXQ2t83O7Yhor6QU=; 20:o6oeILeBgN6EVQcqasiEm6rX8nH4y7GjpgesAXWoXmZdj9ich5CPpbWyIlYb6x35yqE1WLkLsFrH2bnOzRRgv83or/faxRNfBdhO1vBv9FhWtS/WQ0TxB9+DbjequBlQnnfF7fvXzqduWvKBrn1UJekuuzZnprsenfG5dUpikPs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2015 08:56:45.9900 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1022 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Many SoC needs each PORT_GP_x() macros, but we can share/reuse same macro. Signed-off-by: Kuninori Morimoto --- This patch is based on Geert's Date: Thu, 29 Oct 2015 20:39:47 +0100 Subject: [PATCH] pinctrl: sh-pfc: r8a7795: Make PORT_GP_x() macros consistent drivers/pinctrl/sh-pfc/pfc-r8a7779.c | 7 ----- drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 17 ------------ drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 15 ---------- drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 19 ------------- drivers/pinctrl/sh-pfc/pfc-r8a7795.c | 31 --------------------- drivers/pinctrl/sh-pfc/pfc-sh7734.c | 8 ------ drivers/pinctrl/sh-pfc/sh_pfc.h | 54 +++++++++++++++++++++++++++++++++++- 7 files changed, 53 insertions(+), 98 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c index ed4e078..7293e37 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c @@ -23,13 +23,6 @@ #include "sh_pfc.h" -#define PORT_GP_9(bank, fn, sfx) \ - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ - PORT_GP_1(bank, 8, fn, sfx) - #define CPU_ALL_PORT(fn, sfx) \ PORT_GP_32(0, fn, sfx), \ PORT_GP_32(1, fn, sfx), \ diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c index d9924b0..bc8e400 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c @@ -26,23 +26,6 @@ #include "core.h" #include "sh_pfc.h" -#define PORT_GP_30(bank, fn, sfx) \ - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ - PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx), \ - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx), \ - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx), \ - PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx), \ - PORT_GP_1(bank, 28, fn, sfx), PORT_GP_1(bank, 29, fn, sfx) - #define CPU_ALL_PORT(fn, sfx) \ PORT_GP_32(0, fn, sfx), \ PORT_GP_30(1, fn, sfx), \ diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c index 87a4f44..119e1aa 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c @@ -13,21 +13,6 @@ #include "core.h" #include "sh_pfc.h" -#define PORT_GP_26(bank, fn, sfx) \ - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ - PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx), \ - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx), \ - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) - #define CPU_ALL_PORT(fn, sfx) \ PORT_GP_32(0, fn, sfx), \ PORT_GP_26(1, fn, sfx), \ diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7794.c b/drivers/pinctrl/sh-pfc/pfc-r8a7794.c index 086f679..533cb8a 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7794.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7794.c @@ -15,25 +15,6 @@ #include "core.h" #include "sh_pfc.h" -#define PORT_GP_26(bank, fn, sfx) \ - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ - PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx), \ - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx), \ - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) - -#define PORT_GP_28(bank, fn, sfx) \ - PORT_GP_26(bank, fn, sfx), \ - PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx) - #define CPU_ALL_PORT(fn, sfx) \ PORT_GP_32(0, fn, sfx), \ PORT_GP_26(1, fn, sfx), \ diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c index 29d001b..d977e21 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c @@ -13,37 +13,6 @@ #include "core.h" #include "sh_pfc.h" -#define PORT_GP_4(bank, fn, sfx) \ - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx) - -#define PORT_GP_15(bank, fn, sfx) \ - PORT_GP_4(bank, fn, sfx), \ - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ - PORT_GP_1(bank, 14, fn, sfx) - -#define PORT_GP_16(bank, fn, sfx) \ - PORT_GP_15(bank, fn, sfx), PORT_GP_1(bank, 15, fn, sfx) - -#define PORT_GP_18(bank, fn, sfx) \ - PORT_GP_16(bank, fn, sfx), \ - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx) - -#define PORT_GP_26(bank, fn, sfx) \ - PORT_GP_18(bank, fn, sfx), \ - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) - -#define PORT_GP_28(bank, fn, sfx) \ - PORT_GP_26(bank, fn, sfx), \ - PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx) - #define CPU_ALL_PORT(fn, sfx) \ PORT_GP_16(0, fn, sfx), \ PORT_GP_28(1, fn, sfx), \ diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7734.c b/drivers/pinctrl/sh-pfc/pfc-sh7734.c index e7deb51..9d66865 100644 --- a/drivers/pinctrl/sh-pfc/pfc-sh7734.c +++ b/drivers/pinctrl/sh-pfc/pfc-sh7734.c @@ -14,14 +14,6 @@ #include "sh_pfc.h" -#define PORT_GP_12(bank, fn, sfx) \ - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx) - #define CPU_ALL_PORT(fn, sfx) \ PORT_GP_32(0, fn, sfx), \ PORT_GP_32(1, fn, sfx), \ diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h index 7b373d4..47d0d83a4 100644 --- a/drivers/pinctrl/sh-pfc/sh_pfc.h +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h @@ -205,6 +205,59 @@ struct sh_pfc_soc_info { #define PORT_GP_CFG_1(bank, pin, fn, sfx, cfg) fn(bank, pin, GP_##bank##_##pin, sfx, cfg) #define PORT_GP_1(bank, pin, fn, sfx) PORT_GP_CFG_1(bank, pin, fn, sfx, 0) +#define PORT_GP_4(bank, fn, sfx) \ + PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ + PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx) + +#define PORT_GP_8(bank, fn, sfx) \ + PORT_GP_4(bank, fn, sfx), \ + PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ + PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx) + +#define PORT_GP_9(bank, fn, sfx) \ + PORT_GP_8(bank, fn, sfx), \ + PORT_GP_1(bank, 8, fn, sfx) + +#define PORT_GP_12(bank, fn, sfx) \ + PORT_GP_8(bank, fn, sfx), \ + PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ + PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx) + +#define PORT_GP_14(bank, fn, sfx) \ + PORT_GP_12(bank, fn, sfx), \ + PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx) + +#define PORT_GP_15(bank, fn, sfx) \ + PORT_GP_14(bank, fn, sfx), \ + PORT_GP_1(bank, 14, fn, sfx) + +#define PORT_GP_16(bank, fn, sfx) \ + PORT_GP_14(bank, fn, sfx), \ + PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx) + +#define PORT_GP_18(bank, fn, sfx) \ + PORT_GP_16(bank, fn, sfx), \ + PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx) + +#define PORT_GP_26(bank, fn, sfx) \ + PORT_GP_18(bank, fn, sfx), \ + PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ + PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ + PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ + PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) + +#define PORT_GP_28(bank, fn, sfx) \ + PORT_GP_26(bank, fn, sfx), \ + PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx) + +#define PORT_GP_30(bank, fn, sfx) \ + PORT_GP_28(bank, fn, sfx), \ + PORT_GP_1(bank, 28, fn, sfx), PORT_GP_1(bank, 29, fn, sfx) + +#define PORT_GP_32(bank, fn, sfx) \ + PORT_GP_30(bank, fn, sfx), \ + PORT_GP_1(bank, 30, fn, sfx), PORT_GP_1(bank, 31, fn, sfx) + #define PORT_GP_CFG_32(bank, fn, sfx, cfg) \ PORT_GP_CFG_1(bank, 0, fn, sfx, cfg), PORT_GP_CFG_1(bank, 1, fn, sfx, cfg), \ PORT_GP_CFG_1(bank, 2, fn, sfx, cfg), PORT_GP_CFG_1(bank, 3, fn, sfx, cfg), \ @@ -222,7 +275,6 @@ struct sh_pfc_soc_info { PORT_GP_CFG_1(bank, 26, fn, sfx, cfg), PORT_GP_CFG_1(bank, 27, fn, sfx, cfg), \ PORT_GP_CFG_1(bank, 28, fn, sfx, cfg), PORT_GP_CFG_1(bank, 29, fn, sfx, cfg), \ PORT_GP_CFG_1(bank, 30, fn, sfx, cfg), PORT_GP_CFG_1(bank, 31, fn, sfx, cfg) -#define PORT_GP_32(bank, fn, sfx) PORT_GP_CFG_32(bank, fn, sfx, 0) #define PORT_GP_32_REV(bank, fn, sfx) \ PORT_GP_1(bank, 31, fn, sfx), PORT_GP_1(bank, 30, fn, sfx), \