Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3719632imd; Mon, 29 Oct 2018 11:14:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5eSM5t4EY06DybiAQcHlBkB2p9uxQgAC7iOT8l9uIEnNz+3p9r1JyQUL/peDT1cWqPFz2ka X-Received: by 2002:a17:902:8687:: with SMTP id g7-v6mr15732818plo.30.1540836887254; Mon, 29 Oct 2018 11:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540836887; cv=none; d=google.com; s=arc-20160816; b=pCftkGkKNKeiWO0XGT0WgoXq/hhORRU+ACv4RTG6PRW+QM7hHMNU5rZC0eP6A2OwNs nqwSGOGb44MTTjtIs59tsvvMwIomt7EKfMa26iE7ia9cO9fDzDFcjFVTpIxxE/2i0RqU fy4V4+uzo4INqYZvPvUENKOQcfRsV07wsKFOw1/FKm4FxjR+pBTz7Oin67WSxWrZxqOu rqrGlsJdRzVFfqqMGBqkxNrs+bp3eNL1EUidHL34M0hQchV/fwDP5sPamCX29q5cdEdH if2HGVH+l/Z6zLMoj6T1xh/3aZsDzNRRrenj/yIcOI/vNVAhE5ddGu2UKS51hXNZk35C B2zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=zEx/UltJTD/+WZtzh78hcD15ElnVwV7OZIRXPViyh6I=; b=e89XgH1LA3z0WRUY5IY76jjiR4UuV14b4F5+xWxHN6EZWQZbHrJt8+KGbYpX80pUiw LtwFKsky6uWNrzecA3/d7xbkUccx66dd0zjHIebdIAaUxKEaJ4M0F7nEfV8QkF7+2fYG nsYKFtDBsxZEuRGd8K/J+1cDsgJhkXeNQdIP4Of/2o69pG55y3RAsrlGnc6UiY0kLZFT NKiMQTBfc4eF5RbPfyzVZl8JRu2uGAjxXhAekhwQSS2JwRXKiMMeVAKa9C+ca/SG6CN6 NnRiTPBPBdd61aARGWV6+vX/KdSADhYjhahxoTi2z0hULOG9uN0d8mWeAr0slbIwu9Rm eUXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10-v6si9356796pfi.222.2018.10.29.11.14.32; Mon, 29 Oct 2018 11:14:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728574AbeJ3DDr (ORCPT + 99 others); Mon, 29 Oct 2018 23:03:47 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56105 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728555AbeJ3DDp (ORCPT ); Mon, 29 Oct 2018 23:03:45 -0400 X-Originating-IP: 2.224.242.101 Received: from w540.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id E671E40006; Mon, 29 Oct 2018 18:13:57 +0000 (UTC) From: Jacopo Mondi To: geert+renesas@glider.be, laurent.pinchart@ideasonboard.com, horms@verge.net.au Cc: Jacopo Mondi , linus.walleij@linaro.org, linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] pinctrl: sh-pfc: Introduce VIN_DATA_PIN_GROUP_VER Date: Mon, 29 Oct 2018 19:13:43 +0100 Message-Id: <1540836824-4636-2-git-send-email-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540836824-4636-1-git-send-email-jacopo+renesas@jmondi.org> References: <1540836824-4636-1-git-send-email-jacopo+renesas@jmondi.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VIN data groups may appear on different sets of pins, usually named "vinX_data_[a|b]". The existing VIN_DATA_PIN_GROUP() does not support appending the 'a' or 'b' suffix, leading to the definition of groups names not consistent with the ones defined using SH_PFC_PIN_GROUP() macro. Fix this by adding a macro that supports appending suffixes when required. Signed-off-by: Jacopo Mondi --- drivers/pinctrl/sh-pfc/sh_pfc.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h index 458ae0a..2930e9a 100644 --- a/drivers/pinctrl/sh-pfc/sh_pfc.h +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h @@ -54,17 +54,27 @@ struct sh_pfc_pin_group { /* * Using union vin_data saves memory occupied by the VIN data pins. - * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups - * in this case. + * + * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups, + * while VIN_DATA_PIN_GROUP_VER() is used when the same pin group can appear + * on different sets of pins. */ -#define VIN_DATA_PIN_GROUP(n, s) \ - { \ - .name = #n#s, \ +#define __VIN_DATA_PIN_GROUP(n, s) \ .pins = n##_pins.data##s, \ .mux = n##_mux.data##s, \ .nr_pins = ARRAY_SIZE(n##_pins.data##s), \ } +#define VIN_DATA_PIN_GROUP(n, s) \ + { \ + .name = #n#s, \ + __VIN_DATA_PIN_GROUP(n, s) + +#define VIN_DATA_PIN_GROUP_VER(n, v, s) \ + { \ + .name = #n#s"_"#v, \ + __VIN_DATA_PIN_GROUP(n##_##v, s) + union vin_data { unsigned int data24[24]; unsigned int data20[20]; -- 2.7.4