diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 5e88a060df06..e96212ce5729 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -396,8 +396,9 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) | |||
396 | hwif->cds = tmp_hwif->cds; | 396 | hwif->cds = tmp_hwif->cds; |
397 | #endif | 397 | #endif |
398 | 398 | ||
399 | hwif->tuneproc = tmp_hwif->tuneproc; | 399 | hwif->set_pio_mode = tmp_hwif->set_pio_mode; |
400 | hwif->speedproc = tmp_hwif->speedproc; | 400 | hwif->speedproc = tmp_hwif->speedproc; |
401 | hwif->mdma_filter = tmp_hwif->mdma_filter; | ||
401 | hwif->udma_filter = tmp_hwif->udma_filter; | 402 | hwif->udma_filter = tmp_hwif->udma_filter; |
402 | hwif->selectproc = tmp_hwif->selectproc; | 403 | hwif->selectproc = tmp_hwif->selectproc; |
403 | hwif->reset_poll = tmp_hwif->reset_poll; | 404 | hwif->reset_poll = tmp_hwif->reset_poll; |
@@ -866,8 +867,9 @@ int set_pio_mode(ide_drive_t *drive, int arg) | |||
866 | if (arg < 0 || arg > 255) | 867 | if (arg < 0 || arg > 255) |
867 | return -EINVAL; | 868 | return -EINVAL; |
868 | 869 | ||
869 | if (!HWIF(drive)->tuneproc) | 870 | if (drive->hwif->set_pio_mode == NULL) |
870 | return -ENOSYS; | 871 | return -ENOSYS; |
872 | |||
871 | if (drive->special.b.set_tune) | 873 | if (drive->special.b.set_tune) |
872 | return -EBUSY; | 874 | return -EBUSY; |
873 | ide_init_drive_cmd(&rq); | 875 | ide_init_drive_cmd(&rq); |
@@ -914,6 +916,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
914 | struct request rq; | 916 | struct request rq; |
915 | struct request_pm_state rqpm; | 917 | struct request_pm_state rqpm; |
916 | ide_task_t args; | 918 | ide_task_t args; |
919 | int ret; | ||
917 | 920 | ||
918 | /* Call ACPI _GTM only once */ | 921 | /* Call ACPI _GTM only once */ |
919 | if (!(drive->dn % 2)) | 922 | if (!(drive->dn % 2)) |
@@ -930,7 +933,14 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
930 | mesg.event = PM_EVENT_FREEZE; | 933 | mesg.event = PM_EVENT_FREEZE; |
931 | rqpm.pm_state = mesg.event; | 934 | rqpm.pm_state = mesg.event; |
932 | 935 | ||
933 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 936 | ret = ide_do_drive_cmd(drive, &rq, ide_wait); |
937 | /* only call ACPI _PS3 after both drivers are suspended */ | ||
938 | if (!ret && (((drive->dn % 2) && hwif->drives[0].present | ||
939 | && hwif->drives[1].present) | ||
940 | || !hwif->drives[0].present | ||
941 | || !hwif->drives[1].present)) | ||
942 | ide_acpi_set_state(hwif, 0); | ||
943 | return ret; | ||
934 | } | 944 | } |
935 | 945 | ||
936 | static int generic_ide_resume(struct device *dev) | 946 | static int generic_ide_resume(struct device *dev) |
@@ -943,8 +953,10 @@ static int generic_ide_resume(struct device *dev) | |||
943 | int err; | 953 | int err; |
944 | 954 | ||
945 | /* Call ACPI _STM only once */ | 955 | /* Call ACPI _STM only once */ |
946 | if (!(drive->dn % 2)) | 956 | if (!(drive->dn % 2)) { |
957 | ide_acpi_set_state(hwif, 1); | ||
947 | ide_acpi_push_timing(hwif); | 958 | ide_acpi_push_timing(hwif); |
959 | } | ||
948 | 960 | ||
949 | ide_acpi_exec_tfs(drive); | 961 | ide_acpi_exec_tfs(drive); |
950 | 962 | ||