From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Date: Wed, 29 Mar 2017 15:10:17 +0200 Message-ID: References: <1490026491-21742-1-git-send-email-jacopo+renesas@jmondi.org> <1490026491-21742-3-git-send-email-jacopo+renesas@jmondi.org> <20170323160204.GL30223@w540> <20170329120530.GB6247@w540> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Chris Brandt Cc: jacopo , Geert Uytterhoeven , Jacopo Mondi , Geert Uytterhoeven , Laurent Pinchart , Rob Herring , Mark Rutland , Russell King , Linux-Renesas , "linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-gpio@vger.kernel.org On Wed, Mar 29, 2017 at 2:38 PM, Chris Brandt wrote: >> I'm strongly in favour of something like >> pinmux = , .... ; >> >> opposed to >> pinmux = , ... ; > > > I agree. I like "". I don't know if you have seen the Mediatek things really. include/dt-bindings/pinctrl/mt6397-pinfunc.h Example: #define MT6397_PIN_2_SRCLKEN_PERI__FUNC_GPIO2 (MTK_PIN_NO(2) | 0) If you prefer to use preprocessor macros or whatever to make the bitmasks or how you want to organize the constants in your include files is not my concern, do whatever you seem fit, just pack it into a 32bit thing somehow which makes sense from a maintenance point of view. >> Not only because it will save use from having a loong list(*) of macros >> that has to be kept up to date when/if new RZ hardware will arrive, but >> also because of readability and simplicity for down-stream and BSP users. >> Speaking of which, I would like to know what does Chris think of this. > > The list of macros would be very long, especially against the different > packaging version of the RZ/A1 series. 11 ports, 16-pins for each port, 8 different > function options for each pin....2 different package/pin variations. > > And at the end of the day....there is no benefit for the user over just using > a macro. I don't know who has this idea that you could not use macros, certainly not me. Some misunderstanding must be going on. For what I'm concerned you can write hex numbers in the pinmux = <0x12345678>; > The reason for the "FLAGS" is to work around a quirky hardware design (in my opinion). The flags I don't like at all, and think they should be converted to generic pin config because they have nothing to do with muxing. But I will point that out in the specific patch adding them. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932732AbdC2NKX (ORCPT ); Wed, 29 Mar 2017 09:10:23 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:36997 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932653AbdC2NKU (ORCPT ); Wed, 29 Mar 2017 09:10:20 -0400 MIME-Version: 1.0 In-Reply-To: References: <1490026491-21742-1-git-send-email-jacopo+renesas@jmondi.org> <1490026491-21742-3-git-send-email-jacopo+renesas@jmondi.org> <20170323160204.GL30223@w540> <20170329120530.GB6247@w540> From: Linus Walleij Date: Wed, 29 Mar 2017 15:10:17 +0200 Message-ID: Subject: Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc To: Chris Brandt Cc: jacopo , Geert Uytterhoeven , Jacopo Mondi , Geert Uytterhoeven , Laurent Pinchart , Rob Herring , Mark Rutland , Russell King , Linux-Renesas , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 29, 2017 at 2:38 PM, Chris Brandt wrote: >> I'm strongly in favour of something like >> pinmux = , .... ; >> >> opposed to >> pinmux = , ... ; > > > I agree. I like "". I don't know if you have seen the Mediatek things really. include/dt-bindings/pinctrl/mt6397-pinfunc.h Example: #define MT6397_PIN_2_SRCLKEN_PERI__FUNC_GPIO2 (MTK_PIN_NO(2) | 0) If you prefer to use preprocessor macros or whatever to make the bitmasks or how you want to organize the constants in your include files is not my concern, do whatever you seem fit, just pack it into a 32bit thing somehow which makes sense from a maintenance point of view. >> Not only because it will save use from having a loong list(*) of macros >> that has to be kept up to date when/if new RZ hardware will arrive, but >> also because of readability and simplicity for down-stream and BSP users. >> Speaking of which, I would like to know what does Chris think of this. > > The list of macros would be very long, especially against the different > packaging version of the RZ/A1 series. 11 ports, 16-pins for each port, 8 different > function options for each pin....2 different package/pin variations. > > And at the end of the day....there is no benefit for the user over just using > a macro. I don't know who has this idea that you could not use macros, certainly not me. Some misunderstanding must be going on. For what I'm concerned you can write hex numbers in the pinmux = <0x12345678>; > The reason for the "FLAGS" is to work around a quirky hardware design (in my opinion). The flags I don't like at all, and think they should be converted to generic pin config because they have nothing to do with muxing. But I will point that out in the specific patch adding them. Yours, Linus Walleij