• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
8 struct global_nvs;
9 
10 size_t size_of_dnvs(void);
11 
12 #if CONFIG(ACPI_SOC_NVS)
13 void *acpi_get_gnvs(void);
14 void *acpi_get_device_nvs(void);
15 int acpi_reset_gnvs_for_wake(struct global_nvs **gnvs);
16 #else
acpi_get_gnvs(void)17 static inline void *acpi_get_gnvs(void) { return NULL; }
acpi_reset_gnvs_for_wake(struct global_nvs ** gnvs)18 static inline int acpi_reset_gnvs_for_wake(struct global_nvs **gnvs) { return -1; }
19 #endif
20 
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 
24 /*
25  * These functions populate the gnvs structure in acpi table.
26  * Defined as weak in common acpi as gnvs structure definition is
27  * chipset specific.
28  */
29 void soc_fill_gnvs(struct global_nvs *gnvs);
30 void mainboard_fill_gnvs(struct global_nvs *gnvs);
31 
32 #endif
33