Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp193275pxb; Tue, 17 Aug 2021 23:27:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3A+BV0Ijitsp464mvP0oJtrFOuE4Awr19k2VWHZqNvYIN7F8M2EEzKM1tE9cU5nR4GByG X-Received: by 2002:a92:6b0a:: with SMTP id g10mr4986582ilc.17.1629268071969; Tue, 17 Aug 2021 23:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629268071; cv=none; d=google.com; s=arc-20160816; b=rdlIBiTj1j0ZyhV6o2yvlAY1cl9yRxmLFiT+NRzRTcJxazpf5aFJz9qMG7xGKsWfzv wnmIIyhCzn/xISp+L/DaecfMjvADmYeDUdn3kyWhqlnEkFGkzLTqs8D2VClknuXHnGlX jnUDkdnSSbh0ALwcWtakXep4SGLBjmRczj/Gx7YmtPE1TNuBG2KQas6CSlZ2PBSfhZdA tnOce894SjpZ+U3zJ9gjTR0vmj5NvknyF1schOzqeUvsyn8OzKyoClSPrBWZNEa7oJHL 2CTx3SUPN1rdzflXckaUFhY9tUUHkP7NQmQT71wpkp/84bS+FhlMjm4X6BBh4INYBjTR 36jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0niOOKpLOqJWr+G2N4qsyCfMLmKR4C8+b8TBbZbKaU8=; b=Xx2v6VkmkZCnbqag7IcdgY1eeQ8y/3+Air1oVao65Sbi2NQi1mswFHMStyBpaFf2Gb Jb5A7WsCodyzUlvnsRbAl4tZlsXcp7qCHab8ZYGQQT5Zdx4CxhnFRvLHJvrmhsaxoC9A jATSwBGRnTStBMUOhrFgti8INg3kUMtwRtAUtFTXq6QdEMvsfd6y2i7zv4xnKSn9IdWb QhcepJK+AEkGGIJr2N9tLgt/4xg7+FCbMsRTFHbWna7gqpN3n7eVK2SwRNrzMjqd7zf8 rfAWYK0OgY8uyHWyYGjPXjJzqAs4UyoKzd7N0kz2th666F5uOkzU/Rh4QoJiKZ0SzRAe ze7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Et8efFBg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si4883669ile.126.2021.08.17.23.27.40; Tue, 17 Aug 2021 23:27:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Et8efFBg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238043AbhHRG12 (ORCPT + 99 others); Wed, 18 Aug 2021 02:27:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240245AbhHRG1P (ORCPT ); Wed, 18 Aug 2021 02:27:15 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4029BC061224 for ; Tue, 17 Aug 2021 23:26:07 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id c12so3080360ljr.5 for ; Tue, 17 Aug 2021 23:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0niOOKpLOqJWr+G2N4qsyCfMLmKR4C8+b8TBbZbKaU8=; b=Et8efFBgzM1OWhTpqkovSGInq7BYnqTenDPJF5Sfp/8L2BDfO3pcqtdv6gK9Xf6rVi bPlFqq3u2Mlnv1Oxq7zttZXNhuIFaIoCKH5Il61HHre6WKqQXBgZ2rtyo6Ql01WiAgAf iqwYaadnd/cBDGdzYU20uWob0rjtS561A0+w4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0niOOKpLOqJWr+G2N4qsyCfMLmKR4C8+b8TBbZbKaU8=; b=cTajntYZmX6vZU+etHOUqIRr/l0eiFsxj3VAEYQSf8aGpG3pkHXMrSKa/uvHRdviwl W/8R5XSw2OnrLr9jcIxmsgnXnXweIu3K15ksarSEn6shEIPNQt4BENOcTCa5WF+uE0Xt uasSxcP4GWbK0qL5cd5roG4s7Pm4q5BxiA2ZFv9iRRC4vdmVQ4BI7qw6y3AXdXkal6o5 FA5kQjCTgEYyrKi+nopVG3ZGaeLvMfKMYqMSXEomCtsc10lknubKEWl4sP+WUJih8OJ7 Se6J/QHsBEkzpXWSXyUEhaXFU2IN8JzUtVRiGlO6lfPFF5bGdFJj5A4SFsc2jfNHvtky c0Qw== X-Gm-Message-State: AOAM530d3YZ0NkYtgqK0lEVXC0DayS7gATSwWmKTK8A+eLWyZjb8WohG yZjZRO49jL/Bwyh80Od5tuhVq01uww5wbt7pgVOWtA== X-Received: by 2002:a2e:7d0e:: with SMTP id y14mr6438392ljc.251.1629267965676; Tue, 17 Aug 2021 23:26:05 -0700 (PDT) MIME-Version: 1.0 References: <20210710081722.1828-1-zhiyong.tao@mediatek.com> <20210710081722.1828-2-zhiyong.tao@mediatek.com> <1626940470.29611.9.camel@mhfsdcap03> <07388dac4e25e0f260725e8f80ba099d5aa80949.camel@mediatek.com> <4fd12d5c53f6492e5fa3ba94a78b9a149f5b6ed9.camel@mediatek.com> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 18 Aug 2021 14:25:54 +0800 Message-ID: Subject: Re: [PATCH v10 1/2] dt-bindings: pinctrl: mt8195: add rsel define To: "zhiyong.tao" Cc: Linus Walleij , Rob Herring , Mark Rutland , Matthias Brugger , Sean Wang , srv_heupstream , hui.liu@mediatek.com, Eddie Huang , Light Hsieh , Biao Huang , Hongzhou Yang , Sean Wang , Seiya Wang , Devicetree List , LKML , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 18, 2021 at 4:09 AM Linus Walleij wrote: > > On Tue, Aug 17, 2021 at 9:51 AM zhiyong.tao wrote: > > > In one chip, If GPIO is different, the MTXXXX_PULL_UP_RSEL_001 may > > means different actual bias resistance setting. > > > > For example, > > > > KPROW IO > > Paramters Descriptions Min Typ Max > > UNIT > > Rpd Input pull-down resistance 40 75 190 Kohm > > Rpu Input pull-up resistance 40 75 190 Kohm > > Rpd Input pull-down resistance 0.8 1.6 2 Kohm > > Rpu Input pull-up resistance 0.8 1.6 2 Kohm > > This is exactly why we should try to use SI units in the device tree. > I assume that the software can eventually configure which resistance > it gets? > > The electronics people will say make sure it is pulled down by around > 80 kOhm, they can put that on the device tree and your code can > say, "hm 40 < 80 < 190 this is OK" and let the value pass. > > We do not define these exact semantics, it is up to the driver code > to decide what to do with the Ohm value 80000 in this case, but > it makes perfect sent for me to let it pass and fail if someone > for example requests 20 kOhm, or at least print a helpful warning: > > dev_warn(dev, "the requested resistance %d is out of range, supported > range %d to %d kOhm\n", > val, low, high); > > This is what makes the SI units really helpful for people writing device > trees: solve real integration tasks and make it easy to do the right thing. I think this makes a lot of sense. The driver could select the closest setting. And from what Zhiyong mentioned offline, the resistor values aren't exact as specified in the datasheet. I suppose this is expected with any electronics. So the hardware integration will say to pull up or down by some value, and the driver will do its best to fulfill that request. That precludes DT schema checking for the values used, but I think that is a good compromise. Zhiyong also mentioned that some of their downstream integrators might not be able to deal with actual values, and would prefer symbols tied to specific RSEL values. I think that would be doable together using some _magic_ values, but I would prefer not to if it were avoidable. Regards ChenYu