libertas_usb: program OLPC EC wakeup mask for wake-on-WLAN
authorDaniel Drake <dsd@laptop.org>
Wed, 27 Jul 2011 16:19:00 +0000 (17:19 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 8 Aug 2011 20:04:18 +0000 (16:04 -0400)
OLPC power management code has recently gone upstream. This piece
completes the puzzle for libertas_usb, which now programs the OLPC EC
for wlan wakeups when they have been requested.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/if_usb.c

index e368b2922ff1071dbf5dc4095a914bcf541d1b2b..ca6e0a411e9ced8aef93585f5b62cce000ed1b8b 100644 (file)
@@ -1112,6 +1112,15 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
        if (priv->psstate != PS_STATE_FULL_POWER)
                return -1;
 
+#ifdef CONFIG_OLPC
+       if (machine_is_olpc()) {
+               if (priv->wol_criteria == EHS_REMOVE_WAKEUP)
+                       olpc_ec_wakeup_clear(EC_SCI_SRC_WLAN);
+               else
+                       olpc_ec_wakeup_set(EC_SCI_SRC_WLAN);
+       }
+#endif
+
        ret = lbs_suspend(priv);
        if (ret)
                goto out;