@@ -1914,6 +1914,7 @@ static const struct hwmon_ops lm90_ops = {
static int lm90_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
+ const struct device_node *np = dev->of_node;
struct i2c_adapter *adapter = client->adapter;
struct hwmon_channel_info *info;
struct regulator *regulator;
@@ -2017,6 +2018,17 @@ static int lm90_probe(struct i2c_client *client)
/* Set maximum conversion rate */
data->max_convrate = lm90_params[data->kind].max_convrate;
+ /* Parse device-tree information */
+ if (np) {
+ if (data->flags & LM90_HAVE_EXTENDED_TEMP) {
+ if (of_property_read_bool(np, "extended-range-enable")) {
+ err = lm90_update_confreg(data, data->config | 0x04);
+ if (err)
+ return err;
+ }
+ }
+ }
+
/* Initialize the LM90 chip */
err = lm90_init_client(client, data);
if (err < 0) {