acpi_drivers.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * acpi_drivers.h ($Revision: 31 $)
  4. *
  5. * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
  6. * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  7. */
  8. #ifndef __ACPI_DRIVERS_H__
  9. #define __ACPI_DRIVERS_H__
  10. #define ACPI_MAX_STRING 80
  11. /*
  12. * _HID definitions
  13. * HIDs must conform to ACPI spec(6.1.4)
  14. * Linux specific HIDs do not apply to this and begin with LNX:
  15. */
  16. #define ACPI_POWER_HID "LNXPOWER"
  17. #define ACPI_PROCESSOR_OBJECT_HID "LNXCPU"
  18. #define ACPI_SYSTEM_HID "LNXSYSTM"
  19. #define ACPI_THERMAL_HID "LNXTHERM"
  20. #define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
  21. #define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
  22. #define ACPI_VIDEO_HID "LNXVIDEO"
  23. #define ACPI_BAY_HID "LNXIOBAY"
  24. #define ACPI_DOCK_HID "LNXDOCK"
  25. #define ACPI_ECDT_HID "LNXEC"
  26. /* SMBUS HID definition as supported by Microsoft Windows */
  27. #define ACPI_SMBUS_MS_HID "SMB0001"
  28. /* Quirk for broken IBM BIOSes */
  29. #define ACPI_SMBUS_IBM_HID "SMBUSIBM"
  30. /*
  31. * For fixed hardware buttons, we fabricate acpi_devices with HID
  32. * ACPI_BUTTON_HID_POWERF or ACPI_BUTTON_HID_SLEEPF. Fixed hardware
  33. * signals only an event; it doesn't supply a notification value.
  34. * To allow drivers to treat notifications from fixed hardware the
  35. * same as those from real devices, we turn the events into this
  36. * notification value.
  37. */
  38. #define ACPI_FIXED_HARDWARE_EVENT 0x100
  39. /* --------------------------------------------------------------------------
  40. PCI
  41. -------------------------------------------------------------------------- */
  42. /* ACPI PCI Interrupt Link */
  43. int acpi_irq_penalty_init(void);
  44. int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
  45. int *polarity, char **name, u32 *gsi);
  46. int acpi_pci_link_free_irq(acpi_handle handle);
  47. /* ACPI PCI Device Binding */
  48. struct pci_bus;
  49. #ifdef CONFIG_PCI
  50. struct pci_dev *acpi_get_pci_dev(acpi_handle);
  51. #else
  52. static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
  53. {
  54. return NULL;
  55. }
  56. #endif
  57. /* Arch-defined function to add a bus to the system */
  58. struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root);
  59. #ifdef CONFIG_X86
  60. void pci_acpi_crs_quirks(void);
  61. #else
  62. static inline void pci_acpi_crs_quirks(void) { }
  63. #endif
  64. /*--------------------------------------------------------------------------
  65. Dock Station
  66. -------------------------------------------------------------------------- */
  67. #ifdef CONFIG_ACPI_DOCK
  68. extern int is_dock_device(struct acpi_device *adev);
  69. #else
  70. static inline int is_dock_device(struct acpi_device *adev)
  71. {
  72. return 0;
  73. }
  74. #endif /* CONFIG_ACPI_DOCK */
  75. #endif /*__ACPI_DRIVERS_H__*/