Lines Matching refs:sensors
237 struct dell_wmi_ddv_sensors *sensors, size_t entry_size) in dell_wmi_ddv_update_sensors() argument
244 if (sensors->obj) { in dell_wmi_ddv_update_sensors()
245 if (time_before(jiffies, sensors->timestamp + HZ)) in dell_wmi_ddv_update_sensors()
248 kfree(sensors->obj); in dell_wmi_ddv_update_sensors()
249 sensors->obj = NULL; in dell_wmi_ddv_update_sensors()
270 sensors->obj = obj; in dell_wmi_ddv_update_sensors()
271 sensors->entries = entries; in dell_wmi_ddv_update_sensors()
272 sensors->timestamp = jiffies; in dell_wmi_ddv_update_sensors()
521 static void dell_wmi_ddv_hwmon_cache_invalidate(struct dell_wmi_ddv_sensors *sensors) in dell_wmi_ddv_hwmon_cache_invalidate() argument
523 if (!sensors->active) in dell_wmi_ddv_hwmon_cache_invalidate()
526 mutex_lock(&sensors->lock); in dell_wmi_ddv_hwmon_cache_invalidate()
527 kfree(sensors->obj); in dell_wmi_ddv_hwmon_cache_invalidate()
528 sensors->obj = NULL; in dell_wmi_ddv_hwmon_cache_invalidate()
529 mutex_unlock(&sensors->lock); in dell_wmi_ddv_hwmon_cache_invalidate()
534 struct dell_wmi_ddv_sensors *sensors = data; in dell_wmi_ddv_hwmon_cache_destroy() local
536 sensors->active = false; in dell_wmi_ddv_hwmon_cache_destroy()
537 mutex_destroy(&sensors->lock); in dell_wmi_ddv_hwmon_cache_destroy()
538 kfree(sensors->obj); in dell_wmi_ddv_hwmon_cache_destroy()
543 struct dell_wmi_ddv_sensors *sensors, in dell_wmi_ddv_channel_init() argument
551 ret = dell_wmi_ddv_update_sensors(wdev, method, sensors, entry_size); in dell_wmi_ddv_channel_init()
555 mutex_init(&sensors->lock); in dell_wmi_ddv_channel_init()
556 sensors->active = true; in dell_wmi_ddv_channel_init()
558 ret = devm_add_action_or_reset(&wdev->dev, dell_wmi_ddv_hwmon_cache_destroy, sensors); in dell_wmi_ddv_channel_init()
562 info = dell_wmi_ddv_channel_create(&wdev->dev, sensors->entries, type, config); in dell_wmi_ddv_channel_init()
564 devm_release_action(&wdev->dev, dell_wmi_ddv_hwmon_cache_destroy, sensors); in dell_wmi_ddv_channel_init()