achware.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /******************************************************************************
  2. *
  3. * Name: achware.h -- hardware specific interfaces
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACHWARE_H__
  43. #define __ACHWARE_H__
  44. /* PM Timer ticks per second (HZ) */
  45. #define PM_TIMER_FREQUENCY 3579545
  46. /* Prototypes */
  47. acpi_status
  48. acpi_hw_initialize (
  49. void);
  50. acpi_status
  51. acpi_hw_shutdown (
  52. void);
  53. acpi_status
  54. acpi_hw_initialize_system_info (
  55. void);
  56. acpi_status
  57. acpi_hw_set_mode (
  58. u32 mode);
  59. u32
  60. acpi_hw_get_mode (
  61. void);
  62. u32
  63. acpi_hw_get_mode_capabilities (
  64. void);
  65. /* Register I/O Prototypes */
  66. struct acpi_bit_register_info *
  67. acpi_hw_get_bit_register_info (
  68. u32 register_id);
  69. acpi_status
  70. acpi_hw_register_read (
  71. u8 use_lock,
  72. u32 register_id,
  73. u32 *return_value);
  74. acpi_status
  75. acpi_hw_register_write (
  76. u8 use_lock,
  77. u32 register_id,
  78. u32 value);
  79. acpi_status
  80. acpi_hw_low_level_read (
  81. u32 width,
  82. u32 *value,
  83. struct acpi_generic_address *reg);
  84. acpi_status
  85. acpi_hw_low_level_write (
  86. u32 width,
  87. u32 value,
  88. struct acpi_generic_address *reg);
  89. acpi_status
  90. acpi_hw_clear_acpi_status (
  91. u32 flags);
  92. /* GPE support */
  93. acpi_status
  94. acpi_hw_write_gpe_enable_reg (
  95. struct acpi_gpe_event_info *gpe_event_info);
  96. acpi_status
  97. acpi_hw_disable_gpe_block (
  98. struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  99. struct acpi_gpe_block_info *gpe_block);
  100. acpi_status
  101. acpi_hw_clear_gpe (
  102. struct acpi_gpe_event_info *gpe_event_info);
  103. acpi_status
  104. acpi_hw_clear_gpe_block (
  105. struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  106. struct acpi_gpe_block_info *gpe_block);
  107. #ifdef ACPI_FUTURE_USAGE
  108. acpi_status
  109. acpi_hw_get_gpe_status (
  110. struct acpi_gpe_event_info *gpe_event_info,
  111. acpi_event_status *event_status);
  112. #endif
  113. acpi_status
  114. acpi_hw_disable_all_gpes (
  115. u32 flags);
  116. acpi_status
  117. acpi_hw_enable_all_runtime_gpes (
  118. u32 flags);
  119. acpi_status
  120. acpi_hw_enable_all_wakeup_gpes (
  121. u32 flags);
  122. acpi_status
  123. acpi_hw_enable_runtime_gpe_block (
  124. struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  125. struct acpi_gpe_block_info *gpe_block);
  126. acpi_status
  127. acpi_hw_enable_wakeup_gpe_block (
  128. struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  129. struct acpi_gpe_block_info *gpe_block);
  130. /* ACPI Timer prototypes */
  131. #ifdef ACPI_FUTURE_USAGE
  132. acpi_status
  133. acpi_get_timer_resolution (
  134. u32 *resolution);
  135. acpi_status
  136. acpi_get_timer (
  137. u32 *ticks);
  138. acpi_status
  139. acpi_get_timer_duration (
  140. u32 start_ticks,
  141. u32 end_ticks,
  142. u32 *time_elapsed);
  143. #endif /* ACPI_FUTURE_USAGE */
  144. #endif /* __ACHWARE_H__ */