Lines Matching refs:fan

90 	struct acpi_fan *fan = acpi_driver_data(device);  in fan_get_max_state()  local
92 if (fan->acpi4) in fan_get_max_state()
93 *state = fan->fps_count - 1; in fan_get_max_state()
102 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_state_acpi4() local
123 for (i = 0; i < fan->fps_count; i++) { in fan_get_state_acpi4()
130 if (fan->fif.fine_grain_ctrl && control < fan->fps[i].control) { in fan_get_state_acpi4()
133 } else if (control == fan->fps[i].control) { in fan_get_state_acpi4()
137 if (i == fan->fps_count) { in fan_get_state_acpi4()
169 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_cur_state() local
171 if (fan->acpi4) in fan_get_cur_state()
188 struct acpi_fan *fan = acpi_driver_data(device); in fan_set_state_acpi4() local
191 if (state >= fan->fps_count) in fan_set_state_acpi4()
195 fan->fps[state].control); in fan_set_state_acpi4()
208 struct acpi_fan *fan = acpi_driver_data(device); in fan_set_cur_state() local
210 if (fan->acpi4) in fan_set_cur_state()
238 struct acpi_fan *fan = acpi_driver_data(device); in acpi_fan_get_fif() local
240 struct acpi_buffer fif = { sizeof(fan->fif), &fan->fif }; in acpi_fan_get_fif()
308 struct acpi_fan *fan = acpi_driver_data(device); in acpi_fan_get_fps() local
325 fan->fps_count = obj->package.count - 1; /* minus revision field */ in acpi_fan_get_fps()
326 fan->fps = devm_kcalloc(&device->dev, in acpi_fan_get_fps()
327 fan->fps_count, sizeof(struct acpi_fan_fps), in acpi_fan_get_fps()
329 if (!fan->fps) { in acpi_fan_get_fps()
334 for (i = 0; i < fan->fps_count; i++) { in acpi_fan_get_fps()
337 &fan->fps[i] }; in acpi_fan_get_fps()
347 sort(fan->fps, fan->fps_count, sizeof(*fan->fps), in acpi_fan_get_fps()
350 for (i = 0; i < fan->fps_count; ++i) { in acpi_fan_get_fps()
351 struct acpi_fan_fps *fps = &fan->fps[i]; in acpi_fan_get_fps()
364 sysfs_remove_file(&device->dev.kobj, &fan->fps[j].dev_attr.attr); in acpi_fan_get_fps()
378 struct acpi_fan *fan; in acpi_fan_probe() local
382 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); in acpi_fan_probe()
383 if (!fan) { in acpi_fan_probe()
387 device->driver_data = fan; in acpi_fan_probe()
388 platform_set_drvdata(pdev, fan); in acpi_fan_probe()
399 fan->acpi4 = true; in acpi_fan_probe()
422 fan->cdev = cdev; in acpi_fan_probe()
440 if (fan->acpi4) { in acpi_fan_probe()
443 for (i = 0; i < fan->fps_count; ++i) in acpi_fan_probe()
444 sysfs_remove_file(&device->dev.kobj, &fan->fps[i].dev_attr.attr); in acpi_fan_probe()
452 struct acpi_fan *fan = platform_get_drvdata(pdev); in acpi_fan_remove() local
454 if (fan->acpi4) { in acpi_fan_remove()
458 for (i = 0; i < fan->fps_count; ++i) in acpi_fan_remove()
459 sysfs_remove_file(&device->dev.kobj, &fan->fps[i].dev_attr.attr); in acpi_fan_remove()
462 sysfs_remove_link(&fan->cdev->device.kobj, "device"); in acpi_fan_remove()
463 thermal_cooling_device_unregister(fan->cdev); in acpi_fan_remove()
471 struct acpi_fan *fan = dev_get_drvdata(dev); in acpi_fan_suspend() local
472 if (fan->acpi4) in acpi_fan_suspend()
483 struct acpi_fan *fan = dev_get_drvdata(dev); in acpi_fan_resume() local
485 if (fan->acpi4) in acpi_fan_resume()