summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2016-05-24 19:05:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-03 02:59:56 -0700
commite4c9e101e211708428d68366b4e9e2401a0bb5b7 (patch)
tree3034f95ad19ac4fd2ffe20043c015eaabffa352e
parentfcc09a2b7d1d63ada5900bdc0a3206c748f7cbdd (diff)
downloadchrome-ec-e4c9e101e211708428d68366b4e9e2401a0bb5b7.tar.gz
reef: enable WiFi power control support
add a new config flag to support active low power control signal BUG=chrome-os-partner:53665 BRANCH=none TEST=Use multimeter to check for voltage present on the WiFi slot. Use gpioget to check GPIO state in S0 (on) and S5 (off). Change-Id: Ibeca88d16f39eadd7f29589cd3cd15aeef0dd524 Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/347085 Commit-Ready: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r--board/reef/board.h3
-rw-r--r--common/wireless.c9
-rw-r--r--include/config.h3
3 files changed, 15 insertions, 0 deletions
diff --git a/board/reef/board.h b/board/reef/board.h
index c8fd12ac5d..21136b2e31 100644
--- a/board/reef/board.h
+++ b/board/reef/board.h
@@ -80,6 +80,9 @@
/* #define CONFIG_TEMP_SENSOR */
#define CONFIG_UART_HOST 0
#define CONFIG_VBOOT_HASH
+#define CONFIG_WIRELESS
+#define CONFIG_WLAN_POWER_ACTIVE_LOW
+#define WIRELESS_GPIO_WLAN_POWER GPIO_WIRELESS_GPIO_WLAN_POWER
#define CONFIG_FLASH_SIZE 524288
#define CONFIG_SPI_FLASH_W25Q40 /* FIXME: Should be GD25LQ40? */
diff --git a/common/wireless.c b/common/wireless.c
index 54a0689906..4b420d9dde 100644
--- a/common/wireless.c
+++ b/common/wireless.c
@@ -49,8 +49,13 @@ static void wireless_enable(int flags)
#endif
#ifdef WIRELESS_GPIO_WLAN_POWER
+#ifndef CONFIG_WLAN_POWER_ACTIVE_LOW
gpio_set_level(WIRELESS_GPIO_WLAN_POWER,
flags & EC_WIRELESS_SWITCH_WLAN_POWER);
+#else
+ gpio_set_level(WIRELESS_GPIO_WLAN_POWER,
+ !(flags & EC_WIRELESS_SWITCH_WLAN_POWER));
+#endif /* CONFIG_WLAN_POWER_ACTIVE_LOW */
#endif
}
@@ -75,7 +80,11 @@ static int wireless_get(void)
#endif
#ifdef WIRELESS_GPIO_WLAN_POWER
+#ifndef CONFIG_WLAN_POWER_ACTIVE_LOW
if (gpio_get_level(WIRELESS_GPIO_WLAN_POWER))
+#else
+ if (!gpio_get_level(WIRELESS_GPIO_WLAN_POWER))
+#endif /* CONFIG_WLAN_POWER_ACTIVE_LOW */
flags |= EC_WIRELESS_SWITCH_WLAN_POWER;
#endif
diff --git a/include/config.h b/include/config.h
index 32f4214a12..c7862fdae5 100644
--- a/include/config.h
+++ b/include/config.h
@@ -2128,6 +2128,9 @@
*/
#undef CONFIG_WIRELESS_SUSPEND
+/* WiFi power control signal is active-low. */
+#undef CONFIG_WLAN_POWER_ACTIVE_LOW
+
/*
* 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.