From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934391AbcHaM76 (ORCPT ); Wed, 31 Aug 2016 08:59:58 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:61905 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934148AbcHaM7y (ORCPT ); Wed, 31 Aug 2016 08:59:54 -0400 From: Arnd Bergmann To: Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, Rob Herring , Mark Rutland , Kukjin Kim , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Martinez Canillas , Tomasz Figa , Sylwester Nawrocki , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH 1/9] ARM: dts: exynos: Add macros for GPIO configuration Date: Wed, 31 Aug 2016 14:58:41 +0200 Message-ID: <6113443.1q3Xq4YM82@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <07ddb8f8-a9e1-6105-ace9-edb5c8cc2f57@samsung.com> References: <1472645613-5362-1-git-send-email-k.kozlowski@samsung.com> <28320955.k33BrW2NEN@wuerfel> <07ddb8f8-a9e1-6105-ace9-edb5c8cc2f57@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:dF8m3cMo2qnSTXhhj0o42b+BKNmLEbv69BlOO0jYDRW5mVw30Zu U/FmRrE1YGUNXAjcIGX4FFHv8LJss5+83elk9VgHI8p8YQ85RvY96FgCh0ZK2BdrXvRrRiz s4B+f5z1AEEFbjTOtu5lmj6sDSnRxlFjrOhNxlRUrkavNAX9C01RJKl3NEDbr79IttA6n1H Qgrmf+qMYslLV7pVIa4OQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Cw3nbMTR+OY=:vqMJq6We/X001iT/3ct9tA parGAdC28roTgu6TvO4xplYEAhm2JqZl7/UmRk60Oz7D3S0/Wi9VOOKjX1l6o9fyMGZmKQw+V Jslt0Wz1ovgBpP7GjbSZ7x7F6dEyusD61cxAENAiWgeE/ijbYzCAWPmnFHX5RIM3mCRov0KWQ IijZ0Ra4MGSGC3LITEqc7V7PoCN0g4GQolZzXJnmqsxPc2Bs+xK56pklh6o9adECdhUZELWDn km0v9B4QlvfhojFRK1sHOXC7/RMiNfavprM9AKS6paFw8QSI8+tR90QpcNXjioetx5oChBDbl vbAwHGPnPxk5vD0An+siynHxZniYBy6SogwMumc9t5oDc8Z61wpqWJsL0q+amh1GA1db+7lJL tJHEm7xg5BeG8Mi4Kvel3TeXA7RjtrWXRFdEYb1VcXGWjlJy7oU4neHxF0iiMzbLI96gCbM1L ctiW/PERrtMsuHDAOlqRbD6JvM8jTzw7O1lcVCPJA9PJLC+WLfPMoE8GkYlL60TNiNnY3fdoJ DQn3vDW9cKMUz9hg2cUwoZvlilbleeYRUZbf4EDotA0R74Hl3jJxPv3x2+gJboOWEpTpLRr0I LfgVRgDZWHLRn4H0TEoIoIEP+MdmYxivrjurorTJKXe/WXn1UoevQ0sw29ZWb1nI3ESMaLlXB 0Ip7Qp0JxSr/A8Grk5omI/8mdDCdDh4ZGRioKVajslUle+FDaj7LGo9rqGiKDepG5BSroVMLK Ydo+jILqW+JuI8PE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, August 31, 2016 2:53:02 PM CEST Krzysztof Kozlowski wrote: > On 08/31/2016 02:42 PM, Arnd Bergmann wrote: > > On Wednesday, August 31, 2016 2:13:25 PM CEST Krzysztof Kozlowski wrote: > >> > >> +#define PIN_PULL_NONE 0 > >> +#define PIN_PULL_DOWN 1 > >> +#define PIN_PULL_UP 3 > >> + > >> +#define PIN_DRV_LV1 0 > >> +#define PIN_DRV_LV2 2 > >> +#define PIN_DRV_LV3 1 > >> +#define PIN_DRV_LV4 3 > >> + > >> +#define PIN_FUNC_INPUT 0 > >> +#define PIN_FUNC_OUTPUT 1 > >> +#define PIN_FUNC_SPC_2 2 > >> +#define PIN_FUNC_SPC_3 3 > >> +#define PIN_FUNC_SPC_4 4 > >> +#define PIN_FUNC_SPC_5 5 > >> +#define PIN_FUNC_SPC_F 0xf > > > > Any reason for having a copy in each of those files instead of one > > that is shared across all of them? > > The drive strengths differ between some of them. There are three groups > of drive strengths: > 1. Exynos3250, Exynos4 (all) and Exynos5250, > 2. Exynos5260, > 3. Exynos5410, 542x and 5800. I see. That sounds like an even stronger reason to not duplicate the definitions, as this is very confusing. > Rest (functions and pull up/down) is the same so sharing the defines is > possible but not that obvious. Solution would be for example adding a > SoC-family prefix for PIN_DRV_LVx. Not that good... > > I could put it into three DTSI: > - exynos3-pinctrl.dtsi (new file) > - exynos5260-pinctrl.dtsi (like it is now) > - exynos54xx-pinctrl.dtsi (new file) > > which would reduce the duplication. Other ideas? I think having the soc-family prefix is better, as it avoids defining the same symbol to a different value. Better make this as explicit as possible. I think overall, a better solution would have been to define the constants globally (shared with non-exynos) to start with, and have the driver translate generic numbers into vendor specific ones. Obviously it's too late for that now. Arnd