diff options
author | james_chao <james_chao@asus.com> | 2015-11-10 17:44:03 +0800 |
---|---|---|
committer | ChromeOS bot <3su6n15k.default@developer.gserviceaccount.com> | 2015-11-11 17:54:54 +0000 |
commit | 28bd6fb0ac4273cd39d3ebe55c3428020a48832a (patch) | |
tree | caabeebaa486d6ce3e28434aa8e3ab3af0498259 | |
parent | 56c7b1f62546e41d33382c92072fb959a672e76e (diff) | |
download | chrome-ec-28bd6fb0ac4273cd39d3ebe55c3428020a48832a.tar.gz |
Common: add wireless LED control.
Add support for a wireless LED, indicate the wireless is enable or not.
BUG=None
BRANCH=firmware-strago-7287.B
TEST=make buildall -j
Change-Id: I0583f63a23db898c04c6acb5d3ad1d43e80ba149
Signed-off-by: james_chao <james_chao@asus.com>
Reviewed-on: https://chromium-review.googlesource.com/312010
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | common/wireless.c | 13 | ||||
-rw-r--r-- | include/config.h | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/common/wireless.c b/common/wireless.c index 54a0689906..908b914b8f 100644 --- a/common/wireless.c +++ b/common/wireless.c @@ -17,6 +17,15 @@ #define CONFIG_WIRELESS_SUSPEND 0 #endif +#ifdef CONFIG_WIRELESS_LED_ACTIVE_LOW +#define WIRELESS_LED_ON 0 +#define WIRELESS_LED_OFF 1 +#else +#define WIRELESS_LED_ON 1 +#define WIRELESS_LED_OFF 0 +#endif + + /* * Flags which will be left on when suspending. Other flags will be disabled * when suspending. @@ -53,6 +62,10 @@ static void wireless_enable(int flags) flags & EC_WIRELESS_SWITCH_WLAN_POWER); #endif +#ifdef WIRELESS_GPIO_WLAN_LED + gpio_set_level(WIRELESS_GPIO_WLAN_LED, (flags & EC_WIRELESS_SWITCH_ALL) + ? WIRELESS_LED_ON : WIRELESS_LED_OFF); +#endif } static int wireless_get(void) diff --git a/include/config.h b/include/config.h index 2ed82c1ac7..c6babf7357 100644 --- a/include/config.h +++ b/include/config.h @@ -1767,6 +1767,12 @@ /*****************************************************************************/ /* + * The wireless LED may be inverted. In this case they are active low + * and the GPIO names will be GPIO_LED..._L. + */ +#undef CONFIG_WIRELESS_LED_ACTIVE_LOW + +/* * Support controlling power to WiFi, WWAN (3G/LTE), and/or bluetooth modules. */ #undef CONFIG_WIRELESS |