Message ID | 89fb5eec30df734ee8fc58427cf5d94929076514.1702874115.git.alkuor@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-2999-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1030685dyi; Sun, 17 Dec 2023 20:54:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoiqEljf9bl1WjDpBYElAzSFac+9x++italQCnneFc80Av7RNkoBiZxRAl50dKuyP5hL4G X-Received: by 2002:a05:622a:450:b0:425:4043:50b9 with SMTP id o16-20020a05622a045000b00425404350b9mr22897614qtx.72.1702875253160; Sun, 17 Dec 2023 20:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702875253; cv=none; d=google.com; s=arc-20160816; b=0dx+rJYVXh1pgAKYI5CDA8fhY2QtlG0ocduR+u9FRl5Ro/hX5QUrafBLO+k6i3FG2+ 38jwXA0Leipytz8gTVqx9mztzb6rsl2ERx4m3QkW7s4DUNquTkAdE9TmuPK2RFQDgaFx /ATRlugI3ICrkRaAXOYvu7rAexwPkPNJ8YXtjBaMg1DC1WXboDcFnBQO0gt+KPsf7m4K xtU82xhpOCPDVNl29xhIdIccORwUS9cOkQ0wP+vWXww6XYZ9Q6Z9x6SfNYQeRhPhBbHF eFWhv1RqGoC+rbNijy/GfJaH9BiMB/xhpMfSwQQCdnzB8VvRL6N+Le0L2g4aTAEessfQ kSaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=VaTyomZwxtPir8w34v7twVd3Xf9J4c1d0y7WayfPqp4=; fh=9o+JoOK9fX3PtYbRvZH3DuHAPcrjBZ/qjPiZjpXXXoI=; b=muohTcLNOBtihUxEbeG4orN80FhM2mH349k+soaqTK/WF/ylijIcpQM+X4+SzsckiN CcAezuRak5HHnAB1DYNwVbkW/uPY9KWOa18Kqzwnel85fUu2RjBhP3zkmKdCZzJMyQpp XD/6AultTJRow/gF0dFNYQT3Ba3jtFy0QUmOIbIWr3WG8/yD7c0e2JPMPo9/UaVII/0m YruaFzq6A4df9E8ekf9UXJUX5tiqHRPy9cTu+EWAZBwsKNLCBDWr5fFJIcDi/aoulg8u v0lz2zmj3WLMiJJb1NaACTr4g7JhTT3/NG71aHfx0HRecGEi4unQgmj7yT5fq1uWbh3X reCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XiHBXoWc; spf=pass (google.com: domain of linux-kernel+bounces-2999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2999-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ay13-20020a05622a228d00b00423a2fd5d36si24059619qtb.789.2023.12.17.20.54.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 20:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XiHBXoWc; spf=pass (google.com: domain of linux-kernel+bounces-2999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2999-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E0D8E1C21070 for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 04:54:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A9086FCF; Mon, 18 Dec 2023 04:53:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XiHBXoWc" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5399E63A8; Mon, 18 Dec 2023 04:53:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-4260b657ed5so27341821cf.0; Sun, 17 Dec 2023 20:53:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702875211; x=1703480011; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VaTyomZwxtPir8w34v7twVd3Xf9J4c1d0y7WayfPqp4=; b=XiHBXoWcyb5khBc+o+EWX/b9MrYLY48yDetaQ7IbYDolPHbBQ+T0K5B7pYPWIsAm8g tBnQInDFWwOzkU0B6l6UVUMCWwnsBzPYvM/zwp+J2A+dH3kAFSfhyfZ4ib8WaX27az1p 114RZEJVnx0UTMI2b8e2fY7NDmM3Cyx1AtD0nvhoIB+qd3xnDEG+8hOKEdGMWOc0tqCf H89N3VEA1t/WqAYYhnBTnNzNZdNenFfrwPRx/HUuY5HSOQyHUv7fg3P5lOZRQ9e42R52 eRo1C8A/4LwkACyhyCP5zRzg/AZ6iIhrfnf57L7yC5zSDvLu67YURlcZj1We1Knui0Dn GpeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702875211; x=1703480011; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VaTyomZwxtPir8w34v7twVd3Xf9J4c1d0y7WayfPqp4=; b=IyCpPiv8t4nmx+53hD4i0AHWTJDVP20nO8Wle3VIB9PTziC8tdXohL4CkCdNlFagHi PNwXNdKV6TGr1h+klOOijobqMqOevZvJH+X2McokFpThU7ZexRlx7zlzbocgYsj2WkCN jEY/QYR/0xGvn+S4fJV9RXzyCGDVtPfk8L4jYAa+Ctfu3jKergUYlirKkG2Sdp+1yAwY Igx8ubsazqSgNXeSYoIxWagB8W7wtsCSZsq7Q9JbaVcJaBK01JGX30nd5BIVYrJWTAPk 7O7bqtUWyEd3OOzVPtJPU8Z5QfcGkSR1Dt92YyA4IGcAClj2qiKtce+xs5fiKOMO+oMV 76uw== X-Gm-Message-State: AOJu0Yz8DJnVAq03mrEKMSy4ElMtz3l6nc7Neh8eYdBVi9Fav1+/gbqd wLv0ahRmITIXHNu9xt+XFoc= X-Received: by 2002:ac8:5a43:0:b0:425:4043:50e9 with SMTP id o3-20020ac85a43000000b00425404350e9mr21054133qta.120.1702875211144; Sun, 17 Dec 2023 20:53:31 -0800 (PST) Received: from localhost.localdomain ([174.95.13.129]) by smtp.gmail.com with ESMTPSA id fv5-20020a05622a4a0500b004275e9cdf15sm716571qtb.11.2023.12.17.20.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 20:53:30 -0800 (PST) From: Abdel Alkuor <alkuor@gmail.com> To: 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> Cc: Abdel Alkuor <alkuor@gmail.com>, 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: (lm75) Add AMS AS6200 temperature sensor Date: Sun, 17 Dec 2023 23:52:27 -0500 Message-Id: <89fb5eec30df734ee8fc58427cf5d94929076514.1702874115.git.alkuor@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785594121241507414 X-GMAIL-MSGID: 1785594121241507414 |
Series |
[v2,1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
|
|
Commit Message
Abdel Alkuor
Dec. 18, 2023, 4:52 a.m. UTC
as6200 is a temperature sensor with a range between -40°C to
125°C degrees and an accuracy of ±0.4°C degree between 0
and 65°C and ±1°C for the other ranges.
Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
---
Changes in v2:
- Incorporate as6200 into lm75 bindings
.../devicetree/bindings/hwmon/lm75.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
Comments
On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote: > as6200 is a temperature sensor with a range between -40°C to > 125°C degrees and an accuracy of ±0.4°C degree between 0 > and 65°C and ±1°C for the other ranges. > > Signed-off-by: Abdel Alkuor <alkuor@gmail.com> > --- > Changes in v2: > - Incorporate as6200 into lm75 bindings > > .../devicetree/bindings/hwmon/lm75.yaml | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml > index 0b69897f0c63..63b85a83ac18 100644 > --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml > +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml > @@ -14,6 +14,7 @@ properties: > compatible: > enum: > - adi,adt75 > + - ams,as6200 > - atmel,at30ts74 > - dallas,ds1775 > - dallas,ds75 > @@ -48,6 +49,9 @@ properties: > vs-supply: > description: phandle to the regulator that provides the +VS supply > > + interrupts: > + maxItems: 1 Do the other devices here have interrupts? If not, you just allowed interrupts for them. You, at the very least, need to add something like: diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml index 63b85a83ac18..d7ce96606400 100644 --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml @@ -56,6 +56,17 @@ required: - compatible - reg +allOf: + - if: + not: + properties: + compatible: + contains: + const: ams,as6200 + then: + properties: + interrupts: false + additionalProperties: false examples: I had a brief look at the driver though, but I could not immediately tell if the interrupt was required on the ams,as6200 or if the driver continued on without that functionality. It seemed like an additional feature that the interrupt was required for, but if not you should make the interrupt required for the as6200. > + > required: > - compatible > - reg > @@ -66,3 +70,17 @@ examples: > vs-supply = <&vs>; > }; > }; > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + temperature-sensor@48 { > + compatible = "ams,as6200"; > + reg = <0x48>; > + vs-supply = <&vs>; > + interrupt-parent = <&gpio1>; > + interrupts = <17 IRQ_TYPE_EDGE_BOTH>; > + }; > + }; Can you make the indent here match that in the other example in this file please? Thanks, Conor.
On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote: > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote: > > Do the other devices here have interrupts? If not, you just allowed > interrupts for them. You, at the very least, need to add something like: > diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml > index 63b85a83ac18..d7ce96606400 100644 > --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml > +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml > @@ -56,6 +56,17 @@ required: > - compatible > - reg > > +allOf: > + - if: > + not: > + properties: > + compatible: > + contains: > + const: ams,as6200 > + then: > + properties: > + interrupts: false > + > additionalProperties: false > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200. For now, I'll add the check for ams,as6200. > examples: > > I had a brief look at the driver though, but I could not immediately > tell if the interrupt was required on the ams,as6200 or if the driver > continued on without that functionality. It seemed like an additional > feature that the interrupt was required for, but if not you should make > the interrupt required for the as6200. > It is an additional feature. The interrupt basically notifies the user space when the alarm state changes through temp1_alarm sysfs using poll on the file for example. That being said, we should still be able to read the alarm state for as6200 without the interrupt present. > > + > > required: > > - compatible > > - reg > > @@ -66,3 +70,17 @@ examples: > > vs-supply = <&vs>; > > }; > > }; > > + - | > > + #include <dt-bindings/interrupt-controller/irq.h> > > + i2c { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + temperature-sensor@48 { > > + compatible = "ams,as6200"; > > + reg = <0x48>; > > + vs-supply = <&vs>; > > + interrupt-parent = <&gpio1>; > > + interrupts = <17 IRQ_TYPE_EDGE_BOTH>; > > + }; > > + }; > > Can you make the indent here match that in the other example in this > file please? Sure. Thanks, Abdel
On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote: > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote: > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote: > > > > Do the other devices here have interrupts? If not, you just allowed > > interrupts for them. You, at the very least, need to add something like: > > diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml > > index 63b85a83ac18..d7ce96606400 100644 > > --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml > > +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml > > @@ -56,6 +56,17 @@ required: > > - compatible > > - reg > > > > +allOf: > > + - if: > > + not: > > + properties: > > + compatible: > > + contains: > > + const: ams,as6200 > > + then: > > + properties: > > + interrupts: false > > + > > additionalProperties: false > > > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200. > For now, I'll add the check for ams,as6200. If multiple devices have the interrupt you should document it for all of them IMO.
On Wed, Dec 20, 2023 at 04:25:15PM +0000, Conor Dooley wrote: > On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote: > > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote: > > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote: > > > > > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200. > > For now, I'll add the check for ams,as6200. > Hi Conor, > If multiple devices have the interrupt you should document it for all of > them IMO. The interrupt hasn't been implemented for tmp101, tmp102 and tmp112 yet. Should I still add them to the interrupt property? They might be two different things driver and bindings, but I just wanted to make sure. Thanks, Abdel
On Wed, Dec 20, 2023 at 12:05:17PM -0500, Abdel Alkuor wrote: > On Wed, Dec 20, 2023 at 04:25:15PM +0000, Conor Dooley wrote: > > On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote: > > > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote: > > > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote: > > > > > > > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200. > > > For now, I'll add the check for ams,as6200. > > > Hi Conor, > > If multiple devices have the interrupt you should document it for all of > > them IMO. > > The interrupt hasn't been implemented for tmp101, tmp102 and tmp112 yet. > Should I still add them to the interrupt property? They might be two different > things driver and bindings, but I just wanted to make sure. I don't really care if the driver supports the interrupt on any of the platforms (including the as6200), if the hardware has an interrupt the binding should reflect that :)
On Wed, Dec 20, 2023 at 05:16:08PM +0000, Conor Dooley wrote: > On Wed, Dec 20, 2023 at 12:05:17PM -0500, Abdel Alkuor wrote: > > On Wed, Dec 20, 2023 at 04:25:15PM +0000, Conor Dooley wrote: > > > On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote: > > > > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote: > > > > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote: > > > > > > > > > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200. > > > > For now, I'll add the check for ams,as6200. > > > > > Hi Conor, > > > If multiple devices have the interrupt you should document it for all of > > > them IMO. > > > > The interrupt hasn't been implemented for tmp101, tmp102 and tmp112 yet. > > Should I still add them to the interrupt property? They might be two different > > things driver and bindings, but I just wanted to make sure. > > I don't really care if the driver supports the interrupt on any of the > platforms (including the as6200), if the hardware has an interrupt the > binding should reflect that :) Understood. I'll add them in v4. Abdel
diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml index 0b69897f0c63..63b85a83ac18 100644 --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml @@ -14,6 +14,7 @@ properties: compatible: enum: - adi,adt75 + - ams,as6200 - atmel,at30ts74 - dallas,ds1775 - dallas,ds75 @@ -48,6 +49,9 @@ properties: vs-supply: description: phandle to the regulator that provides the +VS supply + interrupts: + maxItems: 1 + required: - compatible - reg @@ -66,3 +70,17 @@ examples: vs-supply = <&vs>; }; }; + - | + #include <dt-bindings/interrupt-controller/irq.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + temperature-sensor@48 { + compatible = "ams,as6200"; + reg = <0x48>; + vs-supply = <&vs>; + interrupt-parent = <&gpio1>; + interrupts = <17 IRQ_TYPE_EDGE_BOTH>; + }; + };