Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132499
b: refs/heads/master
c: 18a0d89
h: refs/heads/master
i:
  132497: 39c0049
  132495: 3f8013f
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Linus Torvalds committed Mar 22, 2009
1 parent 2264594 commit 2ec8e8e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65c24491b4fef017c64e39ec64384fde5e05e0a0
refs/heads/master: 18a0d89e54ca0f6f33582f99ae39867b2c975559
24 changes: 24 additions & 0 deletions trunk/drivers/video/aty/radeon_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,25 @@ static void radeon_reinitialize_QW(struct radeonfb_info *rinfo)

#endif /* CONFIG_PPC_OF */

static void radeonfb_whack_power_state(struct radeonfb_info *rinfo, pci_power_t state)
{
u16 pwr_cmd;

for (;;) {
pci_read_config_word(rinfo->pdev,
rinfo->pm_reg+PCI_PM_CTRL,
&pwr_cmd);
if (pwr_cmd & 2)
break;
pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2;
pci_write_config_word(rinfo->pdev,
rinfo->pm_reg+PCI_PM_CTRL,
pwr_cmd);
msleep(500);
}
rinfo->pdev->current_state = state;
}

static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
{
u32 tmp;
Expand Down Expand Up @@ -2558,6 +2577,11 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
/* Switch PCI power management to D2. */
pci_disable_device(rinfo->pdev);
pci_save_state(rinfo->pdev);
/* The chip seems to need us to whack the PM register
* repeatedly until it sticks. We do that -prior- to
* calling pci_set_power_state()
*/
radeonfb_whack_power_state(rinfo, PCI_D2);
pci_set_power_state(rinfo->pdev, PCI_D2);
} else {
printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n",
Expand Down

0 comments on commit 2ec8e8e

Please sign in to comment.