Lines Matching +full:report +full:- +full:speed +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0-or-later
18 #include <linux/hwmon-sysfs.h>
27 * status reporting commands are non-standard. For this reason, a standard
30 * All Lineage CPL devices have a built-in I2C bus master selector (PCA9541).
58 /* Virtual entries, to report constants */
140 result = -EIO; in pem_read_block()
152 struct i2c_client *client = data->client; in pem_update_device()
155 mutex_lock(&data->update_lock); in pem_update_device()
157 if (time_after(jiffies, data->last_updated + HZ) || !data->valid) { in pem_update_device()
162 data->data_string, in pem_update_device()
163 sizeof(data->data_string)); in pem_update_device()
170 if (data->input_length) { in pem_update_device()
172 data->input_string, in pem_update_device()
173 data->input_length); in pem_update_device()
181 if (data->fans_supported) { in pem_update_device()
183 data->fan_speed, in pem_update_device()
184 sizeof(data->fan_speed)); in pem_update_device()
193 data->last_updated = jiffies; in pem_update_device()
194 data->valid = true; in pem_update_device()
197 mutex_unlock(&data->update_lock); in pem_update_device()
235 val = (data[index] + (data[index+1] << 8) - 75) * 1000; in pem_get_input()
237 val = (data[index] - 75) * 1000; in pem_get_input()
282 status = data->data_string[attr->nr] & attr->index; in pem_bool_show()
296 value = pem_get_data(data->data_string, sizeof(data->data_string), in pem_data_show()
297 attr->index); in pem_data_show()
312 value = pem_get_input(data->input_string, sizeof(data->input_string), in pem_input_show()
313 attr->index); in pem_input_show()
328 value = pem_get_fan(data->fan_speed, sizeof(data->fan_speed), in pem_fan_show()
329 attr->index); in pem_fan_show()
422 struct i2c_adapter *adapter = client->adapter; in pem_probe()
423 struct device *dev = &client->dev; in pem_probe()
430 return -ENODEV; in pem_probe()
434 return -ENOMEM; in pem_probe()
436 data->client = client; in pem_probe()
437 mutex_init(&data->update_lock); in pem_probe()
444 data->firmware_rev, sizeof(data->firmware_rev)); in pem_probe()
453 data->firmware_rev[0], data->firmware_rev[1], in pem_probe()
454 data->firmware_rev[2]); in pem_probe()
457 data->groups[idx++] = &pem_group; in pem_probe()
466 data->input_string, in pem_probe()
467 sizeof(data->input_string) - 1); in pem_probe()
468 if (!ret && (data->input_string[0] || data->input_string[1] || in pem_probe()
469 data->input_string[2])) in pem_probe()
470 data->input_length = sizeof(data->input_string) - 1; in pem_probe()
474 data->input_string, in pem_probe()
475 sizeof(data->input_string)); in pem_probe()
476 if (!ret && (data->input_string[0] || data->input_string[1] || in pem_probe()
477 data->input_string[2] || data->input_string[3])) in pem_probe()
478 data->input_length = sizeof(data->input_string); in pem_probe()
481 if (data->input_length) in pem_probe()
482 data->groups[idx++] = &pem_input_group; in pem_probe()
485 * Check if fan speed readings are supported. in pem_probe()
486 * This is the case if we can read fan speed data, in pem_probe()
491 data->fan_speed, in pem_probe()
492 sizeof(data->fan_speed)); in pem_probe()
493 if (!ret && (data->fan_speed[0] || data->fan_speed[1] || in pem_probe()
494 data->fan_speed[2] || data->fan_speed[3])) { in pem_probe()
495 data->fans_supported = true; in pem_probe()
496 data->groups[idx++] = &pem_fan_group; in pem_probe()
499 hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, in pem_probe()
500 data, data->groups); in pem_probe()
520 MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");