summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2014-01-17 13:07:51 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-17 23:59:46 +0000
commit064624cc2d0ca187615b07ace0b28ca7a80431ec (patch)
treef24f9122d2e9859a4f8d470ff182dc75ef4e2bb3
parent2c0292958f2d7156be1e186e7a02d53c2699e38e (diff)
downloadchrome-ec-stabilize-5254.B.tar.gz
baytrail: Add config option to enable WiFi in suspendstabilize-5254.B
Some WiFi devices do not tolerate losing power in suspend and will not function properly after resume if they have lost power. Enable this on the Rambi device. BUG=chrome-os-partner:24114 BRANCH=baytrail TEST=complete mutiple successful suspend/resume cycles on rambi and ensure that wifi continues to function and not cause a crash. Change-Id: Id421f3138e429b247bfb3f5ffb92a06c0353bb97 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/183047 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--board/rambi/board.h1
-rw-r--r--include/config.h5
-rw-r--r--power/baytrail.c9
3 files changed, 15 insertions, 0 deletions
diff --git a/board/rambi/board.h b/board/rambi/board.h
index d3ce348b7b..656e716236 100644
--- a/board/rambi/board.h
+++ b/board/rambi/board.h
@@ -39,6 +39,7 @@
#define CONFIG_USB_PORT_POWER_SMART_SIMPLE
#define CONFIG_VBOOT_HASH
#define CONFIG_WIRELESS
+#define CONFIG_WIRELESS_SUSPEND_ENABLE_WIFI
#ifndef __ASSEMBLER__
diff --git a/include/config.h b/include/config.h
index f3035c2fa9..5775ad8d58 100644
--- a/include/config.h
+++ b/include/config.h
@@ -773,6 +773,11 @@
#undef CONFIG_WIRELESS
/*
+ * Support for WiFi devices that must remain powered in suspend.
+ */
+#undef CONFIG_WIRELESS_SUSPEND_ENABLE_WIFI
+
+/*
* Write protect signal is active-high. If this is defined, there must be a
* GPIO named GPIO_WP; if not defined, there must be a GPIO names GPIO_WP_L.
*/
diff --git a/power/baytrail.c b/power/baytrail.c
index 3cb6d5df7e..e938f9298e 100644
--- a/power/baytrail.c
+++ b/power/baytrail.c
@@ -292,8 +292,14 @@ enum power_state power_handle_state(enum power_state state)
/* Disable +CPU_CORE */
gpio_set_level(GPIO_VCORE_EN, 0);
+#ifdef CONFIG_WIRELESS_SUSPEND_ENABLE_WIFI
+ /* Disable WWAN, but leave WiFi on */
+ wireless_enable(EC_WIRELESS_SWITCH_WLAN |
+ EC_WIRELESS_SWITCH_WLAN_POWER);
+#else
/* Disable wireless */
wireless_enable(0);
+#endif
/*
* Enable idle task deep sleep. Allow the low power idle task
@@ -316,6 +322,9 @@ enum power_state power_handle_state(enum power_state state)
/* Call hooks before we remove power rails */
hook_notify(HOOK_CHIPSET_SHUTDOWN);
+ /* Disable wireless */
+ wireless_enable(0);
+
/* Disable touchpad power */
gpio_set_level(GPIO_ENABLE_TOUCHPAD, 0);