summaryrefslogtreecommitdiff
path: root/src/mainboard/google/kahlee/variants/careena/variant.c
blob: d767124c2e411ccb0dd72c0c8768ae2ac2d782ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* SPDX-License-Identifier: GPL-2.0-only */

#include <ec/google/chromeec/ec.h>
#include <baseboard/variants.h>
#include <variant/sku.h>
#include <gpio.h>
#include <variant/gpio.h>

static const struct soc_amd_gpio variant_gpio_wlan_rst_early_reset[] = {
	/* GPIO_70 - WLAN_PE_RST_L */
	PAD_GPO(GPIO_70, LOW),
};

const struct soc_amd_gpio *variant_wlan_rst_early_gpio_table(size_t *size)
{
	*size = ARRAY_SIZE(variant_gpio_wlan_rst_early_reset);
	return variant_gpio_wlan_rst_early_reset;
}

void variant_romstage_entry(int s3_resume)
{
	uint32_t sku = google_chromeec_get_sku_id();
	uint32_t bid;

	if (!s3_resume) {
		/* Based on SKU, turn on keyboard backlight */
		switch (sku) {
		default:
			google_chromeec_kbbacklight(75);
			break;
		case SKU_CAREENA_KB_BACKLIGHT18:
		case SKU_CAREENA_KB_BACKLIGHT19:
		case SKU_CAREENA_KB_BACKLIGHT22:
		case SKU_CAREENA_KB_BACKLIGHT23:
			google_chromeec_kbbacklight(10);
			break;
		}
	}

	google_chromeec_get_board_version(&bid);

	if (bid == 7)
		/*
		 * Config WLAN RST - GPIO70 PU: release RST
		 * From RTK RTL8822CE spec, WLAN RST needs to be active
		 * at least 50 ms since WLAN power on
		 */
		gpio_set(GPIO_70, 1);
}