Advertisement
Guest User

Untitled

a guest
Mar 13th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. 5593d9519364dc7f6f28c3dd8358afb907f39c0f
  2. diff --git a/bbswitch.c b/bbswitch.c
  3. index d839fa7..2646f29 100644
  4. --- a/bbswitch.c
  5. +++ b/bbswitch.c
  6. @@ -238,6 +238,20 @@ static void bbswitch_off(void) {
  7. pci_save_state(dis_dev);
  8. pci_clear_master(dis_dev);
  9. pci_disable_device(dis_dev);
  10. + do {
  11. + struct acpi_device *ad = NULL;
  12. + int r;
  13. +
  14. + r = acpi_bus_get_device(dis_handle, &ad);
  15. + if (r || !ad) {
  16. + pr_warn("Cannot get ACPI device for PCI device\n");
  17. + break;
  18. + }
  19. + if (ad->power.state == ACPI_STATE_UNKNOWN) {
  20. + pr_debug("ACPI power state is unknown, forcing D0\n");
  21. + ad->power.state = ACPI_STATE_D0;
  22. + }
  23. + } while (0);
  24. pci_set_power_state(dis_dev, PCI_D3cold);
  25.  
  26. if (bbswitch_acpi_off())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement