Re: [v2 2/2] driver/hwmon/lm90: enable extended range according to DTS node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 5/10/22 01:09, Holger Brunck wrote:
Some lm90 devices can operate in a extended temperature mode, this feature

lm90 compatible ... mode. This ...

is now eanbled if the property is set in the corresponding device tree

enabled

node.

Signed-off-by: Holger Brunck <holger.brunck@xxxxxxxxxxxxxxxxx>
cc: Jean Delvare <jdelvare@xxxxxxxx>
cc: Guenter Roeck <linux@xxxxxxxxxxxx>

Cc: isn't really necessary or useful to list maintainers; You might want to
use the --cc option of git send-email instead. Also, if used, it should
be "Cc:".

For the subject, please use "hwmon: (lm90) ...".

---
  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..6cdbcfab9f20 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, "onsemi,extended-range-enable"))
  			data->flags |= LM90_FLAG_ADT7461_EXT;

Maybe I am missing something, but I don't see the matching configuration
change. Specifying the flag in devicetree only really makes sense if the
chip configuration is changed accordingly.

Guenter



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux