| 1 |
|
| 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 |
|
| 14 |
|
| 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 |
|
| 47 |
check_for_eps(sku_id); |
| 48 |
} |