xref: /linux/include/acpi/acpi_drivers.h (revision ec2a9cea9fca8581b0cd3d994fb99050d61a8130)
1c942fddfSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds  *  acpi_drivers.h  ($Revision: 31 $)
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
61da177e4SLinus Torvalds  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
71da177e4SLinus Torvalds  */
81da177e4SLinus Torvalds 
91da177e4SLinus Torvalds #ifndef __ACPI_DRIVERS_H__
101da177e4SLinus Torvalds #define __ACPI_DRIVERS_H__
111da177e4SLinus Torvalds 
121da177e4SLinus Torvalds #define ACPI_MAX_STRING			80
131da177e4SLinus Torvalds 
14bdd72799SBjorn Helgaas /*
15cb1aaebeSMauro Carvalho Chehab  * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst
16bdd72799SBjorn Helgaas  * if you add to this list.
17bdd72799SBjorn Helgaas  */
181da177e4SLinus Torvalds #define ACPI_BUS_COMPONENT		0x00010000
1989595b8fSBjorn Helgaas #define ACPI_AC_COMPONENT		0x00020000
2089595b8fSBjorn Helgaas #define ACPI_BATTERY_COMPONENT		0x00040000
2189595b8fSBjorn Helgaas #define ACPI_BUTTON_COMPONENT		0x00080000
2244342f9eSBjorn Helgaas #define ACPI_SBS_COMPONENT		0x00100000
2389595b8fSBjorn Helgaas #define ACPI_FAN_COMPONENT		0x00200000
2489595b8fSBjorn Helgaas #define ACPI_PCI_COMPONENT		0x00400000
2589595b8fSBjorn Helgaas #define ACPI_POWER_COMPONENT		0x00800000
2689595b8fSBjorn Helgaas #define ACPI_CONTAINER_COMPONENT	0x01000000
271da177e4SLinus Torvalds #define ACPI_SYSTEM_COMPONENT		0x02000000
2889595b8fSBjorn Helgaas #define ACPI_THERMAL_COMPONENT		0x04000000
2989595b8fSBjorn Helgaas #define ACPI_MEMORY_DEVICE_COMPONENT	0x08000000
3044342f9eSBjorn Helgaas #define ACPI_VIDEO_COMPONENT		0x10000000
3144342f9eSBjorn Helgaas #define ACPI_PROCESSOR_COMPONENT	0x20000000
321da177e4SLinus Torvalds 
338c8eb78fSThomas Renninger /*
348c8eb78fSThomas Renninger  * _HID definitions
358c8eb78fSThomas Renninger  * HIDs must conform to ACPI spec(6.1.4)
368c8eb78fSThomas Renninger  * Linux specific HIDs do not apply to this and begin with LNX:
378c8eb78fSThomas Renninger  */
381da177e4SLinus Torvalds 
398c8eb78fSThomas Renninger #define ACPI_POWER_HID			"LNXPOWER"
40b9417f84SBjorn Helgaas #define ACPI_PROCESSOR_OBJECT_HID	"LNXCPU"
418c8eb78fSThomas Renninger #define ACPI_SYSTEM_HID			"LNXSYSTM"
428c8eb78fSThomas Renninger #define ACPI_THERMAL_HID		"LNXTHERM"
438c8eb78fSThomas Renninger #define ACPI_BUTTON_HID_POWERF		"LNXPWRBN"
448c8eb78fSThomas Renninger #define ACPI_BUTTON_HID_SLEEPF		"LNXSLPBN"
458c8eb78fSThomas Renninger #define ACPI_VIDEO_HID			"LNXVIDEO"
468c8eb78fSThomas Renninger #define ACPI_BAY_HID			"LNXIOBAY"
47a340af14SFrank Seidel #define ACPI_DOCK_HID			"LNXDOCK"
48a64a62ceSLv Zheng #define ACPI_ECDT_HID			"LNXEC"
49222e82acSDarrick J. Wong /* Quirk for broken IBM BIOSes */
50222e82acSDarrick J. Wong #define ACPI_SMBUS_IBM_HID		"SMBUSIBM"
518c8eb78fSThomas Renninger 
5246ec8598SBjorn Helgaas /*
5346ec8598SBjorn Helgaas  * For fixed hardware buttons, we fabricate acpi_devices with HID
5446ec8598SBjorn Helgaas  * ACPI_BUTTON_HID_POWERF or ACPI_BUTTON_HID_SLEEPF.  Fixed hardware
5546ec8598SBjorn Helgaas  * signals only an event; it doesn't supply a notification value.
5646ec8598SBjorn Helgaas  * To allow drivers to treat notifications from fixed hardware the
5746ec8598SBjorn Helgaas  * same as those from real devices, we turn the events into this
5846ec8598SBjorn Helgaas  * notification value.
5946ec8598SBjorn Helgaas  */
6046ec8598SBjorn Helgaas #define ACPI_FIXED_HARDWARE_EVENT	0x100
6146ec8598SBjorn Helgaas 
621da177e4SLinus Torvalds /* --------------------------------------------------------------------------
631da177e4SLinus Torvalds                                        PCI
641da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
651da177e4SLinus Torvalds 
661da177e4SLinus Torvalds 
67*ec2a9ceaSHanjun Guo /* ACPI PCI Interrupt Link */
681da177e4SLinus Torvalds 
691da177e4SLinus Torvalds int acpi_irq_penalty_init(void);
7050eca3ebSBob Moore int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
7150eca3ebSBob Moore 			       int *polarity, char **name);
7287bec66bSDavid Shaohua Li int acpi_pci_link_free_irq(acpi_handle handle);
731da177e4SLinus Torvalds 
74*ec2a9ceaSHanjun Guo /* ACPI PCI Device Binding */
751da177e4SLinus Torvalds 
761da177e4SLinus Torvalds struct pci_bus;
771da177e4SLinus Torvalds 
785d32a665SSinan Kaya #ifdef CONFIG_PCI
792f7bbcebSAlexander Chiang struct pci_dev *acpi_get_pci_dev(acpi_handle);
805d32a665SSinan Kaya #else
815d32a665SSinan Kaya static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
825d32a665SSinan Kaya {
835d32a665SSinan Kaya 	return NULL;
845d32a665SSinan Kaya }
855d32a665SSinan Kaya #endif
861da177e4SLinus Torvalds 
871da177e4SLinus Torvalds /* Arch-defined function to add a bus to the system */
881da177e4SLinus Torvalds 
8957283776SBjorn Helgaas struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root);
906b90f55fSHanjun Guo 
916b90f55fSHanjun Guo #ifdef CONFIG_X86
927bc5e3f2SBjorn Helgaas void pci_acpi_crs_quirks(void);
936b90f55fSHanjun Guo #else
946b90f55fSHanjun Guo static inline void pci_acpi_crs_quirks(void) { }
956b90f55fSHanjun Guo #endif
961da177e4SLinus Torvalds 
971da177e4SLinus Torvalds /*--------------------------------------------------------------------------
98c8f7a62cSLen Brown                                   Dock Station
99c8f7a62cSLen Brown   -------------------------------------------------------------------------- */
1001253f7aaSShaohua Li 
101e6c215f1SRafael J. Wysocki #ifdef CONFIG_ACPI_DOCK
1023b52b21fSRafael J. Wysocki extern int is_dock_device(struct acpi_device *adev);
103c8f7a62cSLen Brown #else
1043b52b21fSRafael J. Wysocki static inline int is_dock_device(struct acpi_device *adev)
105d94d3dffSAndrew Morton {
106d94d3dffSAndrew Morton 	return 0;
107d94d3dffSAndrew Morton }
108e6c215f1SRafael J. Wysocki #endif /* CONFIG_ACPI_DOCK */
109aafbcd16SAlexey Starikovskiy 
1101da177e4SLinus Torvalds #endif /*__ACPI_DRIVERS_H__*/
111