^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * acpi_drivers.h ($Revision: 31 $)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef __ACPI_DRIVERS_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define __ACPI_DRIVERS_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define ACPI_MAX_STRING 80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * if you add to this list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define ACPI_BUS_COMPONENT 0x00010000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define ACPI_AC_COMPONENT 0x00020000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define ACPI_BATTERY_COMPONENT 0x00040000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define ACPI_BUTTON_COMPONENT 0x00080000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define ACPI_SBS_COMPONENT 0x00100000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define ACPI_FAN_COMPONENT 0x00200000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define ACPI_PCI_COMPONENT 0x00400000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define ACPI_POWER_COMPONENT 0x00800000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define ACPI_CONTAINER_COMPONENT 0x01000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define ACPI_SYSTEM_COMPONENT 0x02000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define ACPI_THERMAL_COMPONENT 0x04000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define ACPI_VIDEO_COMPONENT 0x10000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define ACPI_PROCESSOR_COMPONENT 0x20000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * _HID definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * HIDs must conform to ACPI spec(6.1.4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * Linux specific HIDs do not apply to this and begin with LNX:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define ACPI_POWER_HID "LNXPOWER"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define ACPI_PROCESSOR_OBJECT_HID "LNXCPU"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define ACPI_SYSTEM_HID "LNXSYSTM"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define ACPI_THERMAL_HID "LNXTHERM"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define ACPI_VIDEO_HID "LNXVIDEO"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define ACPI_BAY_HID "LNXIOBAY"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define ACPI_DOCK_HID "LNXDOCK"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define ACPI_ECDT_HID "LNXEC"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /* Quirk for broken IBM BIOSes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define ACPI_SMBUS_IBM_HID "SMBUSIBM"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * For fixed hardware buttons, we fabricate acpi_devices with HID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * ACPI_BUTTON_HID_POWERF or ACPI_BUTTON_HID_SLEEPF. Fixed hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * signals only an event; it doesn't supply a notification value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * To allow drivers to treat notifications from fixed hardware the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * same as those from real devices, we turn the events into this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * notification value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define ACPI_FIXED_HARDWARE_EVENT 0x100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) PCI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) /* ACPI PCI Interrupt Link (pci_link.c) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) int acpi_irq_penalty_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) int *polarity, char **name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) int acpi_pci_link_free_irq(acpi_handle handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) /* ACPI PCI Device Binding (pci_bind.c) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) struct pci_bus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #ifdef CONFIG_PCI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) struct pci_dev *acpi_get_pci_dev(acpi_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) /* Arch-defined function to add a bus to the system */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #ifdef CONFIG_X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) void pci_acpi_crs_quirks(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) static inline void pci_acpi_crs_quirks(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /* --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) Processor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define ACPI_PROCESSOR_LIMIT_NONE 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) /*--------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) Dock Station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) -------------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #ifdef CONFIG_ACPI_DOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) extern int is_dock_device(struct acpi_device *adev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) static inline int is_dock_device(struct acpi_device *adev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #endif /* CONFIG_ACPI_DOCK */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #endif /*__ACPI_DRIVERS_H__*/