Lines Matching +full:sens +full:-
1 // SPDX-License-Identifier: GPL-2.0-only
115 delay = next - jiffies; in wf_thread_func()
151 DBG("wf: Deleting control %s\n", ct->name); in wf_control_release()
153 if (ct->ops && ct->ops->release) in wf_control_release()
154 ct->ops->release(ct); in wf_control_release()
167 err = ctrl->ops->get_value(ctrl, &val); in wf_show_control()
169 if (err == -EFAULT) in wf_show_control()
173 switch(ctrl->type) { in wf_show_control()
199 if (endp - buf < count) in wf_store_control()
200 return -EINVAL; in wf_store_control()
201 err = ctrl->ops->set_value(ctrl, val); in wf_store_control()
213 if (!strcmp(ct->name, new_ct->name)) { in wf_register_control()
215 " duplicate control %s\n", ct->name); in wf_register_control()
217 return -EEXIST; in wf_register_control()
220 kref_init(&new_ct->ref); in wf_register_control()
221 list_add(&new_ct->link, &wf_controls); in wf_register_control()
223 sysfs_attr_init(&new_ct->attr.attr); in wf_register_control()
224 new_ct->attr.attr.name = new_ct->name; in wf_register_control()
225 new_ct->attr.attr.mode = 0644; in wf_register_control()
226 new_ct->attr.show = wf_show_control; in wf_register_control()
227 new_ct->attr.store = wf_store_control; in wf_register_control()
228 if (device_create_file(&wf_platform_device.dev, &new_ct->attr)) in wf_register_control()
230 " for %s\n", new_ct->name); in wf_register_control()
233 DBG("wf: Registered control %s\n", new_ct->name); in wf_register_control()
245 list_del(&ct->link); in wf_unregister_control()
248 DBG("wf: Unregistered control %s\n", ct->name); in wf_unregister_control()
250 kref_put(&ct->ref, wf_control_release); in wf_unregister_control()
256 if (!try_module_get(ct->ops->owner)) in wf_get_control()
257 return -ENODEV; in wf_get_control()
258 kref_get(&ct->ref); in wf_get_control()
265 struct module *mod = ct->ops->owner; in wf_put_control()
266 kref_put(&ct->ref, wf_control_release); in wf_put_control()
281 DBG("wf: Deleting sensor %s\n", sr->name); in wf_sensor_release()
283 if (sr->ops && sr->ops->release) in wf_sensor_release()
284 sr->ops->release(sr); in wf_sensor_release()
292 struct wf_sensor *sens = container_of(attr, struct wf_sensor, attr); in wf_show_sensor() local
296 err = sens->ops->get_value(sens, &val); in wf_show_sensor()
308 if (!strcmp(sr->name, new_sr->name)) { in wf_register_sensor()
310 " duplicate sensor %s\n", sr->name); in wf_register_sensor()
312 return -EEXIST; in wf_register_sensor()
315 kref_init(&new_sr->ref); in wf_register_sensor()
316 list_add(&new_sr->link, &wf_sensors); in wf_register_sensor()
318 sysfs_attr_init(&new_sr->attr.attr); in wf_register_sensor()
319 new_sr->attr.attr.name = new_sr->name; in wf_register_sensor()
320 new_sr->attr.attr.mode = 0444; in wf_register_sensor()
321 new_sr->attr.show = wf_show_sensor; in wf_register_sensor()
322 new_sr->attr.store = NULL; in wf_register_sensor()
323 if (device_create_file(&wf_platform_device.dev, &new_sr->attr)) in wf_register_sensor()
325 " for %s\n", new_sr->name); in wf_register_sensor()
328 DBG("wf: Registered sensor %s\n", new_sr->name); in wf_register_sensor()
340 list_del(&sr->link); in wf_unregister_sensor()
343 DBG("wf: Unregistered sensor %s\n", sr->name); in wf_unregister_sensor()
351 if (!try_module_get(sr->ops->owner)) in wf_get_sensor()
352 return -ENODEV; in wf_get_sensor()
353 kref_get(&sr->ref); in wf_get_sensor()
360 struct module *mod = sr->ops->owner; in wf_put_sensor()
361 kref_put(&sr->ref, wf_sensor_release); in wf_put_sensor()
398 wf_client_count--; in wf_unregister_client()
428 wf_overtemp--; in wf_clear_overtemp()