From patchwork Tue May 17 07:56:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Brunck X-Patchwork-Id: 12852067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16DDFC433F5 for ; Tue, 17 May 2022 07:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232190AbiEQH5s (ORCPT ); Tue, 17 May 2022 03:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238275AbiEQH5o (ORCPT ); Tue, 17 May 2022 03:57:44 -0400 Received: from inet10.abb.com (spf.hitachienergy.com [138.225.1.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB16837A35 for ; Tue, 17 May 2022 00:57:23 -0700 (PDT) Received: from gitsiv.ch.abb.com (gitsiv.keymile.net [10.41.156.251]) by inet10.abb.com (8.14.7/8.14.7) with SMTP id 24H7udmT011077; Tue, 17 May 2022 09:56:39 +0200 Received: from ch10641.keymile.net.net (ch10641.keymile.net [172.31.40.7]) by gitsiv.ch.abb.com (Postfix) with ESMTP id 27F8265FAB06; Tue, 17 May 2022 09:56:39 +0200 (CEST) From: Holger Brunck To: linux-hwmon@vger.kernel.org Cc: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Holger Brunck Subject: [v3 1/3] dt-bindings: hwmon: lm90: add missing ti,tmp461 Date: Tue, 17 May 2022 09:56:26 +0200 Message-Id: <20220517075626.16809-1-holger.brunck@hitachienergy.com> X-Mailer: git-send-email 2.35.1.871.gab1f276 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org This sensor is already supported from the driver, but is missing in the list of compatible devices in the yaml file. Signed-off-by: Holger Brunck Acked-by: Krzysztof Kozlowski --- changes for v3: - new in this patch serie Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml index 30db92977937..48b7065798b0 100644 --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml @@ -34,6 +34,7 @@ properties: - nxp,sa56004 - onnn,nct1008 - ti,tmp451 + - ti,tmp461 - winbond,w83l771 From patchwork Tue May 17 07:57:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Brunck X-Patchwork-Id: 12852068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D280DC433FE for ; Tue, 17 May 2022 07:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230516AbiEQH5s (ORCPT ); Tue, 17 May 2022 03:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242149AbiEQH5o (ORCPT ); Tue, 17 May 2022 03:57:44 -0400 Received: from inet10.abb.com (inet10.abb.com [138.225.1.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D3638781 for ; Tue, 17 May 2022 00:57:31 -0700 (PDT) Received: from gitsiv.ch.abb.com (gitsiv.keymile.net [10.41.156.251]) by inet10.abb.com (8.14.7/8.14.7) with SMTP id 24H7v53n011137; Tue, 17 May 2022 09:57:05 +0200 Received: from ch10641.keymile.net.net (ch10641.keymile.net [172.31.40.7]) by gitsiv.ch.abb.com (Postfix) with ESMTP id 906F265FAB06; Tue, 17 May 2022 09:57:05 +0200 (CEST) From: Holger Brunck To: linux-hwmon@vger.kernel.org Cc: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Holger Brunck Subject: [v3 2/3] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Date: Tue, 17 May 2022 09:57:03 +0200 Message-Id: <20220517075703.16844-1-holger.brunck@hitachienergy.com> X-Mailer: git-send-email 2.35.1.871.gab1f276 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Some devices can operate in an extended temperature mode. Therefore add a boolean ti,extended-range-enable to be able to select this feature in the device tree node. Also make sure that this feature can only be enabled for the devices supporting this feature. Signed-off-by: Holger Brunck --- changes for v3: - rename property to ti,extended-range-enable - use allOf:if to check if the device supports this feature - rephrase commit msg .../bindings/hwmon/national,lm90.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml index 48b7065798b0..1c39b1b4011b 100644 --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml @@ -53,10 +53,28 @@ properties: vcc-supply: description: phandle to the regulator that provides the +VCC supply + ti,extended-range-enable: + description: Set to enable extended range temperature. + type: boolean + required: - compatible - reg +allOf: + - if: + properties: + compatible: + contains: + enum: + - adi,adt7461 + - adi,adt7461a + - ti,tmp451 + - ti,tmp461 + else: + properties: + ti,extended-range-enable: false + additionalProperties: false examples: From patchwork Tue May 17 07:57:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Brunck X-Patchwork-Id: 12852069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4992BC433F5 for ; Tue, 17 May 2022 07:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232421AbiEQH6D (ORCPT ); Tue, 17 May 2022 03:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238272AbiEQH6C (ORCPT ); Tue, 17 May 2022 03:58:02 -0400 Received: from inet10.abb.com (inet10.abb.com [138.225.1.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4ABD48E53 for ; Tue, 17 May 2022 00:58:00 -0700 (PDT) Received: from gitsiv.ch.abb.com (gitsiv.keymile.net [10.41.156.251]) by inet10.abb.com (8.14.7/8.14.7) with SMTP id 24H7veIR011307; Tue, 17 May 2022 09:57:40 +0200 Received: from ch10641.keymile.net.net (ch10641.keymile.net [172.31.40.7]) by gitsiv.ch.abb.com (Postfix) with ESMTP id E082765FAB27; Tue, 17 May 2022 09:57:39 +0200 (CEST) From: Holger Brunck To: linux-hwmon@vger.kernel.org Cc: Jean Delvare , Guenter Roeck , Holger Brunck Subject: [v3 3/3] hwmon: (lm90) enable extended range according to DTS node Date: Tue, 17 May 2022 09:57:38 +0200 Message-Id: <20220517075738.16885-1-holger.brunck@hitachienergy.com> X-Mailer: git-send-email 2.35.1.871.gab1f276 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Some lm90 compatible devices can operate in a extended temperature mode. This feature is now enabled if the property is set in the corresponding device tree node. Signed-off-by: Holger Brunck Reviewed-by: Guenter Roeck --- changes for v3: - set config bit is property is set in DTS - rephrase commit msg - rename property drivers/hwmon/lm90.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 1c9493c70813..3820f0e61510 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -1707,6 +1707,7 @@ static void lm90_restore_conf(void *_data) static int lm90_init_client(struct i2c_client *client, struct lm90_data *data) { + struct device_node *np = client->dev.of_node; int config, convrate; convrate = lm90_read_reg(client, LM90_REG_R_CONVRATE); @@ -1727,6 +1728,9 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data) /* Check Temperature Range Select */ if (data->flags & LM90_HAVE_EXTENDED_TEMP) { + if (of_property_read_bool(np, "ti,extended-range-enable")) + config |= 0x04; + if (config & 0x04) data->flags |= LM90_FLAG_ADT7461_EXT; }