| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <baseboard/variants.h> |
| 4 | #include <soc/pci_devs.h> |
| 5 | #include <acpi/acpi_device.h> |
| 6 | #include <static.h> |
| 7 | |
| 8 | /* |
| 9 | * This function runs only on the volteer_ti50 variant, which has the GSC on a |
| 10 | * reworked I2C bus. |
| 11 | */ |
| 12 | static void devtree_enable_i2c_tpm(void) |
| 13 | { |
| 14 | struct device *spi_tpm = DEV_PTR(spi_tpm); |
| 15 | struct device *i2c_tpm = DEV_PTR(i2c_tpm); |
| 16 | if (!i2c_tpm || !spi_tpm) |
| 17 | return; |
| 18 | spi_tpm->enabled = 0; |
| 19 | i2c_tpm->enabled = 1; |
| 20 | } |
| 21 | |
| 22 | void variant_devtree_update(void) |
| 23 | { |
| 24 | if (CONFIG(I2C_TPM)) |
| 25 | devtree_enable_i2c_tpm(); |
| 26 | } |