Lines Matching refs:pow
289 struct smu_cpu_power_sensor *pow = to_smu_cpu_power(sr); in smu_cpu_power_release() local
291 if (pow->volts) in smu_cpu_power_release()
292 wf_put_sensor(pow->volts); in smu_cpu_power_release()
293 if (pow->amps) in smu_cpu_power_release()
294 wf_put_sensor(pow->amps); in smu_cpu_power_release()
295 kfree(pow); in smu_cpu_power_release()
300 struct smu_cpu_power_sensor *pow = to_smu_cpu_power(sr); in smu_cpu_power_get() local
305 rc = pow->amps->ops->get_value(pow->amps, &s); in smu_cpu_power_get()
309 if (pow->fake_volts) { in smu_cpu_power_get()
314 rc = pow->volts->ops->get_value(pow->volts, &volts); in smu_cpu_power_get()
319 if (!pow->quadratic) { in smu_cpu_power_get()
341 struct smu_cpu_power_sensor *pow; in smu_cpu_power_create() local
343 pow = kmalloc(sizeof(struct smu_cpu_power_sensor), GFP_KERNEL); in smu_cpu_power_create()
344 if (pow == NULL) in smu_cpu_power_create()
346 pow->sens.ops = &smu_cpu_power_ops; in smu_cpu_power_create()
347 pow->sens.name = "cpu-power"; in smu_cpu_power_create()
350 pow->volts = volts; in smu_cpu_power_create()
352 pow->amps = amps; in smu_cpu_power_create()
358 pow->fake_volts = 1; in smu_cpu_power_create()
360 pow->fake_volts = 0; in smu_cpu_power_create()
370 pow->quadratic = 1; in smu_cpu_power_create()
373 pow->quadratic = 0; in smu_cpu_power_create()
375 if (wf_register_sensor(&pow->sens)) in smu_cpu_power_create()
377 return pow; in smu_cpu_power_create()
379 kfree(pow); in smu_cpu_power_create()