Lines Matching defs:state
87 *state)
93 *state = fan->fps_count - 1;
95 *state = 1;
99 static int fan_get_state_acpi4(struct acpi_device *device, unsigned long *state)
109 dev_err(&device->dev, "Get fan state failed\n");
125 * When Fine Grain Control is set, return the state
143 *state = i;
150 static int fan_get_state(struct acpi_device *device, unsigned long *state)
159 *state = acpi_state == ACPI_STATE_D3_COLD
166 *state)
172 return fan_get_state_acpi4(device, state);
174 return fan_get_state(device, state);
177 static int fan_set_state(struct acpi_device *device, unsigned long state)
179 if (state != 0 && state != 1)
183 state ? ACPI_STATE_D0 : ACPI_STATE_D3_COLD);
186 static int fan_set_state_acpi4(struct acpi_device *device, unsigned long state)
191 if (state >= fan->fps_count)
195 fan->fps[state].control);
197 dev_dbg(&device->dev, "Failed to set state by _FSL\n");
205 fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
211 return fan_set_state_acpi4(device, state);
213 return fan_set_state(device, state);
346 /* sort the state array according to fan speed in increase order */
353 snprintf(fps->name, ACPI_FPS_NAME_LEN, "state%d", i);
403 dev_err(&device->dev, "Failed to set initial power state\n");
490 dev_err(dev, "Error updating fan power state\n");