Erik Schmauss | 9585763 | 2018-03-14 16:13:07 -0700 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /****************************************************************************** |
| 3 | * |
| 4 | * Name: achware.h -- hardware specific interfaces |
| 5 | * |
Bob Moore | da6f832 | 2018-01-04 10:06:38 -0800 | [diff] [blame] | 6 | * Copyright (C) 2000 - 2018, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
Erik Schmauss | 9585763 | 2018-03-14 16:13:07 -0700 | [diff] [blame^] | 8 | *****************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
| 10 | #ifndef __ACHWARE_H__ |
| 11 | #define __ACHWARE_H__ |
| 12 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 13 | /* Values for the _SST predefined method */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 14 | |
| 15 | #define ACPI_SST_INDICATOR_OFF 0 |
| 16 | #define ACPI_SST_WORKING 1 |
| 17 | #define ACPI_SST_WAKING 2 |
| 18 | #define ACPI_SST_SLEEPING 3 |
| 19 | #define ACPI_SST_SLEEP_CONTEXT 4 |
| 20 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 21 | /* |
| 22 | * hwacpi - high level functions |
| 23 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 24 | acpi_status acpi_hw_set_mode(u32 mode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 26 | u32 acpi_hw_get_mode(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 28 | /* |
| 29 | * hwregs - ACPI Register I/O |
| 30 | */ |
Bob Moore | c6b5774 | 2009-06-24 09:44:06 +0800 | [diff] [blame] | 31 | acpi_status |
| 32 | acpi_hw_validate_register(struct acpi_generic_address *reg, |
| 33 | u8 max_bit_width, u64 *address); |
| 34 | |
Lv Zheng | 8381c54 | 2017-09-20 10:00:11 +0800 | [diff] [blame] | 35 | acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg); |
Bob Moore | c6b5774 | 2009-06-24 09:44:06 +0800 | [diff] [blame] | 36 | |
Lv Zheng | 8381c54 | 2017-09-20 10:00:11 +0800 | [diff] [blame] | 37 | acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg); |
Bob Moore | c6b5774 | 2009-06-24 09:44:06 +0800 | [diff] [blame] | 38 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 39 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Bob Moore | 32c9ef9 | 2009-02-18 14:36:05 +0800 | [diff] [blame] | 41 | acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control); |
| 42 | |
| 43 | acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 44 | |
Alexey Starikovskiy | d30dc9ab | 2007-09-30 22:39:36 +0400 | [diff] [blame] | 45 | acpi_status acpi_hw_register_write(u32 register_id, u32 value); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
Bob Moore | d8c71b6 | 2007-02-02 19:48:21 +0300 | [diff] [blame] | 47 | acpi_status acpi_hw_clear_acpi_status(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 49 | /* |
Bob Moore | 7095857 | 2012-02-14 18:47:42 +0800 | [diff] [blame] | 50 | * hwsleep - sleep/wake support (Legacy sleep registers) |
| 51 | */ |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 52 | acpi_status acpi_hw_legacy_sleep(u8 sleep_state); |
Bob Moore | 7095857 | 2012-02-14 18:47:42 +0800 | [diff] [blame] | 53 | |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 54 | acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state); |
Bob Moore | 7095857 | 2012-02-14 18:47:42 +0800 | [diff] [blame] | 55 | |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 56 | acpi_status acpi_hw_legacy_wake(u8 sleep_state); |
Bob Moore | 7095857 | 2012-02-14 18:47:42 +0800 | [diff] [blame] | 57 | |
| 58 | /* |
| 59 | * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 60 | */ |
Bob Moore | f99648b | 2012-02-14 18:43:03 +0800 | [diff] [blame] | 61 | void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 62 | |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 63 | acpi_status acpi_hw_extended_sleep(u8 sleep_state); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 64 | |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 65 | acpi_status acpi_hw_extended_wake_prep(u8 sleep_state); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 66 | |
Len Brown | 3f6f49c | 2012-07-26 20:08:54 -0400 | [diff] [blame] | 67 | acpi_status acpi_hw_extended_wake(u8 sleep_state); |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 68 | |
Bob Moore | 2feec47 | 2012-02-14 15:00:53 +0800 | [diff] [blame] | 69 | /* |
Bob Moore | 7f07190 | 2009-03-19 09:37:47 +0800 | [diff] [blame] | 70 | * hwvalid - Port I/O with validation |
| 71 | */ |
| 72 | acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width); |
| 73 | |
| 74 | acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width); |
| 75 | |
| 76 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 77 | * hwgpe - GPE support |
| 78 | */ |
Feng Tang | 1d94e1e | 2012-08-17 11:10:02 +0800 | [diff] [blame] | 79 | u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info); |
Rafael J. Wysocki | e4e9a73 | 2010-06-08 10:48:26 +0200 | [diff] [blame] | 80 | |
Rafael J. Wysocki | fd24744 | 2010-06-08 10:49:08 +0200 | [diff] [blame] | 81 | acpi_status |
Lin Ming | da50337 | 2010-12-13 13:39:37 +0800 | [diff] [blame] | 82 | acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action); |
Bob Moore | e38e8a0 | 2008-06-13 08:28:55 +0800 | [diff] [blame] | 83 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 85 | acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
Bob Moore | e97d6bf | 2008-12-30 09:45:17 +0800 | [diff] [blame] | 86 | struct acpi_gpe_block_info *gpe_block, void *context); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 87 | |
| 88 | acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
| 90 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 91 | acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
Bob Moore | e97d6bf | 2008-12-30 09:45:17 +0800 | [diff] [blame] | 92 | struct acpi_gpe_block_info *gpe_block, void *context); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 95 | acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, |
Lv Zheng | f19f1a7 | 2014-10-10 10:39:39 +0800 | [diff] [blame] | 96 | acpi_event_status *event_status); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 97 | |
| 98 | acpi_status acpi_hw_disable_all_gpes(void); |
| 99 | |
| 100 | acpi_status acpi_hw_enable_all_runtime_gpes(void); |
| 101 | |
| 102 | acpi_status acpi_hw_enable_all_wakeup_gpes(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | |
| 104 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 105 | acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
Bob Moore | e97d6bf | 2008-12-30 09:45:17 +0800 | [diff] [blame] | 106 | struct acpi_gpe_block_info *gpe_block, |
| 107 | void *context); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 109 | /* |
Bob Moore | 95abccb | 2010-09-15 13:22:46 +0800 | [diff] [blame] | 110 | * hwpci - PCI configuration support |
| 111 | */ |
| 112 | acpi_status |
| 113 | acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, |
| 114 | acpi_handle root_pci_device, acpi_handle pci_region); |
| 115 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 116 | #endif /* __ACHWARE_H__ */ |