From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B14CC433EF for ; Thu, 16 Sep 2021 19:20:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D5C86108F for ; Thu, 16 Sep 2021 19:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbhIPTVX (ORCPT ); Thu, 16 Sep 2021 15:21:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbhIPTVX (ORCPT ); Thu, 16 Sep 2021 15:21:23 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE36BC061766 for ; Thu, 16 Sep 2021 12:20:01 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id b18so21143502lfb.1 for ; Thu, 16 Sep 2021 12:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PPtErykHffDTwWwkTPv05ujpl6rxPVv0ht1R2b6tSic=; b=e0PC1GpB7ZJFgXRVvu3ZJnMbNXGWfdET3mocGGzH+6WVb9vKeNS3d8lNhcLhQduljR sPJROxKxQMuFAvNIHrikUiUp1G/x3EUMYJ9v0pGCWsKvUIzdGx6EYh8WRyalywQM1Tip 6zbp5PTUekyq//jYZBaTQ7SZJstfBpCAQUAj3qJ+q1ra1I1vo8nqItuNWXgdmjTYtSle dsC3MCx+Ls10DzQWh70iqoAiGEbWXv+thS6sbgRWV578KKD9whbEYpkf5OttIC89M1xL wSCHOkSJRjL8MOO9ID2uHW3LW9RXxbZ1p7mhBDiBNIzJYXRM1Ik+lLV+XOioIbyrrwK0 iEiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PPtErykHffDTwWwkTPv05ujpl6rxPVv0ht1R2b6tSic=; b=Oo/w1oQxI9u3v/j13cr120RaHSpcu5PXoZQOxRId9tL9X15HZ6KPyg0I5O2cT0z1bu 4raANG4/3h3kP2MVah8QXdJRExcIlp0g2Cluey2glzAMrpFhew/qmEQ4PLmvjofs1z3P nvdXlpbkPgUj2Zi74WdYIU9yI3Ix3CimcMpiSkhVHctctv+VE/TPSazOfrKjpxlaBiLM yNNSu4MW0JoTB/Szc1SqSjhzgB6M+fPxiTEc+cSYazry0BWXKbTt6pP4oUHMkhjg7FLd 4/Jja2fvjXiAyGq46HJ7qkF3AFghaDBZPdNXhP8Tm7NJcEmukLaWWDOa0NKQCFkyCmd8 k0Fg== X-Gm-Message-State: AOAM531ASMpWfWOoci2Fe03g+gg9RGwta9nesW6FKnMFQRSJAJm5f3Lt lL1bcZWefeXdstYcF0j2EBuLUhtM93v4oMTKoZHZIA== X-Google-Smtp-Source: ABdhPJyqXxi8sTfia4C+SnKlFeZM97GP6T8DvwfvgC4OqIQLWfI9nLD5oL0an/dH+HuZ4zfTVtjjBkgiqIZULSRCNoo= X-Received: by 2002:a19:770d:: with SMTP id s13mr5391720lfc.243.1631819999752; Thu, 16 Sep 2021 12:19:59 -0700 (PDT) MIME-Version: 1.0 References: <20210910130337.2025426-1-osk@google.com> <71c17c47-ca9e-e9d2-7b89-cc25b512c06a@roeck-us.net> <722b27f6-4390-9b5b-f6f2-75ce9e967d12@roeck-us.net> <20210914150859.GB3457579@roeck-us.net> In-Reply-To: From: Oskar Senft Date: Thu, 16 Sep 2021 15:19:42 -0400 Message-ID: Subject: Re: [PATCH] dt-bindings: hwmon: Add nct7802 bindings To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jean Delvare , Rob Herring Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Guenter > > Would it be acceptable to simply number the sensors and document which > > sensor has which number? > > > > Something like this: > > 0 = LTD > > 1 = RTD1 > > ... > > > That might be a possibility, though it would have to be well defined > for each chip (nct7802 also has voltage sensors). We'll have to discuss > this with Rob. > > Personally I think I would prefer using a type qualifier - that seems > cleaner. But that is really a matter of opinion. Another existing way I found is in ltc2978. Following that, we could do it as follows: i2c { #address-cells = <1>; #size-cells = <0>; nct7802@28 { compatible = "nuvoton,nct7802"; reg = <0x28>; #address-cells = <1>; #size-cells = <0>; sensors { ltd { status = "okay"; label = "my local temperature"; }; rtd1 { status = "okay"; mode = <0x2>; /* 3904 transistor */ label = "other temperature"; }; rtd3 { status = "okay"; mode = <0x3>; /* thermal diode */ label = "3rd temperature"; }; }; }; }; > > The NCT7802Y can self-program from an EEPROM, so I assume we should > > honor the "power-up configuration" obtained from there? I.e. if no > > configuration is provided in the device tree, the driver should use > > whatever configuration the chip has when the driver is loaded. > > > Definitely yes. My question was more what to do if the information > in devicetree nodes is incomplete. I think there are two cases: 1) If the new "sensor" tree is missing, the driver should behave as it does today to not break existing users. 2) If the new "sensor" tree is present, then each of the sensors that should be disabled needs to have "status = 'okay'" and have the mode set (unless it's LTD). In the above example, rtd2 is missing and would therefore be considered disabled. Does that make sense? I still need to find out whether this is actually valid DT and how to express that in the YAML, though ... Thanks Oskar.