Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp260268rdb; Wed, 20 Dec 2023 11:21:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IETccbxMRKNJkGKKHaj4e4ZtlSSZtXwCreGvN37Lo9A/RL/7XhX0Nzj/7YUsH/F1zruE3I2 X-Received: by 2002:a05:6870:c193:b0:1fb:d89:48c3 with SMTP id h19-20020a056870c19300b001fb0d8948c3mr279092oad.27.1703100115405; Wed, 20 Dec 2023 11:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703100115; cv=none; d=google.com; s=arc-20160816; b=HrbZNUkfIzVRdNsFY3TS6Cs8IJkPO0WJobmOoU5nnddlyCEaMSWWn1OkRRtxnzxSrp Z85vDKrxAzatSbEVHd73HNoaNGUBrzIq4uNPccrWFaWmbPdwLpWI0kLeAlYsY7ob11Dt OgDOg5GwiDySbXDePdsfEvVKXedv0Gqsd3SXtA5Wui19cV/BXBF8twt0OM8CIFBzf08r f4DSBh9MBpcbBnr/9jXcrj5QUQmWmpatTJint4cARizI3TUuplvIZ2f8ydKn05KRvhAf bzRJh3Ux8At1eC/uTi7khQNyGKZa7q7w0krDnusGCeDRh+rjfW+lQHnf1MUBl74gV7nU XcXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ps3P/pvG74IGGnT8GqUmphrkn8oo7nKEcsYAKREB89c=; fh=twuqVqg7Z/L32ulkYmSxaRr+Fcl/KcoqtiQosSInNLw=; b=zBbG1Ne3JyLI5ZfyiB1rQGwylsNP+VxveWoCyMTWsAsxAScLfLqe9gsY7gzL+ornP6 ldj5/hwTA6oERHj0A9O6/nQyXZf8nN99hPk+jZNdHg2y275BFoZAFCbEf7EbYPwLWxzO jt1YnbnVt9lFRx0pD2IX3JxvgbcaAIV07XESOn8CLAWId8fDxEr5yiYuqtSw2vpCDVA/ TMdVMpdrj6EV8IoR6KClQrAZsdFg2j1MQgQ7yOmNdO4xndOmigLm35MasVx3PUg8Eknx HgExNrVx/Y21QAo/kl70xc41J/AzqFPKNCC6U9pBUMCkSSg8OYzvVgtVpMoosNpmQ7an HrWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hsJP9FXo; spf=pass (google.com: domain of linux-kernel+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s20-20020a656454000000b005cd85bb1092si204662pgv.425.2023.12.20.11.21.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 11:21:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hsJP9FXo; spf=pass (google.com: domain of linux-kernel+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E820EB24499 for ; Wed, 20 Dec 2023 19:21:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B017F4878D; Wed, 20 Dec 2023 19:21:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hsJP9FXo" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EFBF482DF for ; Wed, 20 Dec 2023 19:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-dbd532e6e8aso6707276.2 for ; Wed, 20 Dec 2023 11:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703100062; x=1703704862; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ps3P/pvG74IGGnT8GqUmphrkn8oo7nKEcsYAKREB89c=; b=hsJP9FXowB9Go9/CUlXoDwre8bu3Ej24ZqEXSduvqsC47KX5v3WTHf50QCkcc7SQfb ajJiPHl/tNndtgdXZBVbzN7PDDBQrV0b3gXwoF7lypm0YWCZjiBjTmar/YpgL1Nga5gm vjEGReyWvXEXkIk+r+egyjLaZ8vmW/VRkln5MC5A71NKYTYQpnOnvuU1c0HqpF/C1396 GFYJAV9GPf1+/UPMxx+BmLVP9SXPEOAUGM7G6j9x9KtZNMdbYAxDyxtWcvyr/Lqh3Icv t90E88kJ5A+zJNZ5/bJksfXbyYizKUEDGXG35IkxVGHBUU/TLiLVyYMOPFIikPJRwEN5 I25w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703100062; x=1703704862; 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=ps3P/pvG74IGGnT8GqUmphrkn8oo7nKEcsYAKREB89c=; b=VchgW5W3fkQLw1fJhIqQmoghNsQ6W22b2ADhKnZfuxDKJmRDl/gdG9IeC4jTTakQYK Kt7CQTC8hnWBZYDmCoL62oAxhwjnYMeFLMNsRib34mS3RClFUGhiB7W807w2/3zxVXMU i1VVq/OR27iyQPx/FmJmHQxoITlL+QZKq6zVd6hVr2JKoqKR21I5LOnVm0XWiKaGp/1D q36rKDQfkrLEfs+JK+9BrcVteL7K2IYV660D7YT7UVIoAtbtRiam97LFeYgCjICsU9fj 1CuuVqmGUdz4tQTpm5hGa2QNYBFVdEpWe4LUtLgZMm6XLcY3iL8qpme7QlS/tE+4th4h oFFA== X-Gm-Message-State: AOJu0Yz2aCdGKARcPvwcEXSiHsfpKCZ0OwmYSxWIaYoKtV4sy/K52Kwe NLWQHf/JbXr8p1+D8xj5A+HL7U1Tfi53KUWBwCioiQ== X-Received: by 2002:a25:1c1:0:b0:dbd:b165:43d with SMTP id 184-20020a2501c1000000b00dbdb165043dmr247285ybb.18.1703100062573; Wed, 20 Dec 2023 11:21:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215143906.3651122-1-emil.renner.berthing@canonical.com> <20231215143906.3651122-2-emil.renner.berthing@canonical.com> In-Reply-To: <20231215143906.3651122-2-emil.renner.berthing@canonical.com> From: Linus Walleij Date: Wed, 20 Dec 2023 20:20:51 +0100 Message-ID: Subject: Re: [PATCH v1 1/8] dt-bindings: pinctrl: Add thead,th1520-pinctrl bindings To: Emil Renner Berthing Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Hoan Tran , Serge Semin , Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Guo Ren , Fu Wei , Paul Walmsley , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Emil, thanks for your patch! On Fri, Dec 15, 2023 at 3:39=E2=80=AFPM Emil Renner Berthing wrote: > + The TH1520 has 3 groups of pads each controlled from different memory = ranges. > + Confusingly the memory ranges are named > + PADCTRL_AOSYS -> PAD Group 1 > + PADCTRL1_APSYS -> PAD Group 2 > + PADCTRL0_APSYS -> PAD Group 3 Really, even in the documentation? If you look at the layout on the actual chip, does a pattern emerge? I think some use the north/south/east/west as group names with the BGA chip facing up with the package text correctly readable then it is a bit like a map. > + function: > + $ref: /schemas/types.yaml#/definitions/string > + enum: [ "0", "1", "2", "3", "4", "5" ] > + description: The mux function to select for the given pins. So why is the opaque names "0", "1" etc used, and they will be the same for all pins I bet. Most drivers use a string identifying the actual function h= ere. Such as "i2c", "gpio", etc. Names that are just figures are *impossible* to understand without access to a datasheet. The point of device trees sources are to be human readable, strings of magic numbers are not human readable at all. > + bias-disable: true > + > + bias-pull-up: > + type: boolean > + > + bias-pull-down: > + type: boolean > + > + drive-strength: > + enum: [ 1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23= , 25 ] milliamperes? Then use drive-strength-microamp. If not, explain what each setting means, i.e. the number of max microamps. At which point using drive-strength-microamp and a translation table in the driver may be a better idea. The only reason to use opaque numbers is if 1, 2 (etc) mean something like "number of driver stages" with a current output that varies with technology= . > + thead,strong-pull-up: > + oneOf: > + - type: boolean > + - $ref: /schemas/types.yaml#/definitions/uint32 > + enum: [ 0, 2100 ] > + description: Enable or disable strong 2.1kOhm pull-up. Just use bias-pull-up with an argument. bias-pull-up =3D <2100000>; No argument would be the default setting. No need for custom bindings. > + uart0_pins: uart0-0 { > + tx-pins { > + pins =3D "UART0_TXD"; Pins have reasonable names, but... > + function =3D "0"; What about function =3D "uart_0" hmmm? Yours, Linus Walleij