Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1705169lqs; Sun, 16 Jun 2024 00:31:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIF521JHXI93qH7P/ZdtuouDaE76KYrPEtX+s3G+ERGuBUQiKJeTwRTRyEPIzrPtM1HQcG1xmxVeDr03Lg2Yy67IAoVaFObR68VNzqmA== X-Google-Smtp-Source: AGHT+IFyEqOg1IZzclTRKhdrpdkVarMPgh210uJZPtRUzQSpcgE98uf7b6AjMDicTQVSFLf8oMGU X-Received: by 2002:ad4:4dcb:0:b0:6b0:91d4:5821 with SMTP id 6a1803df08f44-6b2afcd96ecmr63585056d6.28.1718523077844; Sun, 16 Jun 2024 00:31:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718523077; cv=pass; d=google.com; s=arc-20160816; b=GK7QVxGRFEKdA1uGahjG4hsR7eqa2chxzP+EK0CPIusOC1pGJZazBic74s6V6t+AEh G2jHYraNoKjSezUhWq6s47sQGKBMwNlrF6sb6Ca1B/fJv7GgbWpe5ruOHSDlI/nFis9S c7U8RK6Ne5RmkydzUwL9C2lM+iCuHPTBe+M9AodmVqWEHxiZZEwi7gpRYZe023e5OmWy IxxxhlFUopX66bYY5LAZfijHjfmCy7MCEGP0abI8cIEVgpnnrXZLAJ/RRsWRGbq9ClnO erQyFSS22KfvliN6HfrO8oWYpWCqMmlhpS7tsor0lroON0SdJh20wo11u4nty1Cu6aAa hHqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=vMZjnnVE4F7um01W4HBE7p0Z7bcpzMTiUO/U5T/QeMg=; fh=4lpsJUrsmZRgmT1I/OWT0uiNjAU/OyYPKbsgMxBUiY8=; b=O+OI3QePWIIWpVdvVQcDXjCAys/BXkgHNtDrNfvogs/SG31huFqg3l80XONRbxtQf7 dgn/CpO65q9WvP7o894sHVfDhmJOahX92RkdPz7m0AhLWJ6dVpE9SBYyzcr4AzEJPh5K 35kzzhhwWNwdA2v+CiIB36wgcGsH7+mHA0N5vKcouLGXsoQoiTlJK803OpxZu3hQG3zG buv3J7S4UdYsmnV8YQonz+JQzcM4FpTd1ScjoJBBboj94wogo0vk6Qu2r3w4tV7Wur5k wkqXh7DL+J5X/6+W36Bhyh5NKaio7FEMriJtcbmAFqO9gvcyripvY9jUCMQBh6Rx985m RrMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=og7VOUDX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-216161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5a17203si75164986d6.109.2024.06.16.00.31.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 00:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=og7VOUDX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-216161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 81AD91C210DF for ; Sun, 16 Jun 2024 07:31:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF93B17920C; Sun, 16 Jun 2024 07:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="og7VOUDX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87DC651C50; Sun, 16 Jun 2024 07:31:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718523068; cv=none; b=GNeP2cvG7sA/N1/FGkMF7FP0u+a3yHPgHo+/kqQS0ZDfHF0kkRJcxEODnh3LmlCnwcZYAw+jDHS/5tEyxYqc2Tgu4JsSsjhLrCsqfRTjQEizlU0UYVSL9nYDrtKt/xtoROYoTF+JpdIyaEtqSqLL5NQuwx26AwcN2a6nWuUl/RQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718523068; c=relaxed/simple; bh=NzHHupP56Awo5wdnFHpA+aC/loSGgwA5FG6iFWikcYc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bRKCd6N0uZBE9EXY+sBgm/gwE9w6nrYuUIXVuUiUFTgJx9YjgG8LmXM4N+upZUXxjVx/Ji4aOnelXYtHoBe1u9pORMOW23bmZv6XhUsHEX6BDCFuUDWGTCrH/HWRc/T1gvSVYUixPwr+b55ftJKhgN62es6REhBnIS317K0Eaxg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=og7VOUDX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3BF6C2BBFC; Sun, 16 Jun 2024 07:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718523068; bh=NzHHupP56Awo5wdnFHpA+aC/loSGgwA5FG6iFWikcYc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=og7VOUDXOVMxFXrezJaFEvc/knHI3tTUhuDbxQuZJZlL1yOlSXoO3KuWd0Cn+u4ij gqBpeTuMJ8BU4dd7oArn1XvjrVANbJYkZp8W7dR96vDvPpjdUV6PJUsEw/3PBeGYgM z4hob/w64g3mlJlSWajkFOjBzkMlnPFPdBW+khntHPa1fx9DfCOI6yWFWZVmT19qSX Hqv0WVjXxdWJfGh7k3ps5YOTVFV/U5M8uq62CgusHBYZ550k5ZlhpH1QLYl+JUrwo5 EV499oWu4+/z9CffZrEi5ZfXWH2rlXyjIy6Moy5aN3Cr8TUp8snkv678klvGcQ7X2a Kh5Tiz7wQK2Hg== Message-ID: <777a36e8-c02b-4403-ae01-b2933f554da8@kernel.org> Date: Sun, 16 Jun 2024 09:31:02 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] dt-bindings: pinctrl: Add support for Amlogic A4 SoCs To: Xianwei Zhao , Rob Herring Cc: Linus Walleij , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Bartosz Golaszewski , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240611-a4_pinctrl-v1-0-dc487b1977b3@amlogic.com> <20240611-a4_pinctrl-v1-1-dc487b1977b3@amlogic.com> <20240613170816.GA2020944-robh@kernel.org> <42752f1c-fa79-450c-bbf8-f55464db14ae@amlogic.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKb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yJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <42752f1c-fa79-450c-bbf8-f55464db14ae@amlogic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 14/06/2024 10:51, Xianwei Zhao wrote: > Hi Rob, > Thanks for your review. > > On 2024/6/14 01:08, Rob Herring wrote: >> [ EXTERNAL EMAIL ] >> >> On Tue, Jun 11, 2024 at 01:10:57PM +0800, Xianwei Zhao wrote: >>> Add the new compatible name for Amlogic A4 pin controller, and add >>> a new dt-binding header file which document the detail pin names. >>> >>> Signed-off-by: Xianwei Zhao >>> --- >>> .../bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml | 2 + >>> .../dt-bindings/gpio/amlogic,a4-aobus-pinctrl.h | 21 +++++ >>> .../dt-bindings/gpio/amlogic,a4-periphs-pinctrl.h | 93 ++++++++++++++++++++++ >>> 3 files changed, 116 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml >>> index d9e0b2c48e84..f5eefa0fab5b 100644 >>> --- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml >>> +++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml >>> @@ -15,6 +15,8 @@ allOf: >>> properties: >>> compatible: >>> enum: >>> + - amlogic,a4-aobus-pinctrl >>> + - amlogic,a4-periphs-pinctrl >>> - amlogic,c3-periphs-pinctrl >>> - amlogic,t7-periphs-pinctrl >>> - amlogic,meson-a1-periphs-pinctrl >>> diff --git a/include/dt-bindings/gpio/amlogic,a4-aobus-pinctrl.h b/include/dt-bindings/gpio/amlogic,a4-aobus-pinctrl.h >>> new file mode 100644 >>> index 000000000000..7c7e746baed5 >>> --- /dev/null >>> +++ b/include/dt-bindings/gpio/amlogic,a4-aobus-pinctrl.h >>> @@ -0,0 +1,21 @@ >>> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ >>> +/* >>> + * Copyright (c) 2024 Amlogic, Inc. All rights reserved. >>> + * Author: Xianwei Zhao >>> + */ >>> + >>> +#ifndef _DT_BINDINGS_AMLOGIC_A4_AOBUS_PINCTRL_H >>> +#define _DT_BINDINGS_AMLOGIC_A4_AOBUS_PINCTRL_H >>> + >>> +/* GPIOAO */ >>> +#define GPIOAO_0 0 >>> +#define GPIOAO_1 1 >>> +#define GPIOAO_2 2 >>> +#define GPIOAO_3 3 >>> +#define GPIOAO_4 4 >>> +#define GPIOAO_5 5 >>> +#define GPIOAO_6 6 >> >> I find defines with the value of the define in the name pretty >> pointless. >> > In the driver, this macro definition not only uses its value, but also > uses this character, for example as following, > > MESON_PIN(GPIOE_0), > #define MESON_PIN(x) PINCTRL_PIN(x, #x) > > GPIO_GROUP(GPIOE_0), > #define GPIO_GROUP(gpio) \ > { \ > .name = #gpio, \ > .pins = (const unsigned int[]){ gpio }, \ > .num_pins = 1, \ > .data = (const struct meson_pmx_axg_data[]){ \ > PMX_DATA(0), \ > }, \ > } Still pointless. > >>> + >>> +#define GPIO_TEST_N 7 >>> + >>> +#endif >>> diff --git a/include/dt-bindings/gpio/amlogic,a4-periphs-pinctrl.h b/include/dt-bindings/gpio/amlogic,a4-periphs-pinctrl.h >>> new file mode 100644 >>> index 000000000000..dfabca4b4790 >>> --- /dev/null >>> +++ b/include/dt-bindings/gpio/amlogic,a4-periphs-pinctrl.h >>> @@ -0,0 +1,93 @@ >>> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ >>> +/* >>> + * Copyright (c) 2024 Amlogic, Inc. All rights reserved. >>> + * Author: Xianwei Zhao >>> + */ >>> + >>> +#ifndef _DT_BINDINGS_AMLOGIC_A4_PERIPHS_PINCTRL_H >>> +#define _DT_BINDINGS_AMLOGIC_A4_PERIPHS_PINCTRL_H >>> + >>> +/* GPIOE */ >>> +#define GPIOE_0 0 >>> +#define GPIOE_1 1 >>> + >>> +/* GPIOD */ >>> +#define GPIOD_0 2 >>> +#define GPIOD_1 3 >>> +#define GPIOD_2 4 >>> +#define GPIOD_3 5 >>> +#define GPIOD_4 6 >>> +#define GPIOD_5 7 >>> +#define GPIOD_6 8 >>> +#define GPIOD_7 9 >>> +#define GPIOD_8 10 >>> +#define GPIOD_9 11 >>> +#define GPIOD_10 12 >>> +#define GPIOD_11 13 >>> +#define GPIOD_12 14 >>> +#define GPIOD_13 15 >>> +#define GPIOD_14 16 >>> +#define GPIOD_15 17 >> >> I'm not really much of a fan of using defines for GPIOs, but if you do, >> wouldn't be better to split banks and lines up rather than a global >> number space. See ASPEED_GPIO() or tegra header. >> For the same reasons described above. > I want to keep the same style as the previous drive. Which part of Rob's feedback needs more explanation? Best regards, Krzysztof