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>
This commit is contained in:
Kevin K Wong
2016-05-24 19:05:58 -07:00
committed by chrome-bot
parent fcc09a2b7d
commit e4c9e101e2
3 changed files with 15 additions and 0 deletions

View File

@@ -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? */

View File

@@ -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

View File

@@ -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.