Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1494086pxb; Tue, 17 Aug 2021 13:12:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymSgESoE5CHYxR4LhnPXjWmKj6Xdd7ynlONDG4XSXTCgiteqTYDux9MGjRly946P0Pa1bB X-Received: by 2002:a17:907:217a:: with SMTP id rl26mr5940926ejb.9.1629231172475; Tue, 17 Aug 2021 13:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629231172; cv=none; d=google.com; s=arc-20160816; b=iVqS2OdWupXnYUIa7+V/J/viKAvX0u7v454JVlov392P3q/SOMidL3JmVJmKpfCRJ5 Fv39PxUFctDvQ6D50coUSur51B0rQ63ZQFoIk9aNcX+IVEoaNg4ywDZpCO4lzewPS4B/ 3CTFbW/jyH2afCBsH32SqcV2sLYmP8x+b810s3P/vxSbX674gXKIn+pG8LwnopM3QNo/ ZC/d4y9dOMCypHdQy0iS3vxOT2g5aPofCzAiibO/cBzsgyQSy26xmiL+zeAN5RTyKYlv F4d/pqvS/B7194K3aUczqqywBnJY907DaXMyQjBj+EPtjdokeubFOD1wiIacfIccGbZP 2dXQ== 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=k8AfVuCGxDrAVAQEMwEyKZr/585805GvK2MzsN/gS3A=; b=fej1i6jEAlI5Y58pgMKfpVN+H6CQtIRON88qiE7vkeVEPstgNm0ew4FWwa0pOZCtgd ujWaXrhr3ao/JMS/kdulvGEnU3SWdW4nvAENtgnte/+5mbRe+FWabU7cIY6z6yL7c+1O T0yrEOsUjPd7tspqsZC3RnBuXUmXkH1fGfyfhgv359u1Bq7gEZQ7m1Sct/m+bka8g4dC d3GGTeN7mmTeB5/yA/lAIl2ivV5aNlwsSa25o2uL3zqFWhxN1EdVkIIWzdnsvIZG+eW0 tvxilAuD1hXtqqMucptkUlRyqSwuA9LYn4RXQZBrm7M0PGXaIN1wQIPCrEJ5yd8HyeI6 T4wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CZPAZB5/"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si3085482ejj.684.2021.08.17.13.11.48; Tue, 17 Aug 2021 13:12:52 -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=@linaro.org header.s=google header.b="CZPAZB5/"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233110AbhHQUKJ (ORCPT + 99 others); Tue, 17 Aug 2021 16:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229466AbhHQUKI (ORCPT ); Tue, 17 Aug 2021 16:10:08 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E46E6C0613C1 for ; Tue, 17 Aug 2021 13:09:34 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id x27so43669128lfu.5 for ; Tue, 17 Aug 2021 13:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k8AfVuCGxDrAVAQEMwEyKZr/585805GvK2MzsN/gS3A=; b=CZPAZB5/x6SSKO3/e4ljoCjcPsrNGDpLblZMD69HhLBEw4EpEnaMCLjsSRVWWn5c8R 6qK/hjUcTlz7tWO+lSjquayDXvuIN/47A6alfgci5XZp4ZVck4LIDSG8X7Q4SDpoCz7q LZldLdE0hvD9Rs6Nr3Up4gkhyI3fIuSToGWAn4IZ92cR4YbsAltHiAVd+9v9BeE0nzik ZPzZ6EjD8WwP1T0XpfKHkv1ra0lT7gDQWjVvNmU6cMwDo70qRzQnBhZIsfPpSsi6FIQy DycVicbxZ8DEKI/CY5OzuH7cofexceLkH5ljhdve4pmcRWOn6+KyDnNaqxa4SUW4vZA7 vfLg== 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=k8AfVuCGxDrAVAQEMwEyKZr/585805GvK2MzsN/gS3A=; b=qxq98QBDjgt9E6fnU/9v4F42/KUM/f3m/Z/+iVVZdfoxy172z30tE5eUY6z4w7uMqt uEFvr0vQ/OagJN9ZzMXV9f2mYxllJEGYYBUTlHSudpwX5w2QHOMpDDARxEwSBpWbKR19 EVbYmcQp2Iwqvy3Fbui+XjdkV+1p4FoEhd1zO2BaB2NEUZduolAYqos0WbdUOKyg5/90 tkaJRtNVZG5SQR8aORSvBfPhSPn3iR9Ouoz7ghVbG1Y10AfKydA5ASm1kJU3rONilCtu Q3hncJA0H0hwiSxBCQS20DCX33zMv0lykdiFHFoiQ4RLLnBCX87ZJVlTMY0W6aXML8d+ 1zWA== X-Gm-Message-State: AOAM533tOTTVkDuhLZEMveQ/Viu77V6E5OETwm8POj41e1sjcjf7VnSz 4ZmjomvjzYbzdwxoLCOasVV68jWd/H14rL6SD+nOEA== X-Received: by 2002:ac2:58d4:: with SMTP id u20mr3489426lfo.157.1629230973143; Tue, 17 Aug 2021 13:09:33 -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: Linus Walleij Date: Tue, 17 Aug 2021 22:09:21 +0200 Message-ID: Subject: Re: [PATCH v10 1/2] dt-bindings: pinctrl: mt8195: add rsel define To: "zhiyong.tao" Cc: Chen-Yu Tsai , 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 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. Yours, Linus Walleij