Lines Matching +full:uv +full:- +full:sensor
1 // SPDX-License-Identifier: GPL-2.0-only
12 #include <linux/hwmon-sysfs.h>
71 /* Return the converted value from the given register in uV or mC */
101 return -EINVAL; in ltc2990_get_value()
117 /* Vx-Vy, 19.42uV/LSB */ in ltc2990_get_value()
121 /* Vcc, 305.18uV/LSB, 2.5V offset */ in ltc2990_get_value()
128 /* Vx, 305.18uV/LSB */ in ltc2990_get_value()
132 return -EINVAL; /* won't happen, keep compiler happy */ in ltc2990_get_value()
146 ret = ltc2990_get_value(data->i2c, attr->index, &value); in ltc2990_value_show()
163 (ltc2990_attrs_ena_0[data->mode[0]] & in ltc2990_attrs_visible()
164 ltc2990_attrs_ena_1[data->mode[1]]); in ltc2990_attrs_visible()
166 if (attr->index & attrs_mask) in ltc2990_attrs_visible()
167 return a->mode; in ltc2990_attrs_visible()
209 if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA | in ltc2990_i2c_probe()
211 return -ENODEV; in ltc2990_i2c_probe()
213 data = devm_kzalloc(&i2c->dev, sizeof(struct ltc2990_data), GFP_KERNEL); in ltc2990_i2c_probe()
215 return -ENOMEM; in ltc2990_i2c_probe()
217 data->i2c = i2c; in ltc2990_i2c_probe()
219 if (dev_fwnode(&i2c->dev)) { in ltc2990_i2c_probe()
220 ret = device_property_read_u32_array(&i2c->dev, in ltc2990_i2c_probe()
221 "lltc,meas-mode", in ltc2990_i2c_probe()
222 data->mode, 2); in ltc2990_i2c_probe()
226 if (data->mode[0] & ~LTC2990_MODE0_MASK || in ltc2990_i2c_probe()
227 data->mode[1] & ~LTC2990_MODE1_MASK) in ltc2990_i2c_probe()
228 return -EINVAL; in ltc2990_i2c_probe()
234 data->mode[0] = ret >> LTC2990_MODE0_SHIFT & LTC2990_MODE0_MASK; in ltc2990_i2c_probe()
235 data->mode[1] = ret >> LTC2990_MODE1_SHIFT & LTC2990_MODE1_MASK; in ltc2990_i2c_probe()
240 data->mode[0] << LTC2990_MODE0_SHIFT | in ltc2990_i2c_probe()
241 data->mode[1] << LTC2990_MODE1_SHIFT); in ltc2990_i2c_probe()
243 dev_err(&i2c->dev, "Error: Failed to set control mode.\n"); in ltc2990_i2c_probe()
249 dev_err(&i2c->dev, "Error: Failed to start acquisition.\n"); in ltc2990_i2c_probe()
253 hwmon_dev = devm_hwmon_device_register_with_groups(&i2c->dev, in ltc2990_i2c_probe()
254 i2c->name, in ltc2990_i2c_probe()
277 MODULE_DESCRIPTION("LTC2990 Sensor Driver");