Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1608185imu; Tue, 6 Nov 2018 01:08:54 -0800 (PST) X-Google-Smtp-Source: AJdET5fihm5sSAPrf4RGMQO83LIGRNeEm7FaLkm7Ret1wshYbRsEA2TTSUmebh59Y3nRaSmKRIgc X-Received: by 2002:a62:30c7:: with SMTP id w190-v6mr24896151pfw.188.1541495334063; Tue, 06 Nov 2018 01:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541495334; cv=none; d=google.com; s=arc-20160816; b=dF6M8021WvKjxheqGzKYTBBFWeKfi+Qm3wNyMaJE1iXSvLmohOiuxoS4RUQbpPI5gx gJ+OM6HPyRtx/6/CVCTiORn1drUdoa9AmrFV1/Vm7rpXEeidgtpjcl3/+E2cJpIEHXF6 lMUD9x9q1zbuIWaKceTPzUFVFDDHP5LvIBjHS5BiJQZbOP527rzu4ixmgEM+UEwyLa/o k0HD2DgEH+zwcd3QGgPOXQrtBgVS4qLX3f6HUrwWNH+D/XT6yS6L2EZs/n82naGVhaX8 GAInAPJt5xOvPOUmQEwBtBOqjAtY09nBdDtu7ayFl1bZUFKwlfCMLo045mgeAqARrYd9 +RzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DZUb4UATor0v/iZ52/6I8j+C288JpELhwiWN4CRjNG4=; b=u+6wCaW7P8dwgc7oSZzE4v1ymlUvR8n5duLzxo0gRSKTrTMY9NA9QMsflJc9amyxev R2jzaKHcni9n7d53W8JUf6S6Gda8bU9oD+S6vR1cp2sokSElrYJw4TvE+/F8yVAVGa/5 OrM9wnnIQEZlmEB5CqOsxRc7x0LvuFmz+3WPq+oNMg7jYCzcPt4yRLB80j9NsWKpgHXq cLZqOfrR8SPi0+DQGWSpPwezguQVB1F0zi/K2tbzUSR2cMGYeix3RdANzizqPW3aYcS/ uZIcJYghrwd//TFocqVRZxEG2AhUTWF6dYJZX8aCMSyhdbI12lfxRrUb2Ws5cuoN1V8R WaYg== 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 a8-v6si45788785plz.94.2018.11.06.01.08.39; Tue, 06 Nov 2018 01:08:54 -0800 (PST) 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 S1730258AbeKFScP (ORCPT + 99 others); Tue, 6 Nov 2018 13:32:15 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:43461 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729160AbeKFScP (ORCPT ); Tue, 6 Nov 2018 13:32:15 -0500 X-Originating-IP: 2.224.242.101 Received: from w540 (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id C739B1C001D; Tue, 6 Nov 2018 09:07:57 +0000 (UTC) Date: Tue, 6 Nov 2018 10:07:56 +0100 From: jacopo mondi To: Geert Uytterhoeven Cc: Jacopo Mondi , Geert Uytterhoeven , Laurent Pinchart , Simon Horman , Linus Walleij , Linux-Renesas , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH 0/2] pinctrl: sh-pfc: r8a77965: Add VIN4 and VIN5 Message-ID: <20181106090756.GP20885@w540> References: <1540836824-4636-1-git-send-email-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4ECF1u7dKBoUGhe3" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --4ECF1u7dKBoUGhe3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi Geert, On Mon, Nov 05, 2018 at 06:19:22PM +0100, Geert Uytterhoeven wrote: > Hi Jacopo, > > On Mon, Oct 29, 2018 at 7:14 PM Jacopo Mondi wrote: > > this two patches add supports for VIN4 and VIN5 interfaces to R-Car M3-N. > > > > On this SoC (and in the forthcoming support for E3 R8A77990) the VIN groups > > could appear on different sets of pins, usually the 'a' and 'b' one. > > > > With the existing VIN_DATA_PIN_GROUP macro we have to specify group names as: > > > > VIN_DATA_PIN_GROUP(vin4_data_a, 8) > > > > which results in the group being named as "vin4_data_a_8" which is > > un-consistent with the canonical group names (eg. "vin4_data8_a"). > > > > This series adds a macro that allows to specify the group 'version' along with > > the pin and mux numbers in patch [1/1]. I haven't been able to find a better > > term than 'version' as 'group' was already taken. Suggestions welcome. > > Yeah, the datasheet also calls these groups :-( > A possible alternative is to use "variant"? > > Or, what about avoiding the name issue by making the VIN_DATA_PIN_GROUP() > macro varargs, and passing the "variant" as the (optional) third parameter? > That way existing users work as a before, while you can also write e.g. > > VIN_DATA_PIN_GROUP_VER(vin4_data, 8, _a), Indeed. Would something along the following lines fly for you? #define VIN_DATA_PIN_GROUP(n, s, ...) \ { \ .name = #n#s#__VA_ARGS__, \ .pins = n##__VA_ARGS__##_pins.data##s, \ .mux = n##__VA_ARGS__##_mux.data##s, \ .nr_pins = ARRAY_SIZE(n##__VA_ARGS__##_pins.data##s), \ } It can be used as: VIN_DATA_PIN_GROUP(vin4_data, 8, _a), VIN_DATA_PIN_GROUP(vin5_data, 8), With your ack on this, I'll send v2. Thanks j > > > As I cannot test VIN4 nor VIN5 on Salvator-XS as the parallel pins are not > > wired, I made sure the macro creates correct names and fields not only by > > compile testing it, but with a small C program [1] that replicates the VIN data > > layout defined in the PFC module and access fields (and has helped me testing > > more easily the preprocessor stringification/concatenation process). > > > > Final note: Simon, you took the E3 patches in your tree, and I expect them to > > land on v4.20-rc1. They use the old macros, are follow up patches ok?) > > Which patches are using these macro names, and are in v4.20-rc1? > > BTW, "grep vin._data_[a-z][0-9] drivers/pinctrl/sh-pfc/*o" tells me we already > have broken groups names on r8a7792, r8a7795, and r8a7796. > Fortunately we have no known users of them, so they can be fixed. > On v4.20-rc1 the grep returns none for me :/ git grep v4.20-rc1 "vin._data_[a-z][0-9]" drivers/pinctrl/sh-pfc/ Thanks j > Thanks! > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds --4ECF1u7dKBoUGhe3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJb4VnsAAoJEHI0Bo8WoVY8k48P/1kM1SvF1uJqnu7GdAkYEbNP 42luyW2+tG45b0QGnsSUaHdrSdVAEXC5wiAmIPzSIPiK5z30a5TELGHXigjHtDH/ zgusVGXevyzPBiwiKZKSHsq7KZdoRwm5K+agQrAdxButprpzFOQGT2bh280waaEj 8eAlGo+iJZG3758w4vZxmc0UiiqNvXAmYRH1pPf6Na1u/G+fpX2u6J2vt5vR6UhH 51K67yojluSoX9em+YU3dooHt68A7aRoyczHkWbOaSIeyVnwt+s8RCsSO9GhiQDY Y/yY+D4PF20VpdTXhW66JqhaURR3rhCrv+csk7B1uHKexnT0KAPkXRm93nHN9lY4 4vyMWJzj/bbPys/iG/WfoNk3R7quJb1sW6KhQtYBUC8rp+IM1EqUcFt/qd7n26me vckl6aweQNLSxifs9qlfXd4ttFtvwlfzt7WbvxGLJ0FZC+Njjpn4TsPMrakIMofu C3JCeeG82BvSq3W+2xC/pgjyMMS6gkdie86WS8kcrPHrJ+eqEhoEOodfN+at/Bvk 3ilVBQ5tZ9ILgpcOUXvVNzXYgRG4li8i37rVdpfJeuSs+4IfUEb+GNyIp9uigBen xyVNSkjUpod76Ez1tOGjDXPotlumJaZ2wq6pKAA+g1KJ545FGRT766mkmDFaHYCn tQmhaLlAXWO4S17zwNp/ =qSyo -----END PGP SIGNATURE----- --4ECF1u7dKBoUGhe3--