Lines Matching refs:hwmon

149 	struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);  in efx_mcdi_mon_update()  local
154 hwmon->dma_buf.dma_addr); in efx_mcdi_mon_update()
155 MCDI_SET_DWORD(inbuf, READ_SENSORS_EXT_IN_LENGTH, hwmon->dma_buf.len); in efx_mcdi_mon_update()
160 hwmon->last_update = jiffies; in efx_mcdi_mon_update()
168 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_get_entry() local
173 mutex_lock(&hwmon->update_lock); in efx_mcdi_mon_get_entry()
176 if (time_before(jiffies, hwmon->last_update + HZ)) in efx_mcdi_mon_get_entry()
182 *entry = ((efx_dword_t *)hwmon->dma_buf.addr)[index]; in efx_mcdi_mon_get_entry()
184 mutex_unlock(&hwmon->update_lock); in efx_mcdi_mon_get_entry()
288 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_add_attr() local
289 struct efx_mcdi_mon_attribute *attr = &hwmon->attrs[hwmon->n_attrs]; in efx_mcdi_mon_add_attr()
303 hwmon->group.attrs[hwmon->n_attrs++] = &attr->dev_attr.attr; in efx_mcdi_mon_add_attr()
309 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_probe() local
342 efx, &hwmon->dma_buf, in efx_mcdi_mon_probe()
348 mutex_init(&hwmon->update_lock); in efx_mcdi_mon_probe()
356 hwmon->attrs = kcalloc(n_attrs, sizeof(*hwmon->attrs), GFP_KERNEL); in efx_mcdi_mon_probe()
357 if (!hwmon->attrs) { in efx_mcdi_mon_probe()
361 hwmon->group.attrs = kcalloc(n_attrs + 1, sizeof(struct attribute *), in efx_mcdi_mon_probe()
363 if (!hwmon->group.attrs) { in efx_mcdi_mon_probe()
507 hwmon->groups[0] = &hwmon->group; in efx_mcdi_mon_probe()
508 hwmon->device = hwmon_device_register_with_groups(&efx->pci_dev->dev, in efx_mcdi_mon_probe()
510 hwmon->groups); in efx_mcdi_mon_probe()
511 if (IS_ERR(hwmon->device)) { in efx_mcdi_mon_probe()
512 rc = PTR_ERR(hwmon->device); in efx_mcdi_mon_probe()
525 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_remove() local
527 if (hwmon->device) in efx_mcdi_mon_remove()
528 hwmon_device_unregister(hwmon->device); in efx_mcdi_mon_remove()
529 kfree(hwmon->attrs); in efx_mcdi_mon_remove()
530 kfree(hwmon->group.attrs); in efx_mcdi_mon_remove()
531 efx_nic_free_buffer(efx, &hwmon->dma_buf); in efx_mcdi_mon_remove()