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 | { |
Eric Lai | 5e053af | 2020-11-26 12:58:10 +0800 | [diff] [blame] | 11 | const struct pad_config *pads; |
| 12 | size_t num; |
| 13 | pads = variant_gpio_table(&num); |
| 14 | gpio_configure_pads(pads, num); |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 15 | } |
| 16 | |
Eric Lai | 78b6a1b | 2020-11-27 14:11:59 +0800 | [diff] [blame] | 17 | static void mainboard_dev_init(struct device *dev) |
| 18 | { |
| 19 | mainboard_ec_init(); |
| 20 | } |
| 21 | |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 22 | static void mainboard_enable(struct device *dev) |
| 23 | { |
Eric Lai | 78b6a1b | 2020-11-27 14:11:59 +0800 | [diff] [blame] | 24 | dev->ops->init = mainboard_dev_init; |
Eric Lai | b052c4b | 2020-11-27 13:50:02 +0800 | [diff] [blame] | 25 | dev->ops->acpi_inject_dsdt = chromeos_dsdt_generator; |
Eric Lai | 5088682 | 2020-11-26 12:10:39 +0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | struct chip_operations mainboard_ops = { |
| 29 | .init = mainboard_init, |
| 30 | .enable_dev = mainboard_enable, |
| 31 | }; |