Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * acpi/internal.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * For use by Linux/ACPI infrastructure, not drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (c) 2009, Intel Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #ifndef _ACPI_INTERNAL_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #define _ACPI_INTERNAL_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/idr.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define PREFIX "ACPI: "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) int early_acpi_osi_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) int acpi_osi_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) acpi_status acpi_os_initialize1(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) int acpi_scan_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #ifdef CONFIG_PCI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) void acpi_pci_root_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) void acpi_pci_link_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) static inline void acpi_pci_root_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) static inline void acpi_pci_link_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) void acpi_processor_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) void acpi_platform_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) void acpi_pnp_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) void acpi_int340x_thermal_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #ifdef CONFIG_ARM_AMBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) void acpi_amba_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) static inline void acpi_amba_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) int acpi_sysfs_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) void acpi_gpe_apply_masked_gpes(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) void acpi_container_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) void acpi_memory_hotplug_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #ifdef	CONFIG_ACPI_HOTPLUG_IOAPIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) void pci_ioapic_remove(struct acpi_pci_root *root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) int acpi_ioapic_remove(struct acpi_pci_root *root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) static inline void pci_ioapic_remove(struct acpi_pci_root *root) { return; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) static inline int acpi_ioapic_remove(struct acpi_pci_root *root) { return 0; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #ifdef CONFIG_ACPI_DOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) void register_dock_dependent_device(struct acpi_device *adev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 				    acpi_handle dshandle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) int dock_notify(struct acpi_device *adev, u32 event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) void acpi_dock_add(struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) static inline void register_dock_dependent_device(struct acpi_device *adev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 						  acpi_handle dshandle) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) static inline int dock_notify(struct acpi_device *adev, u32 event) { return -ENODEV; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) static inline void acpi_dock_add(struct acpi_device *adev) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) #ifdef CONFIG_X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) void acpi_cmos_rtc_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) static inline void acpi_cmos_rtc_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) int acpi_rev_override_setup(char *str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 				    const char *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 				       const char *hotplug_profile_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) void acpi_scan_hotplug_enabled(struct acpi_hotplug_profile *hotplug, bool val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #ifdef CONFIG_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) extern struct dentry *acpi_debugfs_dir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) void acpi_debugfs_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static inline void acpi_debugfs_init(void) { return; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) #ifdef CONFIG_PCI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) void acpi_lpss_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) static inline void acpi_lpss_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) void acpi_apd_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) bool acpi_queue_hotplug_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) void acpi_device_hotplug(struct acpi_device *adev, u32 src);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) void acpi_scan_table_handler(u32 event, void *table, void *context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)                      Device Node Initialization / Removal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)    -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) #define ACPI_STA_DEFAULT (ACPI_STA_DEVICE_PRESENT | ACPI_STA_DEVICE_ENABLED | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 			  ACPI_STA_DEVICE_UI | ACPI_STA_DEVICE_FUNCTIONING)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) extern struct list_head acpi_bus_id_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define ACPI_MAX_DEVICE_INSTANCES	4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) struct acpi_device_bus_id {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	const char *bus_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	struct ida instance_ida;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	struct list_head node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) int acpi_device_add(struct acpi_device *device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		    void (*release)(struct device *));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 			     int type, unsigned long long sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) int acpi_device_setup_files(struct acpi_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) void acpi_device_remove_files(struct acpi_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) void acpi_device_add_finalize(struct acpi_device *device);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) void acpi_free_pnp_ids(struct acpi_device_pnp *pnp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) bool acpi_device_is_present(const struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) bool acpi_device_is_battery(struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) bool acpi_device_is_first_physical_node(struct acpi_device *adev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 					const struct device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) int acpi_bus_register_early_device(int type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)                      Device Matching and Notification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)    -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) struct acpi_device *acpi_companion_match(const struct device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) int __acpi_device_uevent_modalias(struct acpi_device *adev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 				  struct kobj_uevent_env *env);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)                                   Power Resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)    -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) int acpi_power_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) void acpi_power_resources_list_free(struct list_head *list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 				 struct list_head *list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) int acpi_add_power_resource(acpi_handle handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) void acpi_power_add_remove_device(struct acpi_device *adev, bool add);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) int acpi_power_wakeup_list_init(struct list_head *list, int *system_level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) int acpi_device_sleep_wake(struct acpi_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 			   int enable, int sleep_state, int dev_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) int acpi_power_get_inferred_state(struct acpi_device *device, int *state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) int acpi_power_on_resources(struct acpi_device *device, int state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) int acpi_power_transition(struct acpi_device *device, int state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)                               Device Power Management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)    -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) int acpi_device_get_power(struct acpi_device *device, int *state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) int acpi_wakeup_device_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)                                   Processor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)    -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) void acpi_early_processor_set_pdc(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) static inline void acpi_early_processor_set_pdc(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) #ifdef CONFIG_X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) void acpi_early_processor_osc(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) static inline void acpi_early_processor_osc(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)                                   Embedded Controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)    -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) struct acpi_ec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	acpi_handle handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	int gpe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	int irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	unsigned long command_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	unsigned long data_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	bool global_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	unsigned long reference_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	struct mutex mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	wait_queue_head_t wait;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	struct transaction *curr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	spinlock_t lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	struct work_struct work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	unsigned long timestamp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	unsigned long nr_pending_queries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	unsigned int events_in_progress;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	unsigned int queries_in_progress;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	bool busy_polling;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	unsigned int polling_guard;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) extern struct acpi_ec *first_ec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) /* If we find an EC via the ECDT, we need to keep a ptr to its context */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) /* External interfaces use first EC only, so remember */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) typedef int (*acpi_ec_query_func) (void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) void acpi_ec_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) void acpi_ec_ecdt_probe(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) void acpi_ec_dsdt_probe(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) void acpi_ec_block_transactions(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) void acpi_ec_unblock_transactions(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 			      acpi_handle handle, acpi_ec_query_func func,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 			      void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #ifdef CONFIG_PM_SLEEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) void acpi_ec_flush_work(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) bool acpi_ec_dispatch_gpe(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) /*--------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)                                   Suspend/Resume
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)   -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) extern bool acpi_s2idle_wakeup(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) extern int acpi_sleep_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) static inline bool acpi_s2idle_wakeup(void) { return false; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) static inline int acpi_sleep_init(void) { return -ENXIO; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) #ifdef CONFIG_ACPI_SLEEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) void acpi_sleep_proc_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) int suspend_nvs_alloc(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) void suspend_nvs_free(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) int suspend_nvs_save(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) void suspend_nvs_restore(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) static inline void acpi_sleep_proc_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) static inline int suspend_nvs_alloc(void) { return 0; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) static inline void suspend_nvs_free(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) static inline int suspend_nvs_save(void) { return 0; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) static inline void suspend_nvs_restore(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) /*--------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 				Device properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)   -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #define ACPI_DT_NAMESPACE_HID	"PRP0001"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) void acpi_init_properties(struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) void acpi_free_properties(struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) #ifdef CONFIG_X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) void acpi_extract_apple_properties(struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) static inline void acpi_extract_apple_properties(struct acpi_device *adev) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /*--------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 				Watchdog
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)   -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) #ifdef CONFIG_ACPI_WATCHDOG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) void acpi_watchdog_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) static inline void acpi_watchdog_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) #ifdef CONFIG_ACPI_LPIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) void acpi_init_lpit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) static inline void acpi_init_lpit(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) #endif /* _ACPI_INTERNAL_H_ */