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

/*
8
 * Copyright (C) 2000 - 2010, 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

B
Bob Moore 已提交
83 84 85 86 87 88 89
/*
 * 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 已提交
90 91 92
/*
 * hwgpe - GPE support
 */
93 94 95
u32 acpi_hw_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
			     struct acpi_gpe_register_info *gpe_register_info);

96 97
acpi_status
acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action);
B
Bob Moore 已提交
98

L
Linus Torvalds 已提交
99
acpi_status
L
Len Brown 已提交
100
acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
L
Linus Torvalds 已提交
101 102

acpi_status
L
Len Brown 已提交
103
acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
104
			  struct acpi_gpe_block_info *gpe_block, void *context);
L
Linus Torvalds 已提交
105

L
Len Brown 已提交
106
acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
L
Linus Torvalds 已提交
107 108

acpi_status
L
Len Brown 已提交
109
acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
110
			struct acpi_gpe_block_info *gpe_block, void *context);
L
Linus Torvalds 已提交
111 112

acpi_status
L
Len Brown 已提交
113 114
acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
		       acpi_event_status * event_status);
L
Linus Torvalds 已提交
115

L
Len Brown 已提交
116
acpi_status acpi_hw_disable_all_gpes(void);
L
Linus Torvalds 已提交
117

L
Len Brown 已提交
118
acpi_status acpi_hw_enable_all_runtime_gpes(void);
L
Linus Torvalds 已提交
119

L
Len Brown 已提交
120
acpi_status acpi_hw_enable_all_wakeup_gpes(void);
L
Linus Torvalds 已提交
121 122

acpi_status
L
Len Brown 已提交
123
acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
124 125
				 struct acpi_gpe_block_info *gpe_block,
				 void *context);
L
Linus Torvalds 已提交
126

R
Robert Moore 已提交
127 128 129 130
#ifdef	ACPI_FUTURE_USAGE
/*
 * hwtimer - ACPI Timer prototypes
 */
L
Len Brown 已提交
131
acpi_status acpi_get_timer_resolution(u32 * resolution);
L
Linus Torvalds 已提交
132

L
Len Brown 已提交
133
acpi_status acpi_get_timer(u32 * ticks);
L
Linus Torvalds 已提交
134 135

acpi_status
L
Len Brown 已提交
136 137
acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed);
#endif				/* ACPI_FUTURE_USAGE */
L
Linus Torvalds 已提交
138

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