All of lore.kernel.org
 help / color / mirror / Atom feed
From: Holger Brunck <holger.brunck@hitachienergy.com>
To: linux-hwmon@vger.kernel.org
Cc: Holger Brunck <holger.brunck@hitachienergy.com>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 2/2] driver/hwmon/lm90: enable extended range according to DTS node
Date: Mon,  9 May 2022 15:10:16 +0200	[thread overview]
Message-ID: <20220509131016.29481-2-holger.brunck@hitachienergy.com> (raw)
In-Reply-To: <20220509131016.29481-1-holger.brunck@hitachienergy.com>

Some lm90 devices can run in a extended temperature mode, this property
can now be set in the devicetree node of the sensor.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
cc: Jean Delvare <jdelvare@suse.com>
cc: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/lm90.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 1c9493c70813..9fd315faa066 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,7 +1728,8 @@ 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 (config & 0x04)
+		if (config & 0x04 ||
+		    of_property_read_bool(np, "extended-range-enable"))
 			data->flags |= LM90_FLAG_ADT7461_EXT;
 	}
 
-- 
2.34.1


  reply	other threads:[~2022-05-09 17:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 13:10 [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Holger Brunck
2022-05-09 13:10 ` Holger Brunck [this message]
2022-05-10  0:41 ` Guenter Roeck
2022-05-10  7:19   ` Holger Brunck
2022-05-10  7:32     ` Krzysztof Kozlowski
2022-05-10 14:12     ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220509131016.29481-2-holger.brunck@hitachienergy.com \
    --to=holger.brunck@hitachienergy.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.