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

/*
L
Len Brown 已提交
8
 * Copyright (C) 2000 - 2008, 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
 */
L
Len Brown 已提交
65
struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
L
Linus Torvalds 已提交
66

67 68 69
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 已提交
70

71
acpi_status acpi_hw_register_write(u32 register_id, u32 value);
L
Linus Torvalds 已提交
72

73
acpi_status acpi_hw_clear_acpi_status(void);
L
Linus Torvalds 已提交
74

B
Bob Moore 已提交
75 76 77 78 79 80 81
/*
 * 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 已提交
82 83 84
/*
 * hwgpe - GPE support
 */
B
Bob Moore 已提交
85 86
acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);

L
Linus Torvalds 已提交
87
acpi_status
L
Len Brown 已提交
88
acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
L
Linus Torvalds 已提交
89 90

acpi_status
L
Len Brown 已提交
91
acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
92
			  struct acpi_gpe_block_info *gpe_block, void *context);
L
Linus Torvalds 已提交
93

L
Len Brown 已提交
94
acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
L
Linus Torvalds 已提交
95 96

acpi_status
L
Len Brown 已提交
97
acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
98
			struct acpi_gpe_block_info *gpe_block, void *context);
L
Linus Torvalds 已提交
99 100

acpi_status
L
Len Brown 已提交
101 102
acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
		       acpi_event_status * event_status);
L
Linus Torvalds 已提交
103

L
Len Brown 已提交
104
acpi_status acpi_hw_disable_all_gpes(void);
L
Linus Torvalds 已提交
105

L
Len Brown 已提交
106
acpi_status acpi_hw_enable_all_runtime_gpes(void);
L
Linus Torvalds 已提交
107

L
Len Brown 已提交
108
acpi_status acpi_hw_enable_all_wakeup_gpes(void);
L
Linus Torvalds 已提交
109 110

acpi_status
L
Len Brown 已提交
111
acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
112 113
				 struct acpi_gpe_block_info *gpe_block,
				 void *context);
L
Linus Torvalds 已提交
114

R
Robert Moore 已提交
115 116 117 118
#ifdef	ACPI_FUTURE_USAGE
/*
 * hwtimer - ACPI Timer prototypes
 */
L
Len Brown 已提交
119
acpi_status acpi_get_timer_resolution(u32 * resolution);
L
Linus Torvalds 已提交
120

L
Len Brown 已提交
121
acpi_status acpi_get_timer(u32 * ticks);
L
Linus Torvalds 已提交
122 123

acpi_status
L
Len Brown 已提交
124 125
acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed);
#endif				/* ACPI_FUTURE_USAGE */
L
Linus Torvalds 已提交
126

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