Lines Matching refs:sens

46 	struct wf_sensor 	sens;  member
49 #define wf_to_sat(c) container_of(c, struct wf_sat_sensor, sens)
137 struct wf_sat_sensor *sens = wf_to_sat(sr); in wf_sat_sensor_get() local
138 struct wf_sat *sat = sens->sat; in wf_sat_sensor_get()
152 i = sens->index * 2; in wf_sat_sensor_get()
153 val = ((sat->cache[i] << 8) + sat->cache[i+1]) << sens->shift; in wf_sat_sensor_get()
154 if (sens->index2 >= 0) { in wf_sat_sensor_get()
155 i = sens->index2 * 2; in wf_sat_sensor_get()
179 struct wf_sat_sensor *sens = wf_to_sat(sr); in wf_sat_sensor_release() local
180 struct wf_sat *sat = sens->sat; in wf_sat_sensor_release()
182 kfree(sens); in wf_sat_sensor_release()
196 struct wf_sat_sensor *sens; in wf_sat_probe() local
263 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL); in wf_sat_probe()
264 if (sens == NULL) { in wf_sat_probe()
269 sens->index = index; in wf_sat_probe()
270 sens->index2 = -1; in wf_sat_probe()
271 sens->shift = shift; in wf_sat_probe()
272 sens->sat = sat; in wf_sat_probe()
273 sens->sens.ops = &wf_sat_ops; in wf_sat_probe()
274 sens->sens.name = (char *) (sens + 1); in wf_sat_probe()
275 snprintf((char *)sens->sens.name, 16, "%s-%d", name, cpu); in wf_sat_probe()
277 if (wf_register_sensor(&sens->sens)) in wf_sat_probe()
278 kfree(sens); in wf_sat_probe()
280 list_add(&sens->link, &sat->sensors); in wf_sat_probe()
290 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL); in wf_sat_probe()
291 if (sens == NULL) { in wf_sat_probe()
296 sens->index = vsens[core]; in wf_sat_probe()
297 sens->index2 = isens[core]; in wf_sat_probe()
298 sens->shift = 0; in wf_sat_probe()
299 sens->sat = sat; in wf_sat_probe()
300 sens->sens.ops = &wf_sat_ops; in wf_sat_probe()
301 sens->sens.name = (char *) (sens + 1); in wf_sat_probe()
302 snprintf((char *)sens->sens.name, 16, "cpu-power-%d", cpu); in wf_sat_probe()
304 if (wf_register_sensor(&sens->sens)) in wf_sat_probe()
305 kfree(sens); in wf_sat_probe()
307 list_add(&sens->link, &sat->sensors); in wf_sat_probe()
321 struct wf_sat_sensor *sens; in wf_sat_remove() local
325 sens = list_first_entry(&sat->sensors, in wf_sat_remove()
327 list_del(&sens->link); in wf_sat_remove()
328 wf_unregister_sensor(&sens->sens); in wf_sat_remove()