Lines Matching +full:de +full:- +full:rated
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * lm90.c - Part of lm_sensors, Linux kernel modules for hardware
5 * Copyright (C) 2003-2010 Jean Delvare <jdelvare@suse.de>
10 * temperature) and a 3-4 deg accuracy.
18 * When device is auto-detected, the driver will assume an LM99.
77 * pin-compatible with the LM86, the ED/EDP parts are also address-compatible.
121 * LM86, LM89, LM90, LM99, ADM1032, ADM1032-1, ADT7461, ADT7461A, MAX6649,
123 * ADM1032-2, ADT7461-2, ADT7461A-2, LM89-1, LM99-1, MAX6646, and NCT1008D
413 u8 resolution; /* 16-bit resolution (default 11 bit) */
739 return i2c_smbus_xfer(client->adapter, client->addr, in lm90_write_no_pec()
740 client->flags & ~I2C_CLIENT_PEC, in lm90_write_no_pec()
745 * It is assumed that client->update_lock is held (unless we are in
753 bool partial_pec = (client->flags & I2C_CLIENT_PEC) && in lm90_read_reg()
754 (data->flags & LM90_HAVE_PARTIAL_PEC); in lm90_read_reg()
790 * Write into 16-bit LM90 register.
828 * the one-shot conversion register, which we don't want to do in lm90_read16()
849 if (data->config != config) { in lm90_update_confreg()
852 err = lm90_write_reg(data->client, LM90_REG_CONFIG1, config); in lm90_update_confreg()
855 data->config = config; in lm90_update_confreg()
861 * client->update_lock must be held when calling this function (unless we are
863 * than channel 0 is selected. Also, calling code must make sure to re-select
866 * non-default remote channel.
870 u8 config = data->config & ~0x08; in lm90_select_remote_channel()
880 u8 config = data->config; in lm90_write_convrate()
884 if (data->flags & LM90_PAUSE_FOR_CONFIG) { in lm90_write_convrate()
891 err = lm90_write_reg(data->client, LM90_REG_CONVRATE, val); in lm90_write_convrate()
901 * client->update_lock must be held when calling this function (unless we are
915 i < data->max_convrate; i++, update_interval >>= 1) in lm90_set_convrate()
920 data->update_interval = DIV_ROUND_CLOSEST(update_interval, 64); in lm90_set_convrate()
929 if (data->faultqueue_mask) { in lm90_set_faultqueue()
930 err = lm90_update_confreg(data, val <= data->faultqueue_depth / 2 ? in lm90_set_faultqueue()
931 data->config & ~data->faultqueue_mask : in lm90_set_faultqueue()
932 data->config | data->faultqueue_mask); in lm90_set_faultqueue()
936 data->conalert = (data->conalert & 0xf1) | values[val - 1]; in lm90_set_faultqueue()
937 err = lm90_write_reg(data->client, TMP451_REG_CONALERT, in lm90_set_faultqueue()
938 data->conalert); in lm90_set_faultqueue()
947 struct i2c_client *client = data->client; in lm90_update_limits()
950 if (data->flags & LM90_HAVE_CRIT) { in lm90_update_limits()
954 data->temp[LOCAL_CRIT] = val << 8; in lm90_update_limits()
959 data->temp[REMOTE_CRIT] = val << 8; in lm90_update_limits()
964 data->temp_hyst = val; in lm90_update_limits()
966 if ((data->flags & LM90_HAVE_FAULTQUEUE) && !data->faultqueue_mask) { in lm90_update_limits()
970 data->conalert = val; in lm90_update_limits()
974 (data->flags & LM90_HAVE_REM_LIMIT_EXT) ? LM90_REG_REMOTE_LOWL : 0, in lm90_update_limits()
978 data->temp[REMOTE_LOW] = val; in lm90_update_limits()
981 (data->flags & LM90_HAVE_REM_LIMIT_EXT) ? LM90_REG_REMOTE_HIGHL : 0, in lm90_update_limits()
985 data->temp[REMOTE_HIGH] = val; in lm90_update_limits()
987 if (data->flags & LM90_HAVE_OFFSET) { in lm90_update_limits()
992 data->temp[REMOTE_OFFSET] = val; in lm90_update_limits()
995 if (data->flags & LM90_HAVE_EMERGENCY) { in lm90_update_limits()
999 data->temp[LOCAL_EMERG] = val << 8; in lm90_update_limits()
1004 data->temp[REMOTE_EMERG] = val << 8; in lm90_update_limits()
1007 if (data->flags & LM90_HAVE_TEMP3) { in lm90_update_limits()
1015 data->temp[REMOTE2_CRIT] = val << 8; in lm90_update_limits()
1017 if (data->flags & LM90_HAVE_EMERGENCY) { in lm90_update_limits()
1021 data->temp[REMOTE2_EMERG] = val << 8; in lm90_update_limits()
1027 data->temp[REMOTE2_LOW] = val << 8; in lm90_update_limits()
1032 data->temp[REMOTE2_HIGH] = val << 8; in lm90_update_limits()
1034 if (data->flags & LM90_HAVE_OFFSET) { in lm90_update_limits()
1039 data->temp[REMOTE2_OFFSET] = val; in lm90_update_limits()
1052 struct device *hwmon_dev = data->hwmon_dev; in lm90_report_alarms()
1053 struct device *dev = &data->client->dev; in lm90_report_alarms()
1056 current_alarms = data->current_alarms; in lm90_report_alarms()
1057 cleared_alarms = data->reported_alarms & ~current_alarms; in lm90_report_alarms()
1058 new_alarms = current_alarms & ~data->reported_alarms; in lm90_report_alarms()
1111 data->reported_alarms = current_alarms; in lm90_report_alarms()
1116 if (force || !data->alarms_valid || in lm90_update_alarms_locked()
1117 time_after(jiffies, data->alarms_updated + msecs_to_jiffies(data->update_interval))) { in lm90_update_alarms_locked()
1118 struct i2c_client *client = data->client; in lm90_update_alarms_locked()
1123 data->alarms_valid = false; in lm90_update_alarms_locked()
1130 if (data->reg_status2) { in lm90_update_alarms_locked()
1131 val = lm90_read_reg(client, data->reg_status2); in lm90_update_alarms_locked()
1143 if (force && data->alarms_valid) in lm90_update_alarms_locked()
1144 data->current_alarms |= alarms; in lm90_update_alarms_locked()
1146 data->current_alarms = alarms; in lm90_update_alarms_locked()
1147 data->alarms |= alarms; in lm90_update_alarms_locked()
1149 check_enable = (client->irq || !(data->config_orig & 0x80)) && in lm90_update_alarms_locked()
1150 (data->config & 0x80); in lm90_update_alarms_locked()
1153 schedule_work(&data->report_work); in lm90_update_alarms_locked()
1156 * Re-enable ALERT# output if it was originally enabled, relevant in lm90_update_alarms_locked()
1161 if (!(data->current_alarms & data->alert_alarms)) { in lm90_update_alarms_locked()
1162 dev_dbg(&client->dev, "Re-enabling ALERT#\n"); in lm90_update_alarms_locked()
1163 lm90_update_confreg(data, data->config & ~0x80); in lm90_update_alarms_locked()
1170 cancel_delayed_work(&data->alert_work); in lm90_update_alarms_locked()
1172 schedule_delayed_work(&data->alert_work, in lm90_update_alarms_locked()
1173 max_t(int, HZ, msecs_to_jiffies(data->update_interval))); in lm90_update_alarms_locked()
1176 data->alarms_updated = jiffies; in lm90_update_alarms_locked()
1177 data->alarms_valid = true; in lm90_update_alarms_locked()
1186 mutex_lock(&data->update_lock); in lm90_update_alarms()
1188 mutex_unlock(&data->update_lock); in lm90_update_alarms()
1199 if (!(data->config & 0x80)) in lm90_alert_work()
1208 struct i2c_client *client = data->client; in lm90_update_device()
1212 if (!data->valid) { in lm90_update_device()
1218 next_update = data->last_updated + in lm90_update_device()
1219 msecs_to_jiffies(data->update_interval); in lm90_update_device()
1220 if (time_after(jiffies, next_update) || !data->valid) { in lm90_update_device()
1221 dev_dbg(&client->dev, "Updating lm90 data.\n"); in lm90_update_device()
1223 data->valid = false; in lm90_update_device()
1228 data->temp[LOCAL_LOW] = val << 8; in lm90_update_device()
1233 data->temp[LOCAL_HIGH] = val << 8; in lm90_update_device()
1236 data->reg_local_ext, true); in lm90_update_device()
1239 data->temp[LOCAL_TEMP] = val; in lm90_update_device()
1241 data->reg_remote_ext, true); in lm90_update_device()
1244 data->temp[REMOTE_TEMP] = val; in lm90_update_device()
1246 if (data->flags & LM90_HAVE_TEMP3) { in lm90_update_device()
1252 data->reg_remote_ext, true); in lm90_update_device()
1257 data->temp[REMOTE2_TEMP] = val; in lm90_update_device()
1266 data->last_updated = jiffies; in lm90_update_device()
1267 data->valid = true; in lm90_update_device()
1277 if (data->reg_remote_ext) in lm90_temp_get_resolution()
1278 return data->resolution; in lm90_temp_get_resolution()
1283 return data->resolution; in lm90_temp_get_resolution()
1285 if (data->reg_local_ext) in lm90_temp_get_resolution()
1286 return data->resolution; in lm90_temp_get_resolution()
1292 if (data->flags & LM90_HAVE_REM_LIMIT_EXT) in lm90_temp_get_resolution()
1293 return data->resolution; in lm90_temp_get_resolution()
1305 val = regval - 0x4000; in lm90_temp_from_reg()
1311 return ((val >> (16 - resolution)) * 1000) >> (resolution - 8); in lm90_temp_from_reg()
1316 int temp = lm90_temp_from_reg(data->flags, data->temp[index], in lm90_get_temp()
1320 if (data->kind == lm99 && channel) in lm90_get_temp()
1329 1000 - DIV_ROUND_CLOSEST(1000, BIT(resolution - 8)) : 0; in lm90_temp_to_reg()
1332 val = clamp_val(val, -64000, 191000 + fraction); in lm90_temp_to_reg()
1339 val = clamp_val(val, -128000, 127000 + fraction); in lm90_temp_to_reg()
1342 return DIV_ROUND_CLOSEST(val << (resolution - 8), 1000) << (16 - resolution); in lm90_temp_to_reg()
1361 struct i2c_client *client = data->client; in lm90_set_temp()
1366 if (channel && (data->flags & LM90_HAVE_REM_LIMIT_EXT)) { in lm90_set_temp()
1374 if (data->kind == lm99 && channel) { in lm90_set_temp()
1376 val = max(val, -128000l); in lm90_set_temp()
1377 val -= 16000; in lm90_set_temp()
1380 data->temp[index] = lm90_temp_to_reg(data->flags, val, in lm90_set_temp()
1386 err = lm90_write16(client, regh, regl, data->temp[index]); in lm90_set_temp()
1398 return temp - data->temp_hyst * 1000; in lm90_get_temphyst()
1406 val = clamp_val(val, -128000l, 255000l); in lm90_set_temphyst()
1407 data->temp_hyst = clamp_val(DIV_ROUND_CLOSEST(temp - val, 1000), 0, 31); in lm90_set_temphyst()
1409 return lm90_write_reg(data->client, LM90_REG_TCRIT_HYST, data->temp_hyst); in lm90_set_temphyst()
1416 return lm90_temp_from_reg(0, data->temp[index], res); in lm90_get_temp_offset()
1429 err = lm90_write16(data->client, LM90_REG_REMOTE_OFFSH, LM90_REG_REMOTE_OFFSL, val); in lm90_set_temp_offset()
1437 data->temp[index] = val; in lm90_set_temp_offset()
1463 -1, REMOTE_OFFSET, REMOTE2_OFFSET
1479 mutex_lock(&data->update_lock); in lm90_temp_read()
1481 mutex_unlock(&data->update_lock); in lm90_temp_read()
1502 if (data->flags & LM90_HAVE_CRIT_ALRM_SWP) in lm90_temp_read()
1514 *val = !!(data->alarms & bit); in lm90_temp_read()
1515 data->alarms &= ~bit; in lm90_temp_read()
1516 data->alarms |= data->current_alarms; in lm90_temp_read()
1540 return -EOPNOTSUPP; in lm90_temp_read()
1550 mutex_lock(&data->update_lock); in lm90_temp_write()
1581 err = -EOPNOTSUPP; in lm90_temp_write()
1585 mutex_unlock(&data->update_lock); in lm90_temp_write()
1622 mutex_lock(&data->update_lock); in lm90_chip_read()
1624 mutex_unlock(&data->update_lock); in lm90_chip_read()
1630 *val = data->update_interval; in lm90_chip_read()
1633 *val = data->alarms; in lm90_chip_read()
1636 if (data->faultqueue_mask) { in lm90_chip_read()
1637 *val = (data->config & data->faultqueue_mask) ? in lm90_chip_read()
1638 data->faultqueue_depth : 1; in lm90_chip_read()
1640 switch (data->conalert & 0x0e) { in lm90_chip_read()
1658 return -EOPNOTSUPP; in lm90_chip_read()
1667 struct i2c_client *client = data->client; in lm90_chip_write()
1670 mutex_lock(&data->update_lock); in lm90_chip_write()
1685 err = -EOPNOTSUPP; in lm90_chip_write()
1689 mutex_unlock(&data->update_lock); in lm90_chip_write()
1716 return -EOPNOTSUPP; in lm90_read()
1725 *str = data->channel_label[channel]; in lm90_read_string()
1739 return -EOPNOTSUPP; in lm90_write()
1851 if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) { in lm90_detect_max1617()
1873 int address = client->addr; in lm90_detect_national()
1907 int address = client->addr; in lm90_detect_on()
1929 int address = client->addr; in lm90_detect_analog()
1947 * ---------------------------------------------------------- in lm90_detect_analog()
1958 * adt7482 - - - 41 65 datasheet in lm90_detect_analog()
1965 * nct1008 - - - 41 57 datasheet rev. 3 in lm90_detect_analog()
1968 * nvt210 - - - 41 - datasheet in lm90_detect_analog()
1969 * nvt211 - - - 41 - datasheet in lm90_detect_analog()
1987 * ADM1021A and compatible chips will be mis-detected as in lm90_detect_analog()
2083 int address = client->addr; in lm90_detect_maxim()
2092 * We read MAX6659_REG_REMOTE_EMERG twice, and re-read in lm90_detect_maxim()
2165 * The only diference is the rated accuracy. Rev. 1 of the in lm90_detect_maxim()
2188 * For this reason it will be mis-detected as MAX6657 if its in lm90_detect_maxim()
2201 /* re-read manufacturer ID to have a good baseline */ in lm90_detect_maxim()
2205 /* check various non-existing registers */ in lm90_detect_maxim()
2216 /* re-check unsupported registers */ in lm90_detect_maxim()
2242 * chips. MAX6648 will be mis-detected as MAX6649 if the remote in lm90_detect_maxim()
2285 int address = client->addr; in lm90_detect_nuvoton()
2306 int address = client->addr; in lm90_detect_nxp()
2332 int address = client->addr; in lm90_detect_gmt()
2336 * 0x4c and have a chip ID of 0x01. G781-1 is supposed to be at I2C in lm90_detect_gmt()
2339 * chip ID of 0x01. A G781-1 at I2C address 0x4d was now found with in lm90_detect_gmt()
2386 int address = client->addr; in lm90_detect_ti()
2411 /* Return 0 if detection is successful, -ENODEV otherwise */
2414 struct i2c_adapter *adapter = client->adapter; in lm90_detect()
2417 int address = client->addr; in lm90_detect()
2424 return -ENODEV; in lm90_detect()
2438 return -ENODEV; in lm90_detect()
2442 return -ENODEV; in lm90_detect()
2454 return -ENODEV; in lm90_detect()
2456 man_id = -1; in lm90_detect()
2459 case -1: /* Chip does not support man_id / chip_id */ in lm90_detect()
2509 dev_dbg(&adapter->dev, in lm90_detect()
2511 client->addr, man_id, chip_id); in lm90_detect()
2512 return -ENODEV; in lm90_detect()
2515 strscpy(info->type, name, I2C_NAME_SIZE); in lm90_detect()
2523 struct i2c_client *client = data->client; in lm90_restore_conf()
2525 cancel_delayed_work_sync(&data->alert_work); in lm90_restore_conf()
2526 cancel_work_sync(&data->report_work); in lm90_restore_conf()
2529 if (data->flags & LM90_HAVE_CONVRATE) in lm90_restore_conf()
2530 lm90_write_convrate(data, data->convrate_orig); in lm90_restore_conf()
2531 lm90_write_reg(client, LM90_REG_CONFIG1, data->config_orig); in lm90_restore_conf()
2536 struct device_node *np = client->dev.of_node; in lm90_init_client()
2539 if (data->flags & LM90_HAVE_CONVRATE) { in lm90_init_client()
2543 data->convrate_orig = convrate; in lm90_init_client()
2546 data->update_interval = 500; in lm90_init_client()
2555 data->config_orig = config; in lm90_init_client()
2556 data->config = config; in lm90_init_client()
2559 if (data->flags & LM90_HAVE_EXTENDED_TEMP) { in lm90_init_client()
2560 if (of_property_read_bool(np, "ti,extended-range-enable")) in lm90_init_client()
2563 data->flags &= ~LM90_HAVE_EXTENDED_TEMP; in lm90_init_client()
2569 * to -64 degree) mode for the remote temperature sensor. in lm90_init_client()
2573 if (data->kind == max6680) in lm90_init_client()
2578 * 0 degrees to -64 degrees). Note that extended resolution is not in lm90_init_client()
2582 if (data->kind == max6654) in lm90_init_client()
2588 if (data->flags & LM90_HAVE_TEMP3) in lm90_init_client()
2595 if (client->irq) in lm90_init_client()
2601 return devm_add_action_or_reset(&client->dev, lm90_restore_conf, data); in lm90_init_client()
2613 return !!data->current_alarms; in lm90_is_tripped()
2633 struct device *dev = &client->dev; in lm90_probe_channel_from_dt()
2643 return -EINVAL; in lm90_probe_channel_from_dt()
2646 err = of_property_read_string(child, "label", &data->channel_label[id]); in lm90_probe_channel_from_dt()
2647 if (err == -ENODATA || err == -EILSEQ) { in lm90_probe_channel_from_dt()
2652 if (data->channel_label[id]) in lm90_probe_channel_from_dt()
2653 data->channel_config[id] |= HWMON_T_LABEL; in lm90_probe_channel_from_dt()
2655 err = of_property_read_s32(child, "temperature-offset-millicelsius", &val); in lm90_probe_channel_from_dt()
2658 dev_err(dev, "temperature-offset-millicelsius can't be set for internal channel\n"); in lm90_probe_channel_from_dt()
2659 return -EINVAL; in lm90_probe_channel_from_dt()
2677 struct device *dev = &client->dev; in lm90_parse_dt_channel_info()
2678 const struct device_node *np = dev->of_node; in lm90_parse_dt_channel_info()
2681 if (strcmp(child->name, "channel")) in lm90_parse_dt_channel_info()
2701 struct device *dev = &client->dev; in lm90_probe()
2702 struct i2c_adapter *adapter = client->adapter; in lm90_probe()
2714 return -ENOMEM; in lm90_probe()
2716 data->client = client; in lm90_probe()
2718 mutex_init(&data->update_lock); in lm90_probe()
2719 INIT_DELAYED_WORK(&data->alert_work, lm90_alert_work); in lm90_probe()
2720 INIT_WORK(&data->report_work, lm90_report_alarms); in lm90_probe()
2723 data->kind = (uintptr_t)i2c_get_match_data(client); in lm90_probe()
2729 data->alert_alarms = lm90_params[data->kind].alert_alarms; in lm90_probe()
2730 data->resolution = lm90_params[data->kind].resolution ? : 11; in lm90_probe()
2733 data->flags = lm90_params[data->kind].flags; in lm90_probe()
2735 if ((data->flags & (LM90_HAVE_PEC | LM90_HAVE_PARTIAL_PEC)) && in lm90_probe()
2737 data->flags &= ~(LM90_HAVE_PEC | LM90_HAVE_PARTIAL_PEC); in lm90_probe()
2739 if ((data->flags & LM90_HAVE_PARTIAL_PEC) && in lm90_probe()
2741 data->flags &= ~LM90_HAVE_PARTIAL_PEC; in lm90_probe()
2743 data->chip.ops = &lm90_ops; in lm90_probe()
2744 data->chip.info = data->info; in lm90_probe()
2746 data->info[0] = &data->chip_info; in lm90_probe()
2747 info = &data->chip_info; in lm90_probe()
2748 info->type = hwmon_chip; in lm90_probe()
2749 info->config = data->chip_config; in lm90_probe()
2751 data->chip_config[0] = HWMON_C_REGISTER_TZ; in lm90_probe()
2752 if (data->flags & LM90_HAVE_ALARMS) in lm90_probe()
2753 data->chip_config[0] |= HWMON_C_ALARMS; in lm90_probe()
2754 if (data->flags & LM90_HAVE_CONVRATE) in lm90_probe()
2755 data->chip_config[0] |= HWMON_C_UPDATE_INTERVAL; in lm90_probe()
2756 if (data->flags & LM90_HAVE_FAULTQUEUE) in lm90_probe()
2757 data->chip_config[0] |= HWMON_C_TEMP_SAMPLES; in lm90_probe()
2758 if (data->flags & (LM90_HAVE_PEC | LM90_HAVE_PARTIAL_PEC)) in lm90_probe()
2759 data->chip_config[0] |= HWMON_C_PEC; in lm90_probe()
2760 data->info[1] = &data->temp_info; in lm90_probe()
2762 info = &data->temp_info; in lm90_probe()
2763 info->type = hwmon_temp; in lm90_probe()
2764 info->config = data->channel_config; in lm90_probe()
2766 data->channel_config[0] = HWMON_T_INPUT | HWMON_T_MAX | in lm90_probe()
2768 data->channel_config[1] = HWMON_T_INPUT | HWMON_T_MAX | in lm90_probe()
2771 if (data->flags & LM90_HAVE_LOW) { in lm90_probe()
2772 data->channel_config[0] |= HWMON_T_MIN | HWMON_T_MIN_ALARM; in lm90_probe()
2773 data->channel_config[1] |= HWMON_T_MIN | HWMON_T_MIN_ALARM; in lm90_probe()
2776 if (data->flags & LM90_HAVE_CRIT) { in lm90_probe()
2777 data->channel_config[0] |= HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_CRIT_HYST; in lm90_probe()
2778 data->channel_config[1] |= HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_CRIT_HYST; in lm90_probe()
2781 if (data->flags & LM90_HAVE_OFFSET) in lm90_probe()
2782 data->channel_config[1] |= HWMON_T_OFFSET; in lm90_probe()
2784 if (data->flags & LM90_HAVE_EMERGENCY) { in lm90_probe()
2785 data->channel_config[0] |= HWMON_T_EMERGENCY | in lm90_probe()
2787 data->channel_config[1] |= HWMON_T_EMERGENCY | in lm90_probe()
2791 if (data->flags & LM90_HAVE_EMERGENCY_ALARM) { in lm90_probe()
2792 data->channel_config[0] |= HWMON_T_EMERGENCY_ALARM; in lm90_probe()
2793 data->channel_config[1] |= HWMON_T_EMERGENCY_ALARM; in lm90_probe()
2796 if (data->flags & LM90_HAVE_TEMP3) { in lm90_probe()
2797 data->channel_config[2] = HWMON_T_INPUT | in lm90_probe()
2802 if (data->flags & LM90_HAVE_EMERGENCY) { in lm90_probe()
2803 data->channel_config[2] |= HWMON_T_EMERGENCY | in lm90_probe()
2806 if (data->flags & LM90_HAVE_EMERGENCY_ALARM) in lm90_probe()
2807 data->channel_config[2] |= HWMON_T_EMERGENCY_ALARM; in lm90_probe()
2808 if (data->flags & LM90_HAVE_OFFSET) in lm90_probe()
2809 data->channel_config[2] |= HWMON_T_OFFSET; in lm90_probe()
2812 data->faultqueue_mask = lm90_params[data->kind].faultqueue_mask; in lm90_probe()
2813 data->faultqueue_depth = lm90_params[data->kind].faultqueue_depth; in lm90_probe()
2814 data->reg_local_ext = lm90_params[data->kind].reg_local_ext; in lm90_probe()
2815 if (data->flags & LM90_HAVE_REMOTE_EXT) in lm90_probe()
2816 data->reg_remote_ext = LM90_REG_REMOTE_TEMPL; in lm90_probe()
2817 data->reg_status2 = lm90_params[data->kind].reg_status2; in lm90_probe()
2820 data->max_convrate = lm90_params[data->kind].max_convrate; in lm90_probe()
2822 /* Parse device-tree channel information */ in lm90_probe()
2823 if (client->dev.of_node) { in lm90_probe()
2836 hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, in lm90_probe()
2837 data, &data->chip, in lm90_probe()
2842 data->hwmon_dev = hwmon_dev; in lm90_probe()
2844 if (client->irq) { in lm90_probe()
2845 dev_dbg(dev, "IRQ: %d\n", client->irq); in lm90_probe()
2846 err = devm_request_threaded_irq(dev, client->irq, in lm90_probe()
2850 dev_err(dev, "cannot request IRQ %d\n", client->irq); in lm90_probe()
2872 if ((data->flags & LM90_HAVE_BROKEN_ALERT) && in lm90_alert()
2873 (data->current_alarms & data->alert_alarms)) { in lm90_alert()
2874 if (!(data->config & 0x80)) { in lm90_alert()
2875 dev_dbg(&client->dev, "Disabling ALERT#\n"); in lm90_alert()
2876 lm90_update_confreg(data, data->config | 0x80); in lm90_alert()
2878 schedule_delayed_work(&data->alert_work, in lm90_alert()
2879 max_t(int, HZ, msecs_to_jiffies(data->update_interval))); in lm90_alert()
2882 dev_dbg(&client->dev, "Everything OK\n"); in lm90_alert()
2889 struct i2c_client *client = data->client; in lm90_suspend()
2891 if (client->irq) in lm90_suspend()
2892 disable_irq(client->irq); in lm90_suspend()
2900 struct i2c_client *client = data->client; in lm90_resume()
2902 if (client->irq) in lm90_resume()
2903 enable_irq(client->irq); in lm90_resume()
2926 MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>");