Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
Eric Lai | b052c4b | 2020-11-27 13:50:02 +0800 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Eric Lai | 5e053af | 2020-11-26 12:58:10 +0800 | [diff] [blame] | 4 | #include <baseboard/variants.h> |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 5 | #include <device/device.h> |
Eric Lai | 78b6a1b | 2020-11-27 14:11:59 +0800 | [diff] [blame] | 6 | #include <ec/ec.h> |
Eric Lai | b052c4b | 2020-11-27 13:50:02 +0800 | [diff] [blame] | 7 | #include <vendorcode/google/chromeos/chromeos.h> |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 8 | |
| 9 | static void mainboard_init(void *chip_info) |
| 10 | { |
Tim Wawrzynczak | 5fed159 | 2021-06-08 14:44:56 -0600 | [diff] [blame] | 11 | const struct pad_config *base_pads; |
| 12 | const struct pad_config *override_pads; |
| 13 | size_t base_num, override_num; |
| 14 | |
| 15 | base_pads = variant_gpio_table(&base_num); |
| 16 | override_pads = variant_gpio_override_table(&override_num); |
| 17 | gpio_configure_pads_with_override(base_pads, base_num, override_pads, override_num); |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 18 | } |
| 19 | |
Eric Lai | 78b6a1b | 2020-11-27 14:11:59 +0800 | [diff] [blame] | 20 | static void mainboard_dev_init(struct device *dev) |
| 21 | { |
| 22 | mainboard_ec_init(); |
| 23 | } |
| 24 | |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 25 | static void mainboard_enable(struct device *dev) |
| 26 | { |
Eric Lai | 78b6a1b | 2020-11-27 14:11:59 +0800 | [diff] [blame] | 27 | dev->ops->init = mainboard_dev_init; |
Eric Lai | b052c4b | 2020-11-27 13:50:02 +0800 | [diff] [blame] | 28 | dev->ops->acpi_inject_dsdt = chromeos_dsdt_generator; |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | struct chip_operations mainboard_ops = { |
| 32 | .init = mainboard_init, |
| 33 | .enable_dev = mainboard_enable, |
| 34 | }; |