Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2350359pxb; Fri, 8 Oct 2021 06:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB5VIB+hTeajDjC8yebUydTdyhkIIjw9wyqWIFcARZ5uDHiEUiSDd8MXBSAba6kVZoJg9v X-Received: by 2002:a63:cf44:: with SMTP id b4mr4659115pgj.215.1633698569936; Fri, 08 Oct 2021 06:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633698569; cv=none; d=google.com; s=arc-20160816; b=OS0bFzXZKpGbV/8xs1KfBoS165DYuJXkPVE/jYEWr8GlkiFHkeNg2zXyHFQnxOHYqv Tv9syAIRMUnAtnyxKJBHCz21mp8+144sJhbtFh1uR+Hv5F9rm56RTbCQ+V/sTVckSFpn DeVX+nJaCAIbVhDsiYjwADm7Cz/rTRMwRv8BQaW/PbbUCBKXyWNtO+SPIsKc/DnIo+8z hbp4qu3hwFvTvxIsrU01A/8FulzrQlxuNDBrAgilfPUyXPGnsjF7DmyHvf4JoZ+2fh2t OchQxfvszasQzCs7e1d/MAI7uNsFkrGwJv4PoAi/H2DCSxYxFmCb4IfYCyPKRlB1ipV5 0sqQ== 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=LZ0YuII6022XmWR2aBHQEp9O8Cr/uOmN35lBiBjTAw8=; b=RtHZpP60U2ECrSgCwU3MxnU/cKLm2vP0K6UIXPjtAw2sD9ihdv0MqaU+IDkpo7+9Wv ZJdHtIl1hAwJyqASkJm7i70SiZCzd1yK7hZfhykao8w4ARCNx/5wxIgT81fkGW7lNAb9 o8zTxcT0asLfqBaDMfHSt8LdeLNvfLgIb1hZHNpeTzydG0I7aLaeU/lEpZt+rs5xhR41 yWznx/15xH/DLcaCm19u6Nt84VqYOgAv+q2GS3dKihnsnhccbcTWpq/ELCI5Yqr7nGCr LGaS1+pdhzP+zuZTY1NWmrkqSayrQRC0AInsZHt/fAxnNSc1VzmY+pEgKCsLtRhYU7ha NFaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="dK/SCa/a"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 25si2962695pgu.133.2021.10.08.06.09.13; Fri, 08 Oct 2021 06:09:29 -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=@google.com header.s=20210112 header.b="dK/SCa/a"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbhJHNKE (ORCPT + 99 others); Fri, 8 Oct 2021 09:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbhJHNKC (ORCPT ); Fri, 8 Oct 2021 09:10:02 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 753DCC061755 for ; Fri, 8 Oct 2021 06:08:06 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id i24so37527820lfj.13 for ; Fri, 08 Oct 2021 06:08:06 -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=LZ0YuII6022XmWR2aBHQEp9O8Cr/uOmN35lBiBjTAw8=; b=dK/SCa/aTRq38+aKyRi5kh3z9ROGnCnNdz3PgQDSv3X3O+n1oKs5Jo41UMeWAV9mc8 iPzUj+kl9S3vz42QCyPJr6+m4uXpmb6ucup4mF1r+gWOGXBLKAFKRA5G17GY9v+ZruSg LUQobfv4fZS+YtnY2x7QQEo/IWVSPzlRtrCV084kyJKgCGERCS+arRragIVhGWwHL1Wl deZ3PVY3KPqJHygEszy1+svbHa7XRyeDjBCsDXM80aqgfhDGpoYVLC22FrEmx9f9Jfjr Qq848LfHXuFr6l4Wt4O5YvojGTkCgpvTObjM/deiRP3HgAfA+6+KegPc0yov7XqmdiDD yt3w== 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=LZ0YuII6022XmWR2aBHQEp9O8Cr/uOmN35lBiBjTAw8=; b=O1keywyaPrXM/SfYCbT6mVnq09QvwOk25eH8Yt+C8rGs2Qu89yM6GjDUC4Rc/b7ZvJ IP9OPZk/HfE7PqP8RvedLV/9PgOSBpPLJTQ/OFA8yfUySQZYjYlBDpSNilZp8ZJA2OKQ LRQo8kd/E3K9MjbcRt4DlGHGehkcHBb3n9wdZdN+SnnPpAE3WWiVSvNbBgUjinqLaIaU 1sF5bIUINKF7Rr/XuvueWtyAG0e4OVzJcdP3Rh2VLUP2DsYCSo09LhFdbWC+pr/MkXkT gWVGEJaMjc+EWFjUrFd9NSwnhTJqPdWK9g8uJFWUXvxwZxu/satEvh81StG8FWaW4+tc XfGQ== X-Gm-Message-State: AOAM532Cy4GRRoeny6IQNAkX/P9myo4sygGqVZPrvpkx4P/oWnz+gcC/ 1KfPbREJU/peAURDHUpgdXomqmOpzHBiC8Cf2BsL6w== X-Received: by 2002:a05:651c:1792:: with SMTP id bn18mr3627038ljb.521.1633698483612; Fri, 08 Oct 2021 06:08:03 -0700 (PDT) MIME-Version: 1.0 References: <20210921004627.2786132-1-osk@google.com> In-Reply-To: From: Oskar Senft Date: Fri, 8 Oct 2021 09:07:47 -0400 Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: Add nct7802 bindings To: Rob Herring Cc: Jean Delvare , Guenter Roeck , Linux HWMON List , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob > > > > + temperature-sensors { > > > > + ltd { > > > > + status = "disabled"; > > > > > > Don't show status in examples. > > Hmm, ok. I found it useful to make clear that a sensor can be > > disabled, but maybe that's just always the case? > > Yeah, this case is a bit special. The node not being present also disables it. Oh, I didn't realize that a missing node defaults to "disabled". What I want to achieve is that if a node is not present, we don't configure it. The reason behind this is that the HW provides a mechanism to configure itself at power-up from a connected EEPROM. In that case we'd still want the list the nct7802 in the DTS, but without configuration. This effectively is the current behavior. From what I understand from [1] and follow-ups, having the extra "temperature-sensors" level is actually not what we want here and I proposed a different solution in [2]. On that background, I'm wondering how we could have compatibility with the previous behavior, where the individual sensors were not listed, and just defaulted to whatever the HW came up with, whether that was power-on defaults or loaded from an EEPROM. What the code currently does is to check for the presence of "temperature-sensors" and only attempt to configure any of them if that top level node exists. This enables backwards-compatibility. Going forward, I would have done the same for sensor@X and only explicitly enable / disable the sensor if the node is present. If it's not present, I'd use the power-on / EEPROM-provided defaults. Thanks Oskar. [1] https://lore.kernel.org/linux-hwmon/20210924114636.GB2694238@roeck-us.net/ [2] https://lore.kernel.org/linux-hwmon/CABoTLcQYHZbsgzXN7XXKQdDn8S-YsuE+ks9WShAEKcBJojEfcQ@mail.gmail.com/