Angel Pons | 60ec365 | 2020-04-03 01:22:13 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aamir Bohra | 630aa4b | 2019-12-06 19:19:19 +0530 | [diff] [blame] | 2 | |
| 3 | #include <baseboard/gpio.h> |
| 4 | #include <baseboard/variants.h> |
Kyösti Mälkki | be7692a | 2021-11-03 17:54:14 +0200 | [diff] [blame^] | 5 | #include <bootmode.h> |
Aamir Bohra | 630aa4b | 2019-12-06 19:19:19 +0530 | [diff] [blame] | 6 | #include <boot/coreboot_tables.h> |
| 7 | #include <gpio.h> |
| 8 | #include <vendorcode/google/chromeos/chromeos.h> |
| 9 | |
| 10 | void fill_lb_gpios(struct lb_gpios *gpios) |
| 11 | { |
| 12 | struct lb_gpio chromeos_gpios[] = { |
Aamir Bohra | 630aa4b | 2019-12-06 19:19:19 +0530 | [diff] [blame] | 13 | {-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, |
| 14 | {-1, ACTIVE_HIGH, 0, "power"}, |
| 15 | {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, |
| 16 | }; |
| 17 | lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); |
| 18 | } |
| 19 | |
Maulik V Vaghela | 17a478c | 2020-03-16 22:17:12 +0530 | [diff] [blame] | 20 | #if !CONFIG(EC_GOOGLE_CHROMEEC_SWITCHES) |
Aamir Bohra | 630aa4b | 2019-12-06 19:19:19 +0530 | [diff] [blame] | 21 | int get_lid_switch(void) |
| 22 | { |
| 23 | /* Lid always open */ |
| 24 | return 1; |
| 25 | } |
| 26 | |
| 27 | int get_recovery_mode_switch(void) |
| 28 | { |
| 29 | return 0; |
| 30 | } |
| 31 | |
Maulik V Vaghela | 17a478c | 2020-03-16 22:17:12 +0530 | [diff] [blame] | 32 | #endif /*!CONFIG(EC_GOOGLE_CHROMEEC_SWITCHES) */ |
| 33 | |
Aamir Bohra | 630aa4b | 2019-12-06 19:19:19 +0530 | [diff] [blame] | 34 | int get_write_protect_state(void) |
| 35 | { |
| 36 | /* No write protect */ |
| 37 | return 0; |
| 38 | } |
| 39 | |
| 40 | void mainboard_chromeos_acpi_generate(void) |
| 41 | { |
| 42 | const struct cros_gpio *gpios; |
| 43 | size_t num; |
| 44 | |
| 45 | gpios = variant_cros_gpios(&num); |
| 46 | chromeos_acpi_gpio_generate(gpios, num); |
| 47 | } |