Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp271942rwb; Fri, 18 Nov 2022 00:56:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MizK35jIkbVO9dFtJrw8QR9XU3a6OCVJ8crWKuqPqJdEkfD1o1D7fUYUYoAEHxKWfdQd1 X-Received: by 2002:a17:907:104d:b0:79e:3312:9a0f with SMTP id oy13-20020a170907104d00b0079e33129a0fmr4845625ejb.576.1668761805722; Fri, 18 Nov 2022 00:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668761805; cv=none; d=google.com; s=arc-20160816; b=H5J5Baxvhbl2TM/vvaQnhP0wdbkgqAeqMfCbO0zPJdAru0+KgeDfFCMdk0YDFL+aWF udSxiS+SF3SuSF2wc2DcPwrskKgqylNTNrlu9SHeIVD1HF6B0pdgGv/U2Q97jRR8FS1X Y+lKf8QcHXrb/xRJ9ZCsjUTYAsH/JcOqxxC2vEzWNgUnXWfpuTFEQ65JGXL175OfNnyO v8/WtwE1aKwP/ikIT40skPQz+X24XLIH4uy2DQL06cziTrjCgubO8dxTTiHAp/EfBgAU LzemlWDdZP5uZRGJOBzUzZYhJVWIUEGue74rmhwrlKZyNFEy8iQJYIGSKrmONWyJ7tuK WSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=68mrRnkzj3oQa0FLrqBNiAeYRXXNrTvDWJrNGCv156I=; b=OOw5o9KDI9WIcXGZTjEgxSS/vCJ/RIJUo5F9eUI1YJj0yQA2RWh5Dd65xkM2HswKUN DsOM7lZy8KeI0xkdlByKZrpdUKaJIXKPyEgkWL3jpB0c6y7WPU0g5WVY/IWFi3CJOkGt eIcQo9m7Iav90/p+UqZ61uNyIcZNGLz6qckE+sucaLLzZZDmmn5nAXbKTsSO6mL8tLP+ EFB4LpW5xZKaB9CAW9ImN4dQcA6Z9gGbyUkMYZLRdI3TbudbR1R+wOMkjXalC1Fxgb5G p/XxKicHPUJrjEGe8ZmZtfXHPS46ehHB+ZEFmW6N/XzExm1xSMija2w3Cu97V5H7DwXj C/ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IzqPSO7w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f24-20020a056402161800b004626d7caf42si2699917edv.270.2022.11.18.00.56.22; Fri, 18 Nov 2022 00:56:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IzqPSO7w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241434AbiKRIZn (ORCPT + 90 others); Fri, 18 Nov 2022 03:25:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241465AbiKRIZP (ORCPT ); Fri, 18 Nov 2022 03:25:15 -0500 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 323F093CCC for ; Fri, 18 Nov 2022 00:25:07 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id t10so5952870ljj.0 for ; Fri, 18 Nov 2022 00:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=68mrRnkzj3oQa0FLrqBNiAeYRXXNrTvDWJrNGCv156I=; b=IzqPSO7wI+mpoQperr2WdlaDIYaeVBLe62eUhSFFin+LXc/0ZY09BXeSlRIHyIBZ+n g7FfS09ooCDKBkJb3VzV2MqrQtdT9bRKgVdPqIa+gFSkyvXQFEs9kB5y5UFKBRJnHG2Z oDglrrTv6LqEzvWT6rSw9dPDyTbFvQ/oxSZp7/TSivwNybxn4DuF6MRTZwgl3hk4pbvy TpF+1MxxsF2PqrJX20cXYajBdp3sxjAeAqF+ZsauGTn6EuPMLk0x5m9LbUO2RYTpElZ/ +TjEyNeqvRV6h/NlVYPBvGZo8qgERFpmdKnEHlmyzi/d8/J/IauvI8LVUL6+8juPiKI+ HsnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=68mrRnkzj3oQa0FLrqBNiAeYRXXNrTvDWJrNGCv156I=; b=zriofijY3Yy7olR76Q1MY/+2eWd/KVTeV+4oFPtHeHmk/fcBhnWG3stAd4Wuzsnzhm xelOTEH4+gpmfsuCWeoYc+K4IF+8PRPP/ZiTxOdwb1ZWsK+WcolSjcRP0QGg8G+vBZBB H3nmsCL0Xzg+c+rs3C/384F27IOLd69xmY+BxkyDp2WYzv0TyXyIJ+80HrGfyNg5tDS2 hJd84MgggWsFh2/V/8f+LZ9JAnu4T/xUo2ZIBaYGRVgVw8JO2bLlCPaB9Q7nKThoubGd BInQPcz0OPUgbNJdCg+H/qcEPeo3XPr7nNF/DY4xJUV/q4YaIjWisQ1+Msv9xW2GlBMJ YwsQ== X-Gm-Message-State: ANoB5plP3q3OgbOHl04xHatX2xaQ4Ti3PgVZZQNYT4omZpEQlGfXHhkN J4CFThKFLyhySH06lM4NqXsnsw== X-Received: by 2002:a05:651c:205d:b0:26f:b445:8c8a with SMTP id t29-20020a05651c205d00b0026fb4458c8amr2309527ljo.156.1668759906201; Fri, 18 Nov 2022 00:25:06 -0800 (PST) Received: from [192.168.0.20] (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id o15-20020ac24c4f000000b004a44ffb1050sm565729lfk.171.2022.11.18.00.25.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 00:25:05 -0800 (PST) Message-ID: <06e916b7-f8f2-6de5-f86e-7b020c052451@linaro.org> Date: Fri, 18 Nov 2022 09:25:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 4/7] dt-bindings: pinctrl: add bindings for Mediatek MT8365 SoC Content-Language: en-US To: =?UTF-8?Q?Bernhard_Rosenkr=c3=a4nzer?= , linux-mediatek@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, angelogiocchino.delregno@collabora.com References: <20221117210356.3178578-1-bero@baylibre.com> <20221117210356.3178578-5-bero@baylibre.com> From: Krzysztof Kozlowski In-Reply-To: <20221117210356.3178578-5-bero@baylibre.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/11/2022 22:03, Bernhard Rosenkränzer wrote: > Add devicetree bindings for Mediatek MT8365 pinctrl driver. > > Signed-off-by: Bernhard Rosenkränzer Thank you for your patch. There is something to discuss/improve. > + > + pins-are-numbered: > + $ref: /schemas/types.yaml#/definitions/flag > + description: | > + Specify the subnodes are using numbered pinmux to specify pins. Why would you name pins differently per board? And why this different naming of the same pins is a property of hardware? This looks like something to drop. > + > + gpio-controller: true > + > + "#gpio-cells": > + const: 2 > + description: | > + Number of cells in GPIO specifier. Since the generic GPIO > + binding is used, the amount of cells must be specified as 2. See the below > + mentioned gpio binding representation for description of particular cells. > + > + interrupt-controller: true > + > + interrupts: > + maxItems: 1 > + > + "#interrupt-cells": > + const: 2 > + > +required: > + - compatible > + - reg > + - gpio-controller > + - "#gpio-cells" > + > +allOf: > + - $ref: pinctrl.yaml# > + > +patternProperties: patternProperties go before "required:" block. > + '-pins$': > + type: object > + additionalProperties: false > + patternProperties: > + 'pins': How about anchoring it to either prefix or suffix? ^pins or pins$. > + type: object > + additionalProperties: false > + description: | > + A pinctrl node should contain at least one subnode representing the > + pinctrl groups available on the machine. Each subnode will list the > + pins it needs, and how they should be configured, with regard to muxer > + configuration, pullups, drive strength, input enable/disable and input > + schmitt. > + $ref: "/schemas/pinctrl/pincfg-node.yaml" Drop quotes. > + > + properties: > + pinmux: > + description: > + integer array, represents gpio pin number and mux setting. > + Supported pin number and mux varies for different SoCs, and are > + defined as macros in -pinfunc.h directly. > + > + bias-disable: true > + > + bias-pull-up: > + description: | > + Besides generic pinconfig options, it can be used as the pull up > + settings for 2 pull resistors, R0 and R1. User can configure those > + special pins. > + > + bias-pull-down: true > + > + input-enable: true > + > + input-disable: true > + > + output-low: true > + > + output-high: true > + > + input-schmitt-enable: true > + > + input-schmitt-disable: true > + > + mediatek,drive-strength-adv: > + description: | > + Describe the specific driving setup property. > + For I2C pins, the existing generic driving setup can only support > + 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they > + can support 0.125/0.25/0.5/1mA adjustment. If we enable specific > + driving setup, the existing generic setup will be disabled. > + The specific driving setup is controlled by E1E0EN. > + When E1=0/E0=0, the strength is 0.125mA. > + When E1=0/E0=1, the strength is 0.25mA. > + When E1=1/E0=0, the strength is 0.5mA. > + When E1=1/E0=1, the strength is 1mA. > + EN is used to enable or disable the specific driving setup. > + Valid arguments are described as below: > + 0: (E1, E0, EN) = (0, 0, 0) > + 1: (E1, E0, EN) = (0, 0, 1) > + 2: (E1, E0, EN) = (0, 1, 0) > + 3: (E1, E0, EN) = (0, 1, 1) > + 4: (E1, E0, EN) = (1, 0, 0) > + 5: (E1, E0, EN) = (1, 0, 1) > + 6: (E1, E0, EN) = (1, 1, 0) > + 7: (E1, E0, EN) = (1, 1, 1) > + So the valid arguments are from 0 to 7. > + $ref: /schemas/types.yaml#/definitions/uint32 > + enum: [0, 1, 2, 3, 4, 5, 6, 7] > + > + mediatek,pull-up-adv: > + description: | > + Pull up setings for 2 pull resistors, R0 and R1. User can > + configure those special pins. Valid arguments are described as below: > + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. > + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. > + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. > + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. > + $ref: /schemas/types.yaml#/definitions/uint32 > + enum: [0, 1, 2, 3] > + > + mediatek,pull-down-adv: > + description: | > + Pull down settings for 2 pull resistors, R0 and R1. User can > + configure those special pins. Valid arguments are described as below: > + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. > + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. > + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. > + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. > + $ref: /schemas/types.yaml#/definitions/uint32 > + enum: [0, 1, 2, 3] > + > + mediatek,tdsel: > + description: | > + An integer describing the steps for output level shifter duty > + cycle when asserted (high pulse width adjustment). Valid arguments > + are from 0 to 15. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + mediatek,rdsel: > + description: | > + An integer describing the steps for input level shifter duty cycle > + when asserted (high pulse width adjustment). Valid arguments are > + from 0 to 63. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + required: > + - pinmux > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + > + pio: pinctrl@1000b000 { > + compatible = "mediatek,mt8365-pinctrl"; > + reg = <0 0x1000b000 0 0x1000>; > + mediatek,pctl-regmap = <&syscfg_pctl>; > + pins-are-numbered; > + gpio-controller; > + #gpio-cells = <2>; > + interrupt-controller; > + #interrupt-cells = <2>; > + interrupts = ; Blank line > + pio-pins { > + pins { > + pinmux = , ; > + mediatek,pull-up-adv = <3>; > + mediatek,drive-strength-adv = <00>; > + bias-pull-up; > + }; > + }; > + }; > + }; Best regards, Krzysztof