Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
0002 /******************************************************************************
0003  *
0004  * Name: achware.h -- hardware specific interfaces
0005  *
0006  * Copyright (C) 2000 - 2022, Intel Corp.
0007  *
0008  *****************************************************************************/
0009 
0010 #ifndef __ACHWARE_H__
0011 #define __ACHWARE_H__
0012 
0013 /* Values for the _SST predefined method */
0014 
0015 #define ACPI_SST_INDICATOR_OFF  0
0016 #define ACPI_SST_WORKING        1
0017 #define ACPI_SST_WAKING         2
0018 #define ACPI_SST_SLEEPING       3
0019 #define ACPI_SST_SLEEP_CONTEXT  4
0020 
0021 /*
0022  * hwacpi - high level functions
0023  */
0024 acpi_status acpi_hw_set_mode(u32 mode);
0025 
0026 u32 acpi_hw_get_mode(void);
0027 
0028 /*
0029  * hwregs - ACPI Register I/O
0030  */
0031 acpi_status
0032 acpi_hw_validate_register(struct acpi_generic_address *reg,
0033               u8 max_bit_width, u64 *address);
0034 
0035 acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg);
0036 
0037 acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg);
0038 
0039 struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
0040 
0041 acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control);
0042 
0043 acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value);
0044 
0045 acpi_status acpi_hw_register_write(u32 register_id, u32 value);
0046 
0047 acpi_status acpi_hw_clear_acpi_status(void);
0048 
0049 /*
0050  * hwsleep - sleep/wake support (Legacy sleep registers)
0051  */
0052 acpi_status acpi_hw_legacy_sleep(u8 sleep_state);
0053 
0054 acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state);
0055 
0056 acpi_status acpi_hw_legacy_wake(u8 sleep_state);
0057 
0058 /*
0059  * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
0060  */
0061 void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument);
0062 
0063 acpi_status acpi_hw_extended_sleep(u8 sleep_state);
0064 
0065 acpi_status acpi_hw_extended_wake_prep(u8 sleep_state);
0066 
0067 acpi_status acpi_hw_extended_wake(u8 sleep_state);
0068 
0069 /*
0070  * hwvalid - Port I/O with validation
0071  */
0072 acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width);
0073 
0074 acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);
0075 
0076 acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count);
0077 
0078 /*
0079  * hwgpe - GPE support
0080  */
0081 acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg);
0082 
0083 acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg);
0084 
0085 u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);
0086 
0087 acpi_status
0088 acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action);
0089 
0090 acpi_status
0091 acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
0092               struct acpi_gpe_block_info *gpe_block, void *context);
0093 
0094 acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
0095 
0096 acpi_status
0097 acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
0098             struct acpi_gpe_block_info *gpe_block, void *context);
0099 
0100 acpi_status
0101 acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
0102                acpi_event_status *event_status);
0103 
0104 acpi_status acpi_hw_disable_all_gpes(void);
0105 
0106 acpi_status acpi_hw_enable_all_runtime_gpes(void);
0107 
0108 acpi_status acpi_hw_enable_all_wakeup_gpes(void);
0109 
0110 u8 acpi_hw_check_all_gpes(acpi_handle gpe_skip_device, u32 gpe_skip_number);
0111 
0112 acpi_status
0113 acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
0114                  struct acpi_gpe_block_info *gpe_block,
0115                  void *context);
0116 
0117 #ifdef ACPI_PCI_CONFIGURED
0118 /*
0119  * hwpci - PCI configuration support
0120  */
0121 acpi_status
0122 acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
0123               acpi_handle root_pci_device, acpi_handle pci_region);
0124 #else
0125 static inline acpi_status
0126 acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, acpi_handle root_pci_device,
0127               acpi_handle pci_region)
0128 {
0129     return AE_SUPPORT;
0130 }
0131 #endif
0132 
0133 #endif              /* __ACHWARE_H__ */