diff options
author | David Brownell <david-b@pacbell.net> | 2006-08-15 02:11:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 00:08:37 -0400 |
commit | b887d2e63c8857149ef59eb6e05adfaa018b8ebf (patch) | |
tree | e3efb4b1c095fd2960c32d8f253679a045bf26db /drivers | |
parent | 82bb67f2c1f9ef438c56ac24e7dca027fe7289b5 (diff) |
PM: PCI and IDE handle PM_EVENT_PRETHAW
Convert some framework code to handle the new PRETHAW message.
- IDE just treats it like a FREEZE.
- The pci_choose_state() thingie still doesn't use PCI_D0 when it gets a
FREEZE (and now PRETHAW) event, which seems rather buglike but wasn't
something to change with this patch.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide.c | 6 | ||||
-rw-r--r-- | drivers/pci/pci.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index defd4b4bd374..9c8468de1a75 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1207,7 +1207,7 @@ int system_bus_clock (void) | |||
1207 | 1207 | ||
1208 | EXPORT_SYMBOL(system_bus_clock); | 1208 | EXPORT_SYMBOL(system_bus_clock); |
1209 | 1209 | ||
1210 | static int generic_ide_suspend(struct device *dev, pm_message_t state) | 1210 | static int generic_ide_suspend(struct device *dev, pm_message_t mesg) |
1211 | { | 1211 | { |
1212 | ide_drive_t *drive = dev->driver_data; | 1212 | ide_drive_t *drive = dev->driver_data; |
1213 | struct request rq; | 1213 | struct request rq; |
@@ -1221,7 +1221,9 @@ static int generic_ide_suspend(struct device *dev, pm_message_t state) | |||
1221 | rq.special = &args; | 1221 | rq.special = &args; |
1222 | rq.end_io_data = &rqpm; | 1222 | rq.end_io_data = &rqpm; |
1223 | rqpm.pm_step = ide_pm_state_start_suspend; | 1223 | rqpm.pm_step = ide_pm_state_start_suspend; |
1224 | rqpm.pm_state = state.event; | 1224 | if (mesg.event == PM_EVENT_PRETHAW) |
1225 | mesg.event = PM_EVENT_FREEZE; | ||
1226 | rqpm.pm_state = mesg.event; | ||
1225 | 1227 | ||
1226 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 1228 | return ide_do_drive_cmd(drive, &rq, ide_wait); |
1227 | } | 1229 | } |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9f79dd6d51ab..8ab027886034 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -432,10 +432,12 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) | |||
432 | case PM_EVENT_ON: | 432 | case PM_EVENT_ON: |
433 | return PCI_D0; | 433 | return PCI_D0; |
434 | case PM_EVENT_FREEZE: | 434 | case PM_EVENT_FREEZE: |
435 | case PM_EVENT_PRETHAW: | ||
436 | /* REVISIT both freeze and pre-thaw "should" use D0 */ | ||
435 | case PM_EVENT_SUSPEND: | 437 | case PM_EVENT_SUSPEND: |
436 | return PCI_D3hot; | 438 | return PCI_D3hot; |
437 | default: | 439 | default: |
438 | printk("They asked me for state %d\n", state.event); | 440 | printk("Unrecognized suspend event %d\n", state.event); |
439 | BUG(); | 441 | BUG(); |
440 | } | 442 | } |
441 | return PCI_D0; | 443 | return PCI_D0; |