diff options
author | Kevin K Wong <kevin.k.wong@intel.com> | 2016-05-24 19:05:58 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-06-03 02:59:56 -0700 |
commit | e4c9e101e211708428d68366b4e9e2401a0bb5b7 (patch) | |
tree | 3034f95ad19ac4fd2ffe20043c015eaabffa352e /common | |
parent | fcc09a2b7d1d63ada5900bdc0a3206c748f7cbdd (diff) | |
download | chrome-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>
Diffstat (limited to 'common')
-rw-r--r-- | common/wireless.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 |