Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ad928d5 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ACPI / PM: Use ACPI_STATE_D3_COLD instead of ACPI_STATE_D3 everywhere



There are several places in the tree where ACPI_STATE_D3 is used
instead of ACPI_STATE_D3_COLD which should be used instead for
clarity.  Modify them all to use ACPI_STATE_D3_COLD as appropriate.

[The definition of ACPI_STATE_D3 itself cannot go away at this point
 as it is part of ACPICA.]

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarAaron Lu <aaron.lu@intel.com>
parent b69137a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
	if (result)
		return result;

	*state = (acpi_state == ACPI_STATE_D3 ? 0 :
	*state = (acpi_state == ACPI_STATE_D3_COLD ? 0 :
		 (acpi_state == ACPI_STATE_D0 ? 1 : -1));
	return 0;
}
@@ -108,7 +108,7 @@ fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
		return -EINVAL;

	result = acpi_bus_set_power(device->handle,
				state ? ACPI_STATE_D0 : ACPI_STATE_D3);
				state ? ACPI_STATE_D0 : ACPI_STATE_D3_COLD);

	return result;
}
+1 −1
Original line number Diff line number Diff line
@@ -786,7 +786,7 @@ int acpi_power_get_inferred_state(struct acpi_device *device, int *state)
		}
	}

	*state = ACPI_STATE_D3;
	*state = ACPI_STATE_D3_COLD;
	return 0;
}

+2 −2
Original line number Diff line number Diff line
@@ -1450,8 +1450,8 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
	/* Set defaults for D0 and D3 states (always valid) */
	device->power.states[ACPI_STATE_D0].flags.valid = 1;
	device->power.states[ACPI_STATE_D0].power = 100;
	device->power.states[ACPI_STATE_D3].flags.valid = 1;
	device->power.states[ACPI_STATE_D3].power = 0;
	device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
	device->power.states[ACPI_STATE_D3_COLD].power = 0;

	/* Set D3cold's explicit_set flag if _PS3 exists. */
	if (device->power.states[ACPI_STATE_D3_HOT].flags.explicit_set)
+2 −2
Original line number Diff line number Diff line
@@ -947,11 +947,11 @@ static void pata_acpi_set_state(struct ata_port *ap, pm_message_t state)
			continue;

		acpi_bus_set_power(dev_handle, state.event & PM_EVENT_RESUME ?
						ACPI_STATE_D0 : ACPI_STATE_D3);
					ACPI_STATE_D0 : ACPI_STATE_D3_COLD);
	}

	if (!(state.event & PM_EVENT_RESUME))
		acpi_bus_set_power(port_handle, ACPI_STATE_D3);
		acpi_bus_set_power(port_handle, ACPI_STATE_D3_COLD);
}

/**
+3 −2
Original line number Diff line number Diff line
@@ -520,11 +520,12 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
	ide_port_for_each_present_dev(i, drive, hwif) {
		if (drive->acpidata->obj_handle)
			acpi_bus_set_power(drive->acpidata->obj_handle,
					   on ? ACPI_STATE_D0 : ACPI_STATE_D3);
				on ? ACPI_STATE_D0 : ACPI_STATE_D3_COLD);
	}

	if (!on)
		acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D3);
		acpi_bus_set_power(hwif->acpidata->obj_handle,
				   ACPI_STATE_D3_COLD);
}

/**
Loading