Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4426819rdh; Wed, 29 Nov 2023 00:48:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTPYKv6y3uX+PSSXuOyegMC0tD7R0u7O4MOHpUAxuOcf0Yc7D9FazbgK0FJz/2o1ZGw1Bl X-Received: by 2002:a05:6a20:47cf:b0:18b:cc3a:cf24 with SMTP id ey15-20020a056a2047cf00b0018bcc3acf24mr18490716pzb.9.1701247682100; Wed, 29 Nov 2023 00:48:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701247682; cv=none; d=google.com; s=arc-20160816; b=g2J2X74UUxDVOmuWTBhjWXo7B+MP+U5a55WnI09Qcim18UpHPTMTBVEZvSQhIAurWx +Apub5QodXt77/XyWe+tiuFjPRfNemjHsaMYXIJne6czYvA0bjaBSKBtDq7HOSSFxm3d NNnten3wqZnyeQefFSIIDZjjiTiWMqbx3qVvQUqm0qfIFSIPiE1eXwffZSQq1Ykz8O+G TEzDltkweuYEt7ANIijqK+OmWb+I7BXQ1SF9cQ6Z2Rns1MdDfR9Fm5thZq/qEg2URz+Q BrRhDm3mZInCobPgLOTxWN4zyXCgmchV5fvug7xeayCkYlFCgSD5yP0+JXqcapYyqDpK FpCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=o5tdoVKyDjDeeo06E0ClRZAesIH8s4+ymEvuxAampvo=; fh=7KXPSHhatyIx343ce4sQXOn5eVXNAgGAEy93JOTxRVk=; b=LVRIT6J+t3eOYwAK5m7pXdlvlFZumqGRuY6Y4nY+takPXQJ0acgmrjd/M9/rms93r9 gyRSlzGK6v2uvzTsZVRj/gR6npesOkTHYaQ68Bi4R27GkM3E1XJtPo6e/heNNaBKZWxM NBiv99fHQxiqDXs05+bhCuEW1ZOyrUj1WNW/S0NETyKY7u03+amtcbXwUEWnAEeWVsOF 2X2F4YNXCTyvEXQq8QMhqRuHcANX5Ae4WjA0yCV0Yt1/pQEQgIDERXkpam1MTzWF+H5G GZxbtBUEz43L5MoTjhQBdJlaavy9ajtkFWwXPldlzXLEEJD+ARFdcoVbAsk1ZgI1Bk6/ 3R3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b8-20020a056a000a8800b0068e3b121545si14308612pfl.58.2023.11.29.00.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:48:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E1B5880793C7; Wed, 29 Nov 2023 00:48:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbjK2Iru convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Nov 2023 03:47:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjK2Irt (ORCPT ); Wed, 29 Nov 2023 03:47:49 -0500 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E53B0; Wed, 29 Nov 2023 00:47:55 -0800 (PST) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-5cbcfdeaff3so66495557b3.0; Wed, 29 Nov 2023 00:47:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701247675; x=1701852475; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mLerLul424y9KF+UL/6zr3ivEhD1RgHSR/3xjytvLS8=; b=ZkemoQjO/bBTd8d+LsdUMD4ToLFvR20uTycUuPxASEp1Wv2jracDpJVgxuRhBKgrEe Dv8UdOCyYtn4jolKAK4sP6RSsPGdC2iMkUPZ0S5x5T3GOJUs4mGd0o+GP3c0bN61YS+v reWI8SIzVw3ops8uEEJRZuKt+F021WhZYGbnzgWtzawtgIzARNp5p2IpIdcWRxPw1inS KX4TqE7nxu4NOKRYqZzv7i4LINXvhKAjvbWkAOH0idqiR1rbe5WeryFNRl3ruKGmXupS XotY6M5C+57zYE9/5WtXUVdimrFItNhI8//XtzhFOi2crDcWuQgN+HmH5Zy2mNAS+S/g RlDA== X-Gm-Message-State: AOJu0YwhAMu2qlqPqdc4Z90/V5/ZBk4IYYMRuHFYGGJUPwSY2LlQlfYj 1fLzznAmzfiVy805JgkGlhzy5QFijUR+NA== X-Received: by 2002:a0d:cbd0:0:b0:5ce:9d68:2b81 with SMTP id n199-20020a0dcbd0000000b005ce9d682b81mr14200254ywd.28.1701247674706; Wed, 29 Nov 2023 00:47:54 -0800 (PST) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com. [209.85.219.174]) by smtp.gmail.com with ESMTPSA id t184-20020a8183c1000000b005cb7fccffe2sm4409502ywf.126.2023.11.29.00.47.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Nov 2023 00:47:54 -0800 (PST) Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-db49ab94768so3541001276.2; Wed, 29 Nov 2023 00:47:54 -0800 (PST) X-Received: by 2002:a25:3d1:0:b0:db4:47e1:407d with SMTP id 200-20020a2503d1000000b00db447e1407dmr16074846ybd.60.1701247673674; Wed, 29 Nov 2023 00:47:53 -0800 (PST) MIME-Version: 1.0 References: <20231125184422.12315-1-krzysztof.kozlowski@linaro.org> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 29 Nov 2023 09:47:42 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] docs: dt-bindings: add DTS Coding Style document To: Francesco Dolcini Cc: Krzysztof Kozlowski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Andrew Davis , Andrew Lunn , Arnd Bergmann , Bjorn Andersson , Chen-Yu Tsai , Dmitry Baryshkov , Heiko Stuebner , Jonathan Corbet , Konrad Dybcio , Michal Simek , Neil Armstrong , Nishanth Menon , Olof Johansson , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, workflows@vger.kernel.org, linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:48:01 -0800 (PST) Hi Francesco, On Wed, Nov 29, 2023 at 8:29 AM Francesco Dolcini wrote: > On Sat, Nov 25, 2023 at 07:44:22PM +0100, Krzysztof Kozlowski wrote: > > Document preferred coding style for Devicetree sources (DTS and DTSI), > > to bring consistency among all (sub)architectures and ease in reviews. > > Thank Krzysztof, we had most of this collected as BKM in some internal > documents and it's great to see the effort to consolidate this and add > it to the kernel documentation. > > > --- > > +Following order of properties in device nodes is preferred: > > + > > +1. compatible > > +2. reg > > +3. ranges > > +4. Standard/common properties (defined by common bindings, e.g. without > > + vendor-prefixes) > > +5. Vendor-specific properties > > +6. status (if applicable) > > +7. Child nodes, where each node is preceded with a blank line > > On point 4, do you have a more explicit way to define what is an actual > standard/common property? You mention the vendor-prefixes as an example, > is this just an example or this is the whole definition? I think there are three classes of standard properties: 1. Device Tree Specification (from devicetree.org) 2. dt-schema 3. Common subsystem bindings (Documentation/devicetree/bindings/) (may be moved to 2). > What would be the order for this for example (from an existing DTS file)? > > reg_sdhc1_vmmc: regulator-sdhci1 { > compatible = "regulator-fixed"; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_sd1_pwr_en>; > enable-active-high; > gpio = <&main_gpio0 29 GPIO_ACTIVE_HIGH>; > off-on-delay-us = <100000>; > regulator-max-microvolt = <3300000>; > regulator-min-microvolt = <3300000>; > regulator-name = "+V3.3_SD"; > startup-delay-us = <2000>; > }; > > I guess the point that is not obvious to me here is where do we want > pinctrl. I like it at position between 3 and 4, the rationale is that is > a very frequent property and this way it will be in a similar place for > every node. The pinctrl properties are only present in board DTS files, not in SoC DTSi files. There are two classes of them: 1. Extension of on-SoC devices, where they are added to already existing nodes, defined in the SoC DTSi files, e.g. (from the same existing DTS file): &cpsw3g { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii1>; status = "disabled"; }; 2. Pure board devices, in new nodes (e.g. your regulator example). These are less common, so I don't even know from the top of my mind when I last added one, and where ;-) I'd guess after all standard properties? 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