achware.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
  2. /******************************************************************************
  3. *
  4. * Name: achware.h -- hardware specific interfaces
  5. *
  6. * Copyright (C) 2000 - 2018, Intel Corp.
  7. *
  8. *****************************************************************************/
  9. #ifndef __ACHWARE_H__
  10. #define __ACHWARE_H__
  11. /* Values for the _SST predefined method */
  12. #define ACPI_SST_INDICATOR_OFF 0
  13. #define ACPI_SST_WORKING 1
  14. #define ACPI_SST_WAKING 2
  15. #define ACPI_SST_SLEEPING 3
  16. #define ACPI_SST_SLEEP_CONTEXT 4
  17. /*
  18. * hwacpi - high level functions
  19. */
  20. acpi_status acpi_hw_set_mode(u32 mode);
  21. u32 acpi_hw_get_mode(void);
  22. /*
  23. * hwregs - ACPI Register I/O
  24. */
  25. acpi_status
  26. acpi_hw_validate_register(struct acpi_generic_address *reg,
  27. u8 max_bit_width, u64 *address);
  28. acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg);
  29. acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg);
  30. struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
  31. acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control);
  32. acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value);
  33. acpi_status acpi_hw_register_write(u32 register_id, u32 value);
  34. acpi_status acpi_hw_clear_acpi_status(void);
  35. /*
  36. * hwsleep - sleep/wake support (Legacy sleep registers)
  37. */
  38. acpi_status acpi_hw_legacy_sleep(u8 sleep_state);
  39. acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state);
  40. acpi_status acpi_hw_legacy_wake(u8 sleep_state);
  41. /*
  42. * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
  43. */
  44. void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument);
  45. acpi_status acpi_hw_extended_sleep(u8 sleep_state);
  46. acpi_status acpi_hw_extended_wake_prep(u8 sleep_state);
  47. acpi_status acpi_hw_extended_wake(u8 sleep_state);
  48. /*
  49. * hwvalid - Port I/O with validation
  50. */
  51. acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width);
  52. acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);
  53. /*
  54. * hwgpe - GPE support
  55. */
  56. u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);
  57. acpi_status
  58. acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action);
  59. acpi_status
  60. acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  61. struct acpi_gpe_block_info *gpe_block, void *context);
  62. acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
  63. acpi_status
  64. acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  65. struct acpi_gpe_block_info *gpe_block, void *context);
  66. acpi_status
  67. acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
  68. acpi_event_status *event_status);
  69. acpi_status acpi_hw_disable_all_gpes(void);
  70. acpi_status acpi_hw_enable_all_runtime_gpes(void);
  71. acpi_status acpi_hw_enable_all_wakeup_gpes(void);
  72. acpi_status
  73. acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  74. struct acpi_gpe_block_info *gpe_block,
  75. void *context);
  76. /*
  77. * hwpci - PCI configuration support
  78. */
  79. acpi_status
  80. acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
  81. acpi_handle root_pci_device, acpi_handle pci_region);
  82. #endif /* __ACHWARE_H__ */