achware.h 4.9 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7
/******************************************************************************
 *
 * Name: achware.h -- hardware specific interfaces
 *
 *****************************************************************************/

/*
8
 * Copyright (C) 2000 - 2014, Intel Corp.
L
Linus Torvalds 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */

#ifndef __ACHWARE_H__
#define __ACHWARE_H__

47
/* Values for the _SST predefined method */
L
Linus Torvalds 已提交
48

R
Robert Moore 已提交
49 50 51 52 53
#define ACPI_SST_INDICATOR_OFF  0
#define ACPI_SST_WORKING        1
#define ACPI_SST_WAKING         2
#define ACPI_SST_SLEEPING       3
#define ACPI_SST_SLEEP_CONTEXT  4
L
Linus Torvalds 已提交
54

R
Robert Moore 已提交
55 56 57
/*
 * hwacpi - high level functions
 */
L
Len Brown 已提交
58
acpi_status acpi_hw_set_mode(u32 mode);
L
Linus Torvalds 已提交
59

L
Len Brown 已提交
60
u32 acpi_hw_get_mode(void);
L
Linus Torvalds 已提交
61

R
Robert Moore 已提交
62 63 64
/*
 * hwregs - ACPI Register I/O
 */
65 66 67 68 69 70 71 72
acpi_status
acpi_hw_validate_register(struct acpi_generic_address *reg,
			  u8 max_bit_width, u64 *address);

acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg);

acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg);

L
Len Brown 已提交
73
struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
L
Linus Torvalds 已提交
74

75 76 77
acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control);

acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value);
L
Linus Torvalds 已提交
78

79
acpi_status acpi_hw_register_write(u32 register_id, u32 value);
L
Linus Torvalds 已提交
80

81
acpi_status acpi_hw_clear_acpi_status(void);
L
Linus Torvalds 已提交
82

83
/*
84 85
 * hwsleep - sleep/wake support (Legacy sleep registers)
 */
L
Len Brown 已提交
86
acpi_status acpi_hw_legacy_sleep(u8 sleep_state);
87

L
Len Brown 已提交
88
acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state);
89

L
Len Brown 已提交
90
acpi_status acpi_hw_legacy_wake(u8 sleep_state);
91 92 93

/*
 * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
94
 */
95
void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument);
96

L
Len Brown 已提交
97
acpi_status acpi_hw_extended_sleep(u8 sleep_state);
98

L
Len Brown 已提交
99
acpi_status acpi_hw_extended_wake_prep(u8 sleep_state);
100

L
Len Brown 已提交
101
acpi_status acpi_hw_extended_wake(u8 sleep_state);
102

B
Bob Moore 已提交
103 104 105 106 107 108 109
/*
 * hwvalid - Port I/O with validation
 */
acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width);

acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);

R
Robert Moore 已提交
110 111 112
/*
 * hwgpe - GPE support
 */
113
u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);
114

115
acpi_status
116
acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action);
B
Bob Moore 已提交
117

L
Linus Torvalds 已提交
118
acpi_status
L
Len Brown 已提交
119
acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
120
			  struct acpi_gpe_block_info *gpe_block, void *context);
L
Linus Torvalds 已提交
121

L
Len Brown 已提交
122
acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
L
Linus Torvalds 已提交
123 124

acpi_status
L
Len Brown 已提交
125
acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
126
			struct acpi_gpe_block_info *gpe_block, void *context);
L
Linus Torvalds 已提交
127 128

acpi_status
L
Len Brown 已提交
129 130
acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
		       acpi_event_status * event_status);
L
Linus Torvalds 已提交
131

L
Len Brown 已提交
132
acpi_status acpi_hw_disable_all_gpes(void);
L
Linus Torvalds 已提交
133

L
Len Brown 已提交
134
acpi_status acpi_hw_enable_all_runtime_gpes(void);
L
Linus Torvalds 已提交
135

L
Len Brown 已提交
136
acpi_status acpi_hw_enable_all_wakeup_gpes(void);
L
Linus Torvalds 已提交
137 138

acpi_status
L
Len Brown 已提交
139
acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
140 141
				 struct acpi_gpe_block_info *gpe_block,
				 void *context);
L
Linus Torvalds 已提交
142

143 144 145 146 147 148 149
/*
 * hwpci - PCI configuration support
 */
acpi_status
acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
		      acpi_handle root_pci_device, acpi_handle pci_region);

L
Len Brown 已提交
150
#endif				/* __ACHWARE_H__ */