Files
system76-embedded-controller/src/board/system76/addw2/board.c
Tim Crawford 2a8befc195 Enable WLAN at power_on() instead of board_init()
If the board is on AC power when powered off the EC will not reset, and
WLAN power will not be enabled on next boot. Move enabling WLAN from
`board_init()` to `power_on()`.

Fixes: be4659a0cb ("Set wireless power at init and power off")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-18 19:11:01 -07:00

40 lines
941 B
C

// SPDX-License-Identifier: GPL-3.0-only
#include <board/board.h>
#include <board/gctrl.h>
#include <board/gpio.h>
#include <board/kbc.h>
#include <board/power.h>
#include <common/debug.h>
#include <ec/ec.h>
extern uint8_t main_cycle;
void board_init(void) {
// Allow backlight to be turned on
gpio_set(&BKL_EN, true);
// Enable camera
gpio_set(&CCD_EN, true);
// Assert SMI#, SCI#, and SWI#
gpio_set(&SCI_N, true);
gpio_set(&SMI_N, true);
gpio_set(&SWI_N, true);
}
void board_event(void) {
power_set_limit();
ec_read_post_codes();
if (main_cycle == 0) {
// Set keyboard LEDs
static uint8_t last_kbc_leds = 0;
if (kbc_leds != last_kbc_leds) {
gpio_set(&LED_SCROLL_N, (kbc_leds & 1) == 0);
gpio_set(&LED_NUM_N, (kbc_leds & 2) == 0);
gpio_set(&LED_CAP_N, (kbc_leds & 4) == 0);
last_kbc_leds = kbc_leds;
}
}
}