Lines Matching +full:- +full:- +full:retry +full:- +full:all +full:- +full:errors

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * w83l785ts.c - Part of lm_sensors, Linux kernel modules for hardware
5 * Copyright (C) 2003-2009 Jean Delvare <[email protected]>
7 * Inspired from the lm83 driver. The W83L785TS-S is a sensor chip made
11 * http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83L785TS-S.pdf
27 #include <linux/hwmon-sysfs.h>
42 * The W83L785TS-S registers
56 * The W83L785TS-S uses signed 8-bit values.
73 * Driver data (common to all clients)
117 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[attr->index])); in show_temp()
127 /* Return 0 if detection is successful, -ENODEV otherwise */
131 struct i2c_adapter *adapter = client->adapter; in w83l785ts_detect()
136 return -ENODEV; in w83l785ts_detect()
141 dev_dbg(&adapter->dev, in w83l785ts_detect()
142 "W83L785TS-S detection failed at 0x%02x\n", in w83l785ts_detect()
143 client->addr); in w83l785ts_detect()
144 return -ENODEV; in w83l785ts_detect()
153 || chip_id != 0x70) { /* W83L785TS-S */ in w83l785ts_detect()
154 dev_dbg(&adapter->dev, in w83l785ts_detect()
157 return -ENODEV; in w83l785ts_detect()
160 strscpy(info->type, "w83l785ts", I2C_NAME_SIZE); in w83l785ts_detect()
168 struct device *dev = &client->dev; in w83l785ts_probe()
173 return -ENOMEM; in w83l785ts_probe()
176 mutex_init(&data->update_lock); in w83l785ts_probe()
192 data->hwmon_dev = hwmon_device_register(dev); in w83l785ts_probe()
193 if (IS_ERR(data->hwmon_dev)) { in w83l785ts_probe()
194 err = PTR_ERR(data->hwmon_dev); in w83l785ts_probe()
210 hwmon_device_unregister(data->hwmon_dev); in w83l785ts_remove()
211 device_remove_file(&client->dev, in w83l785ts_remove()
213 device_remove_file(&client->dev, in w83l785ts_remove()
228 dev = &client->dev; in w83l785ts_read_value()
231 dev = &client->adapter->dev; in w83l785ts_read_value()
236 * Frequent read errors have been reported on Asus boards, so we in w83l785ts_read_value()
237 * retry on read errors. If it still fails (unlikely), return the in w83l785ts_read_value()
247 dev_dbg(dev, "%sRead failed, will retry in %d.\n", prefix, i); in w83l785ts_read_value()
261 mutex_lock(&data->update_lock); in w83l785ts_update_device()
263 if (!data->valid || time_after(jiffies, data->last_updated + HZ * 2)) { in w83l785ts_update_device()
264 dev_dbg(&client->dev, "Updating w83l785ts data.\n"); in w83l785ts_update_device()
265 data->temp[0] = w83l785ts_read_value(client, in w83l785ts_update_device()
266 W83L785TS_REG_TEMP, data->temp[0]); in w83l785ts_update_device()
267 data->temp[1] = w83l785ts_read_value(client, in w83l785ts_update_device()
268 W83L785TS_REG_TEMP_OVER, data->temp[1]); in w83l785ts_update_device()
270 data->last_updated = jiffies; in w83l785ts_update_device()
271 data->valid = true; in w83l785ts_update_device()
274 mutex_unlock(&data->update_lock); in w83l785ts_update_device()
282 MODULE_DESCRIPTION("W83L785TS-S driver");