diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 6 | ||||
| -rw-r--r-- | drivers/pci/pci-driver.c | 13 | ||||
| -rw-r--r-- | drivers/pci/quirks.c | 73 | ||||
| -rw-r--r-- | drivers/pci/rom.c | 5 |
4 files changed, 19 insertions, 78 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index c44311ac2fd3..16167b016266 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -1807,8 +1807,8 @@ u8 acpiphp_get_power_status(struct acpiphp_slot *slot) | |||
| 1807 | 1807 | ||
| 1808 | 1808 | ||
| 1809 | /* | 1809 | /* |
| 1810 | * latch closed: 1 | 1810 | * latch open: 1 |
| 1811 | * latch open: 0 | 1811 | * latch closed: 0 |
| 1812 | */ | 1812 | */ |
| 1813 | u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) | 1813 | u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) |
| 1814 | { | 1814 | { |
| @@ -1816,7 +1816,7 @@ u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) | |||
| 1816 | 1816 | ||
| 1817 | sta = get_slot_status(slot); | 1817 | sta = get_slot_status(slot); |
| 1818 | 1818 | ||
| 1819 | return (sta & ACPI_STA_SHOW_IN_UI) ? 1 : 0; | 1819 | return (sta & ACPI_STA_SHOW_IN_UI) ? 0 : 1; |
| 1820 | } | 1820 | } |
| 1821 | 1821 | ||
| 1822 | 1822 | ||
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index b1c0c707d96c..194f1d21d3d7 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
| @@ -265,6 +265,13 @@ static int pci_device_remove(struct device * dev) | |||
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | /* | 267 | /* |
| 268 | * If the device is still on, set the power state as "unknown", | ||
| 269 | * since it might change by the next time we load the driver. | ||
| 270 | */ | ||
| 271 | if (pci_dev->current_state == PCI_D0) | ||
| 272 | pci_dev->current_state = PCI_UNKNOWN; | ||
| 273 | |||
| 274 | /* | ||
| 268 | * We would love to complain here if pci_dev->is_enabled is set, that | 275 | * We would love to complain here if pci_dev->is_enabled is set, that |
| 269 | * the driver should have called pci_disable_device(), but the | 276 | * the driver should have called pci_disable_device(), but the |
| 270 | * unfortunate fact is there are too many odd BIOS and bridge setups | 277 | * unfortunate fact is there are too many odd BIOS and bridge setups |
| @@ -288,6 +295,12 @@ static int pci_device_suspend(struct device * dev, pm_message_t state) | |||
| 288 | suspend_report_result(drv->suspend, i); | 295 | suspend_report_result(drv->suspend, i); |
| 289 | } else { | 296 | } else { |
| 290 | pci_save_state(pci_dev); | 297 | pci_save_state(pci_dev); |
| 298 | /* | ||
| 299 | * mark its power state as "unknown", since we don't know if | ||
| 300 | * e.g. the BIOS will change its device state when we suspend. | ||
| 301 | */ | ||
| 302 | if (pci_dev->current_state == PCI_D0) | ||
| 303 | pci_dev->current_state = PCI_UNKNOWN; | ||
| 291 | } | 304 | } |
| 292 | return i; | 305 | return i; |
| 293 | } | 306 | } |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e8a7f1b1b2bc..204b1c8e972b 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
| @@ -714,33 +714,6 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev) | |||
| 714 | } | 714 | } |
| 715 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); | 715 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); |
| 716 | 716 | ||
| 717 | #ifdef CONFIG_ACPI_SLEEP | ||
| 718 | |||
| 719 | /* | ||
| 720 | * Some VIA systems boot with the abnormal status flag set. This can cause | ||
| 721 | * the BIOS to re-POST the system on resume rather than passing control | ||
| 722 | * back to the OS. Clear the flag on boot | ||
| 723 | */ | ||
| 724 | static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev) | ||
| 725 | { | ||
| 726 | u32 reg; | ||
| 727 | |||
| 728 | acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, | ||
| 729 | ®); | ||
| 730 | |||
| 731 | if (reg & 0x800) { | ||
| 732 | printk("Clearing abnormal poweroff flag\n"); | ||
| 733 | acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | ||
| 734 | ACPI_REGISTER_PM1_STATUS, | ||
| 735 | (u16)0x800); | ||
| 736 | } | ||
| 737 | } | ||
| 738 | |||
| 739 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff); | ||
| 740 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff); | ||
| 741 | |||
| 742 | #endif | ||
| 743 | |||
| 744 | /* | 717 | /* |
| 745 | * CardBus controllers have a legacy base address that enables them | 718 | * CardBus controllers have a legacy base address that enables them |
| 746 | * to respond as i82365 pcmcia controllers. We don't want them to | 719 | * to respond as i82365 pcmcia controllers. We don't want them to |
| @@ -1619,52 +1592,6 @@ static void __devinit fixup_rev1_53c810(struct pci_dev* dev) | |||
| 1619 | } | 1592 | } |
| 1620 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810); | 1593 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810); |
| 1621 | 1594 | ||
| 1622 | /* | ||
| 1623 | * Fixup to mark boot BIOS video selected by BIOS before it changes | ||
| 1624 | * | ||
| 1625 | * From information provided by "Jon Smirl" <jonsmirl@gmail.com> | ||
| 1626 | * | ||
| 1627 | * The standard boot ROM sequence for an x86 machine uses the BIOS | ||
| 1628 | * to select an initial video card for boot display. This boot video | ||
| 1629 | * card will have it's BIOS copied to C0000 in system RAM. | ||
| 1630 | * IORESOURCE_ROM_SHADOW is used to associate the boot video | ||
| 1631 | * card with this copy. On laptops this copy has to be used since | ||
| 1632 | * the main ROM may be compressed or combined with another image. | ||
| 1633 | * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW | ||
| 1634 | * is marked here since the boot video device will be the only enabled | ||
| 1635 | * video device at this point. | ||
| 1636 | */ | ||
| 1637 | |||
| 1638 | static void __devinit fixup_video(struct pci_dev *pdev) | ||
| 1639 | { | ||
| 1640 | struct pci_dev *bridge; | ||
| 1641 | struct pci_bus *bus; | ||
| 1642 | u16 config; | ||
| 1643 | |||
| 1644 | if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) | ||
| 1645 | return; | ||
| 1646 | |||
| 1647 | /* Is VGA routed to us? */ | ||
| 1648 | bus = pdev->bus; | ||
| 1649 | while (bus) { | ||
| 1650 | bridge = bus->self; | ||
| 1651 | if (bridge) { | ||
| 1652 | pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, | ||
| 1653 | &config); | ||
| 1654 | if (!(config & PCI_BRIDGE_CTL_VGA)) | ||
| 1655 | return; | ||
| 1656 | } | ||
| 1657 | bus = bus->parent; | ||
| 1658 | } | ||
| 1659 | pci_read_config_word(pdev, PCI_COMMAND, &config); | ||
| 1660 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { | ||
| 1661 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; | ||
| 1662 | printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev)); | ||
| 1663 | } | ||
| 1664 | } | ||
| 1665 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_video); | ||
| 1666 | |||
| 1667 | |||
| 1668 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end) | 1595 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end) |
| 1669 | { | 1596 | { |
| 1670 | while (f < end) { | 1597 | while (f < end) { |
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index 43e4a49f2cc4..e1dcefc69bb4 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c | |||
| @@ -72,8 +72,9 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | |||
| 72 | int last_image; | 72 | int last_image; |
| 73 | 73 | ||
| 74 | /* | 74 | /* |
| 75 | * IORESOURCE_ROM_SHADOW set if the VGA enable bit of the Bridge Control | 75 | * IORESOURCE_ROM_SHADOW set on x86, x86_64 and IA64 supports legacy |
| 76 | * register is set for embedded VGA. | 76 | * memory map if the VGA enable bit of the Bridge Control register is |
| 77 | * set for embedded VGA. | ||
| 77 | */ | 78 | */ |
| 78 | if (res->flags & IORESOURCE_ROM_SHADOW) { | 79 | if (res->flags & IORESOURCE_ROM_SHADOW) { |
| 79 | /* primary video rom always starts here */ | 80 | /* primary video rom always starts here */ |
