Debian Codegraph @

src/mainboard/google/dedede/variants/drawcia/variant.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <acpi/acpi.h>
4 #include <baseboard/variants.h>
5 #include <delay.h>
6 #include <drivers/intel/gma/opregion.h>
7 #include <fw_config.h>
8 #include <gpio.h>
9 #include <sar.h>
10 #include <ec/google/chromeec/ec.h>
11
12 enum {
13 OSCINO_SKU_START = 0x40004,
14 OSCINO_SKU_END = 0x40005,
15 };
16
17 const char *get_wifi_sar_cbfs_filename(void)
18 {
19 uint32_t sku_id = google_chromeec_get_board_sku();
20
21 if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED))) {
22 if (sku_id >= OSCINO_SKU_START && sku_id <= OSCINO_SKU_END)
23 return "wifi_sar-oscino.hex";
24 else
25 return "wifi_sar-drawcia.hex";
26 }
27
28 return WIFI_SAR_CBFS_DEFAULT_FILENAME;
29 }
30
31 const char *mainboard_vbt_filename(void)
32 {
33 if (fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI)) ||
34 fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI_LTE)))
35 return "vbt_drawman.bin";
36
37 return "vbt.bin";
38 }
39
40 static void power_off_lte_module(void)
41 {
42 gpio_output(GPP_H0, 0);
43 gpio_output(GPP_H17, 0);
44 mdelay(20);
45 gpio_output(GPP_A10, 0);
46 }
47
48 void variant_smi_sleep(u8 slp_typ)
49 {
50 /*
51 * Once the FW_CONFIG is provisioned, power off LTE module only under
52 * the situation where it is stuffed.
53 */
54 if (slp_typ == ACPI_S5)
55 power_off_lte_module();
56 }