blob: 43ce67a9da1fc19d08f4366c244ab3105369fd3f [file] [log] [blame]
Erik Schmauss95857632018-03-14 16:13:07 -07001/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/******************************************************************************
3 *
4 * Name: achware.h -- hardware specific interfaces
5 *
Bob Mooreda6f8322018-01-04 10:06:38 -08006 * Copyright (C) 2000 - 2018, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
Erik Schmauss95857632018-03-14 16:13:07 -07008 *****************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10#ifndef __ACHWARE_H__
11#define __ACHWARE_H__
12
Bob Moore50df4d82008-12-31 03:01:23 +080013/* Values for the _SST predefined method */
Robert Moore44f6c012005-04-18 22:49:35 -040014
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 Moore44f6c012005-04-18 22:49:35 -040021/*
22 * hwacpi - high level functions
23 */
Len Brown4be44fc2005-08-05 00:44:28 -040024acpi_status acpi_hw_set_mode(u32 mode);
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Len Brown4be44fc2005-08-05 00:44:28 -040026u32 acpi_hw_get_mode(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Robert Moore44f6c012005-04-18 22:49:35 -040028/*
29 * hwregs - ACPI Register I/O
30 */
Bob Moorec6b57742009-06-24 09:44:06 +080031acpi_status
32acpi_hw_validate_register(struct acpi_generic_address *reg,
33 u8 max_bit_width, u64 *address);
34
Lv Zheng8381c542017-09-20 10:00:11 +080035acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg);
Bob Moorec6b57742009-06-24 09:44:06 +080036
Lv Zheng8381c542017-09-20 10:00:11 +080037acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg);
Bob Moorec6b57742009-06-24 09:44:06 +080038
Len Brown4be44fc2005-08-05 00:44:28 -040039struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Bob Moore32c9ef92009-02-18 14:36:05 +080041acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control);
42
43acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value);
Len Brown4be44fc2005-08-05 00:44:28 -040044
Alexey Starikovskiyd30dc9ab2007-09-30 22:39:36 +040045acpi_status acpi_hw_register_write(u32 register_id, u32 value);
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Bob Moored8c71b62007-02-02 19:48:21 +030047acpi_status acpi_hw_clear_acpi_status(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Robert Moore44f6c012005-04-18 22:49:35 -040049/*
Bob Moore70958572012-02-14 18:47:42 +080050 * hwsleep - sleep/wake support (Legacy sleep registers)
51 */
Len Brown3f6f49c2012-07-26 20:08:54 -040052acpi_status acpi_hw_legacy_sleep(u8 sleep_state);
Bob Moore70958572012-02-14 18:47:42 +080053
Len Brown3f6f49c2012-07-26 20:08:54 -040054acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state);
Bob Moore70958572012-02-14 18:47:42 +080055
Len Brown3f6f49c2012-07-26 20:08:54 -040056acpi_status acpi_hw_legacy_wake(u8 sleep_state);
Bob Moore70958572012-02-14 18:47:42 +080057
58/*
59 * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
Bob Moore2feec472012-02-14 15:00:53 +080060 */
Bob Mooref99648b2012-02-14 18:43:03 +080061void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument);
Bob Moore2feec472012-02-14 15:00:53 +080062
Len Brown3f6f49c2012-07-26 20:08:54 -040063acpi_status acpi_hw_extended_sleep(u8 sleep_state);
Bob Moore2feec472012-02-14 15:00:53 +080064
Len Brown3f6f49c2012-07-26 20:08:54 -040065acpi_status acpi_hw_extended_wake_prep(u8 sleep_state);
Bob Moore2feec472012-02-14 15:00:53 +080066
Len Brown3f6f49c2012-07-26 20:08:54 -040067acpi_status acpi_hw_extended_wake(u8 sleep_state);
Bob Moore2feec472012-02-14 15:00:53 +080068
Bob Moore2feec472012-02-14 15:00:53 +080069/*
Bob Moore7f071902009-03-19 09:37:47 +080070 * hwvalid - Port I/O with validation
71 */
72acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width);
73
74acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);
75
76/*
Robert Moore44f6c012005-04-18 22:49:35 -040077 * hwgpe - GPE support
78 */
Feng Tang1d94e1e2012-08-17 11:10:02 +080079u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020080
Rafael J. Wysockifd247442010-06-08 10:49:08 +020081acpi_status
Lin Mingda503372010-12-13 13:39:37 +080082acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action);
Bob Mooree38e8a02008-06-13 08:28:55 +080083
Linus Torvalds1da177e2005-04-16 15:20:36 -070084acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040085acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +080086 struct acpi_gpe_block_info *gpe_block, void *context);
Len Brown4be44fc2005-08-05 00:44:28 -040087
88acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
90acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040091acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +080092 struct acpi_gpe_block_info *gpe_block, void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
Linus Torvalds1da177e2005-04-16 15:20:36 -070094acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040095acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
Lv Zhengf19f1a72014-10-10 10:39:39 +080096 acpi_event_status *event_status);
Len Brown4be44fc2005-08-05 00:44:28 -040097
98acpi_status acpi_hw_disable_all_gpes(void);
99
100acpi_status acpi_hw_enable_all_runtime_gpes(void);
101
102acpi_status acpi_hw_enable_all_wakeup_gpes(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
104acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400105acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +0800106 struct acpi_gpe_block_info *gpe_block,
107 void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
Robert Moore44f6c012005-04-18 22:49:35 -0400109/*
Bob Moore95abccb2010-09-15 13:22:46 +0800110 * hwpci - PCI configuration support
111 */
112acpi_status
113acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
114 acpi_handle root_pci_device, acpi_handle pci_region);
115
Len Brown4be44fc2005-08-05 00:44:28 -0400116#endif /* __ACHWARE_H__ */