Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131116
b: refs/heads/master
c: b746816
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Linus Torvalds committed Feb 8, 2009
1 parent a938139 commit 47cd1dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e83102cab0fd95d4508361b061146c978b3abd60
refs/heads/master: b7468168631e03c70105491a0236137868613436
20 changes: 15 additions & 5 deletions trunk/drivers/video/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ static int aty_power_mgmt(int sleep, struct atyfb_par *par)

return timeout ? 0 : -EIO;
}
#endif
#endif /* CONFIG_PPC_PMAC */

static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
Expand All @@ -2002,9 +2002,15 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
par->asleep = 1;
par->lock_blank = 1;

/* Because we may change PCI D state ourselves, we need to
* first save the config space content so the core can
* restore it properly on resume.
*/
pci_save_state(pdev);

#ifdef CONFIG_PPC_PMAC
/* Set chip to "suspend" mode */
if (aty_power_mgmt(1, par)) {
if (machine_is(powermac) && aty_power_mgmt(1, par)) {
par->asleep = 0;
par->lock_blank = 0;
atyfb_blank(FB_BLANK_UNBLANK, info);
Expand Down Expand Up @@ -2047,11 +2053,15 @@ static int atyfb_pci_resume(struct pci_dev *pdev)

acquire_console_sem();

/* PCI state will have been restored by the core, so
* we should be in D0 now with our config space fully
* restored
*/

#ifdef CONFIG_PPC_PMAC
if (pdev->dev.power.power_state.event == 2)
if (machine_is(powermac) &&
pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
aty_power_mgmt(0, par);
#else
pci_set_power_state(pdev, PCI_D0);
#endif

aty_resume_chip(info);
Expand Down

0 comments on commit 47cd1dc

Please sign in to comment.