Lines Matching refs:hwmon
9 #include <linux/hwmon.h>
146 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
151 hwmon->dma_buf.dma_addr);
152 MCDI_SET_DWORD(inbuf, READ_SENSORS_EXT_IN_LENGTH, hwmon->dma_buf.len);
157 hwmon->last_update = jiffies;
165 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
170 mutex_lock(&hwmon->update_lock);
173 if (time_before(jiffies, hwmon->last_update + HZ))
179 *entry = ((efx_dword_t *)hwmon->dma_buf.addr)[index];
181 mutex_unlock(&hwmon->update_lock);
285 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
286 struct efx_mcdi_mon_attribute *attr = &hwmon->attrs[hwmon->n_attrs];
300 hwmon->group.attrs[hwmon->n_attrs++] = &attr->dev_attr.attr;
306 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
339 efx, &hwmon->dma_buf,
345 mutex_init(&hwmon->update_lock);
353 hwmon->attrs = kcalloc(n_attrs, sizeof(*hwmon->attrs), GFP_KERNEL);
354 if (!hwmon->attrs) {
358 hwmon->group.attrs = kcalloc(n_attrs + 1, sizeof(struct attribute *),
360 if (!hwmon->group.attrs) {
504 hwmon->groups[0] = &hwmon->group;
505 hwmon->device = hwmon_device_register_with_groups(&efx->pci_dev->dev,
507 hwmon->groups);
508 if (IS_ERR(hwmon->device)) {
509 rc = PTR_ERR(hwmon->device);
522 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
524 if (hwmon->device)
525 hwmon_device_unregister(hwmon->device);
526 kfree(hwmon->attrs);
527 kfree(hwmon->group.attrs);
528 efx_nic_free_buffer(efx, &hwmon->dma_buf);