/* This function executes the _PS0/_PS3 ACPI method to set the power state. ACPI spec requires _PS0 when IDE power on and _PS3 when power off  */
void ide_acpi_set_state(ide_hwif_t *hwif, int on)
/* This function executes the _PS0/_PS3 ACPI method to set the power state. ACPI spec requires _PS0 when IDE power on and _PS3 when power off  */
void ide_acpi_set_state(ide_hwif_t *hwif, int on)
{
	ide_drive_t *drive;
	int i;
	if (ide_noacpi_psx)
		return;
	DEBPRINT("ENTER:\n");
	if (on)
		acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0);
	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);
	}
	if (!on)
		acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D3);
}