summaryrefslogtreecommitdiff
path: root/src/mainboard/google/dedede/variants/drawcia/variant.c
blob: 9077baec1377950f9db576233465ff3af6d35a21 (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
50
51
52
53
54
55
56
57
/* SPDX-License-Identifier: GPL-2.0-only */

#include <acpi/acpi.h>
#include <baseboard/variants.h>
#include <delay.h>
#include <drivers/intel/gma/opregion.h>
#include <fw_config.h>
#include <gpio.h>
#include <sar.h>
#include <ec/google/chromeec/ec.h>

enum {
	OSCINO_SKU_START   = 0x40004,
	OSCINO_SKU_END     = 0x40005,
};

const char *get_wifi_sar_cbfs_filename(void)
{
	uint32_t sku_id = google_chromeec_get_board_sku();

	if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED))) {

		if (sku_id >= OSCINO_SKU_START && sku_id <= OSCINO_SKU_END)
			return "wifi_sar-oscino.hex";
		else
			return "wifi_sar-drawcia.hex";
	}

	return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}

const char *mainboard_vbt_filename(void)
{
	if (fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI)) ||
		fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI_LTE)))
		return "vbt_drawman.bin";

	return "vbt.bin";
}

static void power_off_lte_module(void)
{
	gpio_output(GPP_H0, 0);
	gpio_output(GPP_H17, 0);
	mdelay(20);
	gpio_output(GPP_A10, 0);
}

void variant_smi_sleep(u8 slp_typ)
{
	/*
	 * Once the FW_CONFIG is provisioned, power off LTE module only under
	 * the situation where it is stuffed.
	 */
	if (slp_typ == ACPI_S5)
		power_off_lte_module();
}