Debian Codegraph @

src/mainboard/google/hatch/variants/jinlon/mainboard.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <baseboard/variants.h>
4 #include <console/console.h>
5 #include <ec/google/chromeec/ec.h>
6 #include <device/device.h>
7 #include <static.h>
8 #include <variant/sku.h>
9
10 static bool eps_sku(uint32_t sku_id)
11 {
12 /*
13 * Assume EPS SKU by default, helpful for testing on
14 * unprovisioned or development SKUs.
15 */
16 if (sku_id == JINLON_SKU_01 || sku_id == JINLON_SKU_21)
17 return false;
18 else
19 return true;
20 }
21
22 static void check_for_eps(uint32_t sku_id)
23 {
24 struct device *eps_dev = DEV_PTR(eps);
25 struct device *no_eps_dev = DEV_PTR(no_eps);
26
27 if (eps_sku(sku_id)) {
28 printk(BIOS_INFO, "SKU ID %u has EPS\n", sku_id);
29 no_eps_dev->enabled = 0;
30 return;
31 }
32
33 if (!eps_dev) {
34 printk(BIOS_ERR, "Error! No EPS dev, view-angle-management won't work\n");
35 return;
36 }
37
38 printk(BIOS_INFO, "SKU ID %u doesn't have EPS, disabling...\n", sku_id);
39 eps_dev->enabled = 0;
40 }
41
42 void variant_devtree_update(void)
43 {
44 uint32_t sku_id = google_chromeec_get_board_sku();
45
46 /* Disable EPS on SKUs that do not support it */
47 check_for_eps(sku_id);
48 }