Kyösti Mälkki | e37459e | 2020-06-17 01:04:44 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef __ACPI_GNVS_H__ |
| 4 | #define __ACPI_GNVS_H__ |
| 5 | |
| 6 | #include <types.h> |
| 7 | |
Kyösti Mälkki | 4de1a31 | 2021-01-15 05:58:42 +0200 | [diff] [blame] | 8 | struct global_nvs; |
| 9 | |
Kyösti Mälkki | 4bd9187 | 2021-03-16 19:02:26 +0200 | [diff] [blame] | 10 | size_t size_of_dnvs(void); |
| 11 | |
Kyösti Mälkki | 37eb24b | 2021-01-11 18:40:37 +0200 | [diff] [blame] | 12 | #if CONFIG(ACPI_SOC_NVS) |
Kyösti Mälkki | e37459e | 2020-06-17 01:04:44 +0300 | [diff] [blame] | 13 | void *acpi_get_gnvs(void); |
Kyösti Mälkki | 4abc731 | 2021-01-12 17:46:30 +0200 | [diff] [blame] | 14 | void *acpi_get_device_nvs(void); |
Kyösti Mälkki | 4de1a31 | 2021-01-15 05:58:42 +0200 | [diff] [blame] | 15 | int acpi_reset_gnvs_for_wake(struct global_nvs **gnvs); |
Kyösti Mälkki | 37eb24b | 2021-01-11 18:40:37 +0200 | [diff] [blame] | 16 | #else |
| 17 | static inline void *acpi_get_gnvs(void) { return NULL; } |
Kyösti Mälkki | 4de1a31 | 2021-01-15 05:58:42 +0200 | [diff] [blame] | 18 | static inline int acpi_reset_gnvs_for_wake(struct global_nvs **gnvs) { return -1; } |
Kyösti Mälkki | 37eb24b | 2021-01-11 18:40:37 +0200 | [diff] [blame] | 19 | #endif |
Kyösti Mälkki | e37459e | 2020-06-17 01:04:44 +0300 | [diff] [blame] | 20 | |
Kyösti Mälkki | 027f86e | 2022-12-02 15:30:10 +0200 | [diff] [blame] | 21 | /* Return GNVS fields for USB0/1 disablement for S3/S4/S5 sleep states. */ |
| 22 | void usb_charge_mode_from_gnvs(uint8_t slp_typ, bool *usb0_disable, bool *usb1_disable); |
| 23 | |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 24 | /* |
Kyösti Mälkki | e1ff3cd | 2020-06-29 03:17:05 +0300 | [diff] [blame] | 25 | * These functions populate the gnvs structure in acpi table. |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 26 | * Defined as weak in common acpi as gnvs structure definition is |
| 27 | * chipset specific. |
| 28 | */ |
Kyösti Mälkki | 4b4e995 | 2020-06-28 21:28:54 +0300 | [diff] [blame] | 29 | void soc_fill_gnvs(struct global_nvs *gnvs); |
Kyösti Mälkki | a9766c7 | 2020-06-29 02:56:49 +0300 | [diff] [blame] | 30 | void mainboard_fill_gnvs(struct global_nvs *gnvs); |
Kyösti Mälkki | 4b4e995 | 2020-06-28 21:28:54 +0300 | [diff] [blame] | 31 | |
Kyösti Mälkki | e37459e | 2020-06-17 01:04:44 +0300 | [diff] [blame] | 32 | #endif |