Lines Matching +full:hot +full:- +full:swap
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Linear Technology LTC4261 I2C Negative Voltage Hot Swap Controller
9 * Driver for Linear Technology LTC4245 I2C Multiple Supply Hot Swap Controller
22 #include <linux/hwmon-sysfs.h>
58 struct i2c_client *client = data->client; in ltc4261_update_device()
61 mutex_lock(&data->update_lock); in ltc4261_update_device()
63 if (time_after(jiffies, data->last_updated + HZ / 4) || !data->valid) { in ltc4261_update_device()
66 /* Read registers -- 0x00 to 0x09 */ in ltc4261_update_device()
67 for (i = 0; i < ARRAY_SIZE(data->regs); i++) { in ltc4261_update_device()
76 data->valid = false; in ltc4261_update_device()
79 data->regs[i] = val; in ltc4261_update_device()
81 data->last_updated = jiffies; in ltc4261_update_device()
82 data->valid = true; in ltc4261_update_device()
85 mutex_unlock(&data->update_lock); in ltc4261_update_device()
94 val = (data->regs[reg] << 2) + (data->regs[reg + 1] >> 6); in ltc4261_get_value()
132 value = ltc4261_get_value(data, attr->index); in ltc4261_value_show()
146 fault = data->regs[LTC4261_FAULT] & attr->index; in ltc4261_bool_show()
148 i2c_smbus_write_byte_data(data->client, LTC4261_FAULT, ~fault); in ltc4261_bool_show()
195 struct i2c_adapter *adapter = client->adapter; in ltc4261_probe()
196 struct device *dev = &client->dev; in ltc4261_probe()
201 return -ENODEV; in ltc4261_probe()
205 return -ENODEV; in ltc4261_probe()
210 return -ENOMEM; in ltc4261_probe()
212 data->client = client; in ltc4261_probe()
213 mutex_init(&data->update_lock); in ltc4261_probe()
218 hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, in ltc4261_probe()
242 MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");