Message ID | 20231002101835.39624-1-antoniu.miclaus@analog.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1328352vqb; Mon, 2 Oct 2023 03:31:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQtsOEmmz3ZGb5w1FLt30+nfEnvKCnrIXzam2KBlY0ImG/0dYJGYStDRznaYEZY0Hjv1sK X-Received: by 2002:a17:902:c40a:b0:1c7:47ca:f07f with SMTP id k10-20020a170902c40a00b001c747caf07fmr7686292plk.21.1696242697208; Mon, 02 Oct 2023 03:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696242697; cv=none; d=google.com; s=arc-20160816; b=kMfk6cP6rNHLIypjzLzA5emjFoxm2/bxBs63h2R0FImx90gqAhUII5Q5v+nHnI4NKo +Zh0OQBMso1y5a2QnPXNE81EdPEjJvuKpy8RmXediWwk4nZWGoxgO7+SBsHh5eHX95dU OEWV5uAhCDRHudl12pKdMGQe4dM4wPOQiLHU2+KMdQ0y++rskmgWnWtYUB73ssjpCFFt hcKfQt5otNcP5h1u1rBvNMM8sOTSrfyevDhA2N/gTwMfV2gw0L3YhcDaOvSJprkJeUEY 0tJUMxZLTVFZPYlOnaG9798ctVO3Im/wgM56CRrCpNOmSvInP7/iIt2yzJ74n8kCSeW8 9Bpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=hebIqm0XJ7CTzUZJkLeXxNqKnML8pzvgKokpNPgOKWQ=; fh=luN+bfnxpYJEtmmenHwCt0YgGSfeMZPKBPMCy6zCnko=; b=oA4CHfjUa5l+Brjn/+0MeIj/s5VcfoBcJ5YlRUaFpPQz76puRLGx/h40ShVFiLbiPO 5pKyfFgskmJv4Z09Fd2Fu8JPnFCeitkTY41p1LFpKh29nhSdcJSfXyKkeijSgiWZy7W9 0xKr3yR9rElRI8aZLUl7MmOYE/IPvk7jzdf0w/y3wZZzY0ifkelu+EXSD1M3XJWi12ca /+t1GV0vr9GWSX1gKLmKAGwGSqV9R87ce6L9f5VP3RIW8c3Vz083RMwf5SDcCrQLhqCK IF5JGhWgg5P4jI01eeaMqmjH76BH8kwzcizue13K9HP7WCrc4jqvHjw4qVG/Ri/osudy 2F/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q7-20020a170902dac700b001c44c0f8d96si22391354plx.251.2023.10.02.03.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 03:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C1D75804DD83; Mon, 2 Oct 2023 03:19:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236404AbjJBKTe (ORCPT <rfc822;pwkd43@gmail.com> + 16 others); Mon, 2 Oct 2023 06:19:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236366AbjJBKTb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 2 Oct 2023 06:19:31 -0400 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C284FB0; Mon, 2 Oct 2023 03:19:28 -0700 (PDT) Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3927iLD8026586; Mon, 2 Oct 2023 06:19:02 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3tf0tf69tm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Oct 2023 06:19:02 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 392AJ04P059434 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 2 Oct 2023 06:19:00 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Mon, 2 Oct 2023 06:18:59 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Mon, 2 Oct 2023 06:18:59 -0400 Received: from amiclaus-VirtualBox.ad.analog.com (AMICLAUS-L02.ad.analog.com [10.48.65.194]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 392AIk8G001378; Mon, 2 Oct 2023 06:18:49 -0400 From: Antoniu Miclaus <antoniu.miclaus@analog.com> To: Antoniu Miclaus <antoniu.miclaus@analog.com>, Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Jonathan Corbet <corbet@lwn.net>, <linux-hwmon@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org> Subject: [PATCH v2 1/2] dt-bindings: hwmon: ltc2991: add bindings Date: Mon, 2 Oct 2023 13:18:14 +0300 Message-ID: <20231002101835.39624-1-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: pGbmJk5q5RC2OGC3CG4wuNMU-ko32tVH X-Proofpoint-ORIG-GUID: pGbmJk5q5RC2OGC3CG4wuNMU-ko32tVH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-02_03,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 bulkscore=0 phishscore=0 clxscore=1015 adultscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2309180000 definitions=main-2310020076 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 03:19:38 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778639382104100224 X-GMAIL-MSGID: 1778639382104100224 |
Series |
[v2,1/2] dt-bindings: hwmon: ltc2991: add bindings
|
|
Commit Message
Antoniu Miclaus
Oct. 2, 2023, 10:18 a.m. UTC
Add dt-bindings for ltc2991 octal i2c voltage, current and temperature
monitor.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
changes in v2:
- make compatible const type
- remove `|` where not necessary
- switch to micro-ohms for the shunt resistor property
- add vendor prefix for temperature-enable
.../bindings/hwmon/adi,ltc2991.yaml | 114 ++++++++++++++++++
1 file changed, 114 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml
Comments
Hey, On Mon, Oct 02, 2023 at 01:18:14PM +0300, Antoniu Miclaus wrote: > Add dt-bindings for ltc2991 octal i2c voltage, current and temperature > monitor. > > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> > --- > changes in v2: > - make compatible const type > - remove `|` where not necessary > - switch to micro-ohms for the shunt resistor property > - add vendor prefix for temperature-enable Thanks for the updates... > .../bindings/hwmon/adi,ltc2991.yaml | 114 ++++++++++++++++++ > 1 file changed, 114 insertions(+) > create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > new file mode 100644 > index 000000000000..3811ea07a04f > --- /dev/null > +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > @@ -0,0 +1,114 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > + > +$id: http://devicetree.org/schemas/hwmon/adi,ltc2991.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices LTC2991 Octal I2C Voltage, Current and Temperature Monitor > + > +maintainers: > + - Antoniu Miclaus <antoniu.miclaus@analog.com> > + > +description: | > + The LTC2991 is used to monitor system temperatures, voltages and currents. > + Through the I2C serial interface, the eight monitors can individually measure > + supply voltages and can be paired for differential measurements of current > + sense resistors or temperature sensing transistors. > + > + Datasheet: > + https://www.analog.com/en/products/ltc2991.html > + > +properties: > + compatible: > + const: adi,ltc2991 > + > + reg: > + maxItems: 1 > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + vcc-supply: true > + > +patternProperties: > + "^channel@[0-3]$": > + type: object > + description: > + Represents the differential/temperature channels. > + > + properties: > + reg: > + description: > + The channel number. LTC2991 can monitor 4 currents/temperatures. > + items: > + minimum: 0 > + maximum: 3 > + > + shunt-resistor-micro-ohms: > + description: > + The value of curent sense resistor in miliohms. Enables differential > + input pair. > + > + adi,temperature-enable: > + description: > + Enables temperature readings for a input pair. > + type: boolean ...but I did not see an answer to my question on v1: TBH, this seems like it is used just to control software behaviour. Why would you want to actually disable this in DT? In other words, is there something in that hardware that precludes measuring temperature for channels that do not contain this property? Thanks, Conor. > + > +required: > + - compatible > + - reg > + - vcc-supply > + > +additionalProperties: false > + > +examples: > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + hwmon@48 { > + compatible = "adi,ltc2991"; > + reg = <0x48>; > + vcc-supply = <&vcc>; > + }; > + }; > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + hwmon@48 { > + #address-cells = <1>; > + #size-cells = <0>; > + > + compatible = "adi,ltc2991"; > + reg = <0x48>; > + vcc-supply = <&vcc>; > + > + channel@0 { > + reg = <0x0>; > + shunt-resistor-micro-ohms = <100000>; > + }; > + > + channel@1 { > + reg = <0x1>; > + shunt-resistor-micro-ohms = <100000>; > + }; > + > + channel@2 { > + reg = <0x2>; > + temperature-enable; > + }; > + > + channel@3 { > + reg = <0x3>; > + temperature-enable; > + }; > + }; > + }; > +... > -- > 2.42.0 >
-- Antoniu Miclăuş > -----Original Message----- > From: Conor Dooley <conor@kernel.org> > Sent: Monday, October 2, 2023 4:01 PM > To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com> > Cc: Jean Delvare <jdelvare@suse.com>; Guenter Roeck <linux@roeck- > us.net>; Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski > <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley > <conor+dt@kernel.org>; Jonathan Corbet <corbet@lwn.net>; linux- > hwmon@vger.kernel.org; devicetree@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-doc@vger.kernel.org > Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: ltc2991: add bindings > > [External] > > Hey, > > On Mon, Oct 02, 2023 at 01:18:14PM +0300, Antoniu Miclaus wrote: > > Add dt-bindings for ltc2991 octal i2c voltage, current and temperature > > monitor. > > > > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> > > --- > > changes in v2: > > - make compatible const type > > - remove `|` where not necessary > > - switch to micro-ohms for the shunt resistor property > > - add vendor prefix for temperature-enable > > Thanks for the updates... > > > .../bindings/hwmon/adi,ltc2991.yaml | 114 ++++++++++++++++++ > > 1 file changed, 114 insertions(+) > > create mode 100644 > Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > > diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > new file mode 100644 > > index 000000000000..3811ea07a04f > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > @@ -0,0 +1,114 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > + > > +$id: http://devicetree.org/schemas/hwmon/adi,ltc2991.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Analog Devices LTC2991 Octal I2C Voltage, Current and Temperature > Monitor > > + > > +maintainers: > > + - Antoniu Miclaus <antoniu.miclaus@analog.com> > > + > > +description: | > > + The LTC2991 is used to monitor system temperatures, voltages and > currents. > > + Through the I2C serial interface, the eight monitors can individually > measure > > + supply voltages and can be paired for differential measurements of > current > > + sense resistors or temperature sensing transistors. > > + > > + Datasheet: > > + https://www.analog.com/en/products/ltc2991.html > > + > > +properties: > > + compatible: > > + const: adi,ltc2991 > > + > > + reg: > > + maxItems: 1 > > + > > + '#address-cells': > > + const: 1 > > + > > + '#size-cells': > > + const: 0 > > + > > + vcc-supply: true > > + > > +patternProperties: > > + "^channel@[0-3]$": > > + type: object > > + description: > > + Represents the differential/temperature channels. > > + > > + properties: > > + reg: > > + description: > > + The channel number. LTC2991 can monitor 4 currents/temperatures. > > + items: > > + minimum: 0 > > + maximum: 3 > > + > > + shunt-resistor-micro-ohms: > > + description: > > + The value of curent sense resistor in miliohms. Enables differential > > + input pair. > > + > > + adi,temperature-enable: > > + description: > > + Enables temperature readings for a input pair. > > + type: boolean > > ...but I did not see an answer to my question on v1: > TBH, this seems like it is used just to control software behaviour. > Why would you want to actually disable this in DT? > In other words, is there something in that hardware that precludes > measuring temperature for channels that do not contain this property? > > Thanks, > Conor. > Sorry for missing that. I took in consideration this approach based on the pin functions described in the datasheet (page 8 of 32). For example the V1 pin of the part can support 3 different configurations: "V1 (Pin 1): First Monitor Input. This pin can be configured as a single-ended input (0V to 4.9V) or the positive inputfor a differential or remote diode temperature measurement (in combination with V2)." Moreover, looking at the multiple typical applications examples at the end of the datasheet there is a specific adjacent hardware circuit connected to this part for the temperature measurements configurations. Thank you, Antoniu > > + > > +required: > > + - compatible > > + - reg > > + - vcc-supply > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + i2c { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + hwmon@48 { > > + compatible = "adi,ltc2991"; > > + reg = <0x48>; > > + vcc-supply = <&vcc>; > > + }; > > + }; > > + - | > > + i2c { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + hwmon@48 { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + compatible = "adi,ltc2991"; > > + reg = <0x48>; > > + vcc-supply = <&vcc>; > > + > > + channel@0 { > > + reg = <0x0>; > > + shunt-resistor-micro-ohms = <100000>; > > + }; > > + > > + channel@1 { > > + reg = <0x1>; > > + shunt-resistor-micro-ohms = <100000>; > > + }; > > + > > + channel@2 { > > + reg = <0x2>; > > + temperature-enable; > > + }; > > + > > + channel@3 { > > + reg = <0x3>; > > + temperature-enable; > > + }; > > + }; > > + }; > > +... > > -- > > 2.42.0 > >
On Mon, Oct 02, 2023 at 01:46:53PM +0000, Miclaus, Antoniu wrote: > > > -- > Antoniu Miclăuş > > > -----Original Message----- > > From: Conor Dooley <conor@kernel.org> > > Sent: Monday, October 2, 2023 4:01 PM > > To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com> > > Cc: Jean Delvare <jdelvare@suse.com>; Guenter Roeck <linux@roeck- > > us.net>; Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski > > <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley > > <conor+dt@kernel.org>; Jonathan Corbet <corbet@lwn.net>; linux- > > hwmon@vger.kernel.org; devicetree@vger.kernel.org; linux- > > kernel@vger.kernel.org; linux-doc@vger.kernel.org > > Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: ltc2991: add bindings > > > > [External] > > > > Hey, > > > > On Mon, Oct 02, 2023 at 01:18:14PM +0300, Antoniu Miclaus wrote: > > > Add dt-bindings for ltc2991 octal i2c voltage, current and temperature > > > monitor. > > > > > > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> > > > --- > > > changes in v2: > > > - make compatible const type > > > - remove `|` where not necessary > > > - switch to micro-ohms for the shunt resistor property > > > - add vendor prefix for temperature-enable > > > > Thanks for the updates... > > > > > .../bindings/hwmon/adi,ltc2991.yaml | 114 ++++++++++++++++++ > > > 1 file changed, 114 insertions(+) > > > create mode 100644 > > Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > new file mode 100644 > > > index 000000000000..3811ea07a04f > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > @@ -0,0 +1,114 @@ > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > + > > > +$id: http://devicetree.org/schemas/hwmon/adi,ltc2991.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Analog Devices LTC2991 Octal I2C Voltage, Current and Temperature > > Monitor > > > + > > > +maintainers: > > > + - Antoniu Miclaus <antoniu.miclaus@analog.com> > > > + > > > +description: | > > > + The LTC2991 is used to monitor system temperatures, voltages and > > currents. > > > + Through the I2C serial interface, the eight monitors can individually > > measure > > > + supply voltages and can be paired for differential measurements of > > current > > > + sense resistors or temperature sensing transistors. > > > + > > > + Datasheet: > > > + https://www.analog.com/en/products/ltc2991.html > > > + > > > +properties: > > > + compatible: > > > + const: adi,ltc2991 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > + vcc-supply: true > > > + > > > +patternProperties: > > > + "^channel@[0-3]$": > > > + type: object > > > + description: > > > + Represents the differential/temperature channels. > > > + > > > + properties: > > > + reg: > > > + description: > > > + The channel number. LTC2991 can monitor 4 currents/temperatures. > > > + items: > > > + minimum: 0 > > > + maximum: 3 > > > + > > > + shunt-resistor-micro-ohms: > > > + description: > > > + The value of curent sense resistor in miliohms. Enables differential > > > + input pair. > > > + > > > + adi,temperature-enable: > > > + description: > > > + Enables temperature readings for a input pair. > > > + type: boolean > > > > ...but I did not see an answer to my question on v1: > > TBH, this seems like it is used just to control software behaviour. > > Why would you want to actually disable this in DT? > > In other words, is there something in that hardware that precludes > > measuring temperature for channels that do not contain this property? > > > > Thanks, > > Conor. > > > Sorry for missing that. I took in consideration this approach based on the pin functions > described in the datasheet (page 8 of 32). For example the V1 pin of the part can support > 3 different configurations: "V1 (Pin 1): First Monitor Input. This pin can be configured > as a single-ended input (0V to 4.9V) or the positive inputfor a differential or remote diode > temperature measurement (in combination with V2)." > Moreover, looking at the multiple typical applications examples at the end of the datasheet > there is a specific adjacent hardware circuit connected to this part for the temperature > measurements configurations. Makes sense. Please expand the description with some of this detail so the purpose is clear. The description should answer when do I set this property or not. Rob
On Mon, Oct 02, 2023 at 01:46:53PM +0000, Miclaus, Antoniu wrote: > > > -- > Antoniu Miclăuş > > > -----Original Message----- > > From: Conor Dooley <conor@kernel.org> > > Sent: Monday, October 2, 2023 4:01 PM > > To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com> > > Cc: Jean Delvare <jdelvare@suse.com>; Guenter Roeck <linux@roeck- > > us.net>; Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski > > <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley > > <conor+dt@kernel.org>; Jonathan Corbet <corbet@lwn.net>; linux- > > hwmon@vger.kernel.org; devicetree@vger.kernel.org; linux- > > kernel@vger.kernel.org; linux-doc@vger.kernel.org > > Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: ltc2991: add bindings > > > > [External] > > > > Hey, > > > > On Mon, Oct 02, 2023 at 01:18:14PM +0300, Antoniu Miclaus wrote: > > > Add dt-bindings for ltc2991 octal i2c voltage, current and temperature > > > monitor. > > > > > > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> > > > --- > > > changes in v2: > > > - make compatible const type > > > - remove `|` where not necessary > > > - switch to micro-ohms for the shunt resistor property > > > - add vendor prefix for temperature-enable > > > > Thanks for the updates... > > > > > .../bindings/hwmon/adi,ltc2991.yaml | 114 ++++++++++++++++++ > > > 1 file changed, 114 insertions(+) > > > create mode 100644 > > Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > new file mode 100644 > > > index 000000000000..3811ea07a04f > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml > > > @@ -0,0 +1,114 @@ > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > + > > > +$id: http://devicetree.org/schemas/hwmon/adi,ltc2991.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Analog Devices LTC2991 Octal I2C Voltage, Current and Temperature > > Monitor > > > + > > > +maintainers: > > > + - Antoniu Miclaus <antoniu.miclaus@analog.com> > > > + > > > +description: | > > > + The LTC2991 is used to monitor system temperatures, voltages and > > currents. > > > + Through the I2C serial interface, the eight monitors can individually > > measure > > > + supply voltages and can be paired for differential measurements of > > current > > > + sense resistors or temperature sensing transistors. > > > + > > > + Datasheet: > > > + https://www.analog.com/en/products/ltc2991.html > > > + > > > +properties: > > > + compatible: > > > + const: adi,ltc2991 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > + vcc-supply: true > > > + > > > +patternProperties: > > > + "^channel@[0-3]$": > > > + type: object > > > + description: > > > + Represents the differential/temperature channels. Missing "additionalProperties: false". Once added, it finds that you didn't update the child nodes to account for the addition of the vendor prefix. > > > + > > > + properties: > > > + reg: > > > + description: > > > + The channel number. LTC2991 can monitor 4 currents/temperatures. > > > + items: > > > + minimum: 0 > > > + maximum: 3 Should reg not be required here? > > > + > > > + shunt-resistor-micro-ohms: > > > + description: > > > + The value of curent sense resistor in miliohms. Enables differential > > > + input pair. > > > + > > > + adi,temperature-enable: > > > + description: > > > + Enables temperature readings for a input pair. > > > + type: boolean > > > > ...but I did not see an answer to my question on v1: > > TBH, this seems like it is used just to control software behaviour. > > Why would you want to actually disable this in DT? > > In other words, is there something in that hardware that precludes > > measuring temperature for channels that do not contain this property? > > > > Thanks, > > Conor. > > > Sorry for missing that. I took in consideration this approach based on the pin functions > described in the datasheet (page 8 of 32). For example the V1 pin of the part can support > 3 different configurations: "V1 (Pin 1): First Monitor Input. This pin can be configured > as a single-ended input (0V to 4.9V) or the positive inputfor a differential or remote diode > temperature measurement (in combination with V2)." > Moreover, looking at the multiple typical applications examples at the end of the datasheet > there is a specific adjacent hardware circuit connected to this part for the temperature > measurements configurations. Okay. That seems fair to me, thanks for the explanation. From your description here it sounds like the pins between which differential measurements are made are fixed in hardware. Is that correct? One final question - from your description here it sounds like shunt-resistor-micro-ohms & adi,temperature-enable are mutually exclusive? If they are indeed mutually exclusive, you can fold in something like the below. diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml index 3811ea07a04f..8b1bbbfe7948 100644 --- a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml @@ -39,6 +39,7 @@ patternProperties: type: object description: Represents the differential/temperature channels. + additionalProperties: false properties: reg: @@ -58,6 +59,17 @@ patternProperties: Enables temperature readings for a input pair. type: boolean + required: + - reg + + allOf: + - if: + required: + - shunt-resistor-micro-ohms + then: + properties: + adi,temperature-enable: false + required: - compatible - reg Cheers, Conor. > > Thank you, > Antoniu > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - vcc-supply > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + i2c { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + hwmon@48 { > > > + compatible = "adi,ltc2991"; > > > + reg = <0x48>; > > > + vcc-supply = <&vcc>; > > > + }; > > > + }; > > > + - | > > > + i2c { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + hwmon@48 { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + compatible = "adi,ltc2991"; > > > + reg = <0x48>; > > > + vcc-supply = <&vcc>; > > > + > > > + channel@0 { > > > + reg = <0x0>; > > > + shunt-resistor-micro-ohms = <100000>; > > > + }; > > > + > > > + channel@1 { > > > + reg = <0x1>; > > > + shunt-resistor-micro-ohms = <100000>; > > > + }; > > > + > > > + channel@2 { > > > + reg = <0x2>; > > > + temperature-enable; > > > + }; > > > + > > > + channel@3 { > > > + reg = <0x3>; > > > + temperature-enable; > > > + }; > > > + }; > > > + }; > > > +... > > > -- > > > 2.42.0 > > >
diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml new file mode 100644 index 000000000000..3811ea07a04f --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml @@ -0,0 +1,114 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/hwmon/adi,ltc2991.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices LTC2991 Octal I2C Voltage, Current and Temperature Monitor + +maintainers: + - Antoniu Miclaus <antoniu.miclaus@analog.com> + +description: | + The LTC2991 is used to monitor system temperatures, voltages and currents. + Through the I2C serial interface, the eight monitors can individually measure + supply voltages and can be paired for differential measurements of current + sense resistors or temperature sensing transistors. + + Datasheet: + https://www.analog.com/en/products/ltc2991.html + +properties: + compatible: + const: adi,ltc2991 + + reg: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + vcc-supply: true + +patternProperties: + "^channel@[0-3]$": + type: object + description: + Represents the differential/temperature channels. + + properties: + reg: + description: + The channel number. LTC2991 can monitor 4 currents/temperatures. + items: + minimum: 0 + maximum: 3 + + shunt-resistor-micro-ohms: + description: + The value of curent sense resistor in miliohms. Enables differential + input pair. + + adi,temperature-enable: + description: + Enables temperature readings for a input pair. + type: boolean + +required: + - compatible + - reg + - vcc-supply + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + hwmon@48 { + compatible = "adi,ltc2991"; + reg = <0x48>; + vcc-supply = <&vcc>; + }; + }; + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + hwmon@48 { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "adi,ltc2991"; + reg = <0x48>; + vcc-supply = <&vcc>; + + channel@0 { + reg = <0x0>; + shunt-resistor-micro-ohms = <100000>; + }; + + channel@1 { + reg = <0x1>; + shunt-resistor-micro-ohms = <100000>; + }; + + channel@2 { + reg = <0x2>; + temperature-enable; + }; + + channel@3 { + reg = <0x3>; + temperature-enable; + }; + }; + }; +...