xref: /linux/include/acpi/acpi_drivers.h (revision b9417f84e17b93a6976a8a88b38bf9567975cb38)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  *  acpi_drivers.h  ($Revision: 31 $)
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
51da177e4SLinus Torvalds  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
61da177e4SLinus Torvalds  *
71da177e4SLinus Torvalds  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81da177e4SLinus Torvalds  *
91da177e4SLinus Torvalds  *  This program is free software; you can redistribute it and/or modify
101da177e4SLinus Torvalds  *  it under the terms of the GNU General Public License as published by
111da177e4SLinus Torvalds  *  the Free Software Foundation; either version 2 of the License, or (at
121da177e4SLinus Torvalds  *  your option) any later version.
131da177e4SLinus Torvalds  *
141da177e4SLinus Torvalds  *  This program is distributed in the hope that it will be useful, but
151da177e4SLinus Torvalds  *  WITHOUT ANY WARRANTY; without even the implied warranty of
161da177e4SLinus Torvalds  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
171da177e4SLinus Torvalds  *  General Public License for more details.
181da177e4SLinus Torvalds  *
191da177e4SLinus Torvalds  *  You should have received a copy of the GNU General Public License along
201da177e4SLinus Torvalds  *  with this program; if not, write to the Free Software Foundation, Inc.,
211da177e4SLinus Torvalds  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
221da177e4SLinus Torvalds  *
231da177e4SLinus Torvalds  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
241da177e4SLinus Torvalds  */
251da177e4SLinus Torvalds 
261da177e4SLinus Torvalds #ifndef __ACPI_DRIVERS_H__
271da177e4SLinus Torvalds #define __ACPI_DRIVERS_H__
281da177e4SLinus Torvalds 
291da177e4SLinus Torvalds #include <linux/acpi.h>
301da177e4SLinus Torvalds #include <acpi/acpi_bus.h>
311da177e4SLinus Torvalds 
321da177e4SLinus Torvalds #define ACPI_MAX_STRING			80
331da177e4SLinus Torvalds 
34bdd72799SBjorn Helgaas /*
35bdd72799SBjorn Helgaas  * Please update drivers/acpi/debug.c and Documentation/acpi/debug.txt
36bdd72799SBjorn Helgaas  * if you add to this list.
37bdd72799SBjorn Helgaas  */
381da177e4SLinus Torvalds #define ACPI_BUS_COMPONENT		0x00010000
3989595b8fSBjorn Helgaas #define ACPI_AC_COMPONENT		0x00020000
4089595b8fSBjorn Helgaas #define ACPI_BATTERY_COMPONENT		0x00040000
4189595b8fSBjorn Helgaas #define ACPI_BUTTON_COMPONENT		0x00080000
4244342f9eSBjorn Helgaas #define ACPI_SBS_COMPONENT		0x00100000
4389595b8fSBjorn Helgaas #define ACPI_FAN_COMPONENT		0x00200000
4489595b8fSBjorn Helgaas #define ACPI_PCI_COMPONENT		0x00400000
4589595b8fSBjorn Helgaas #define ACPI_POWER_COMPONENT		0x00800000
4689595b8fSBjorn Helgaas #define ACPI_CONTAINER_COMPONENT	0x01000000
471da177e4SLinus Torvalds #define ACPI_SYSTEM_COMPONENT		0x02000000
4889595b8fSBjorn Helgaas #define ACPI_THERMAL_COMPONENT		0x04000000
4989595b8fSBjorn Helgaas #define ACPI_MEMORY_DEVICE_COMPONENT	0x08000000
5044342f9eSBjorn Helgaas #define ACPI_VIDEO_COMPONENT		0x10000000
5144342f9eSBjorn Helgaas #define ACPI_PROCESSOR_COMPONENT	0x20000000
521da177e4SLinus Torvalds 
538c8eb78fSThomas Renninger /*
548c8eb78fSThomas Renninger  * _HID definitions
558c8eb78fSThomas Renninger  * HIDs must conform to ACPI spec(6.1.4)
568c8eb78fSThomas Renninger  * Linux specific HIDs do not apply to this and begin with LNX:
578c8eb78fSThomas Renninger  */
581da177e4SLinus Torvalds 
598c8eb78fSThomas Renninger #define ACPI_POWER_HID			"LNXPOWER"
60*b9417f84SBjorn Helgaas #define ACPI_PROCESSOR_OBJECT_HID	"LNXCPU"
6111bf04c4SAlexey Starikovskiy #define ACPI_PROCESSOR_HID		"ACPI0007"
628c8eb78fSThomas Renninger #define ACPI_SYSTEM_HID			"LNXSYSTM"
638c8eb78fSThomas Renninger #define ACPI_THERMAL_HID		"LNXTHERM"
648c8eb78fSThomas Renninger #define ACPI_BUTTON_HID_POWERF		"LNXPWRBN"
658c8eb78fSThomas Renninger #define ACPI_BUTTON_HID_SLEEPF		"LNXSLPBN"
668c8eb78fSThomas Renninger #define ACPI_VIDEO_HID			"LNXVIDEO"
678c8eb78fSThomas Renninger #define ACPI_BAY_HID			"LNXIOBAY"
68a340af14SFrank Seidel #define ACPI_DOCK_HID			"LNXDOCK"
698c8eb78fSThomas Renninger 
7046ec8598SBjorn Helgaas /*
7146ec8598SBjorn Helgaas  * For fixed hardware buttons, we fabricate acpi_devices with HID
7246ec8598SBjorn Helgaas  * ACPI_BUTTON_HID_POWERF or ACPI_BUTTON_HID_SLEEPF.  Fixed hardware
7346ec8598SBjorn Helgaas  * signals only an event; it doesn't supply a notification value.
7446ec8598SBjorn Helgaas  * To allow drivers to treat notifications from fixed hardware the
7546ec8598SBjorn Helgaas  * same as those from real devices, we turn the events into this
7646ec8598SBjorn Helgaas  * notification value.
7746ec8598SBjorn Helgaas  */
7846ec8598SBjorn Helgaas #define ACPI_FIXED_HARDWARE_EVENT	0x100
7946ec8598SBjorn Helgaas 
801da177e4SLinus Torvalds /* --------------------------------------------------------------------------
811da177e4SLinus Torvalds                                        PCI
821da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
831da177e4SLinus Torvalds 
841da177e4SLinus Torvalds 
851da177e4SLinus Torvalds /* ACPI PCI Interrupt Link (pci_link.c) */
861da177e4SLinus Torvalds 
871da177e4SLinus Torvalds int acpi_irq_penalty_init(void);
8850eca3ebSBob Moore int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
8950eca3ebSBob Moore 			       int *polarity, char **name);
9087bec66bSDavid Shaohua Li int acpi_pci_link_free_irq(acpi_handle handle);
911da177e4SLinus Torvalds 
921da177e4SLinus Torvalds /* ACPI PCI Interrupt Routing (pci_irq.c) */
931da177e4SLinus Torvalds 
941da177e4SLinus Torvalds int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus);
951da177e4SLinus Torvalds void acpi_pci_irq_del_prt(int segment, int bus);
961da177e4SLinus Torvalds 
971da177e4SLinus Torvalds /* ACPI PCI Device Binding (pci_bind.c) */
981da177e4SLinus Torvalds 
991da177e4SLinus Torvalds struct pci_bus;
1001da177e4SLinus Torvalds 
1014ce448e5SRajesh Shah acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id);
1021da177e4SLinus Torvalds int acpi_pci_bind(struct acpi_device *device);
1034be44fcdSLen Brown int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id,
1044be44fcdSLen Brown 		       struct pci_bus *bus);
1051da177e4SLinus Torvalds 
1061da177e4SLinus Torvalds /* Arch-defined function to add a bus to the system */
1071da177e4SLinus Torvalds 
1084be44fcdSLen Brown struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain,
1094be44fcdSLen Brown 				   int bus);
1101da177e4SLinus Torvalds 
1111da177e4SLinus Torvalds /* --------------------------------------------------------------------------
1121da177e4SLinus Torvalds                                     Processor
1131da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
1141da177e4SLinus Torvalds 
1151da177e4SLinus Torvalds #define ACPI_PROCESSOR_LIMIT_NONE	0x00
1161da177e4SLinus Torvalds #define ACPI_PROCESSOR_LIMIT_INCREMENT	0x01
1171da177e4SLinus Torvalds #define ACPI_PROCESSOR_LIMIT_DECREMENT	0x02
1181da177e4SLinus Torvalds 
1191da177e4SLinus Torvalds int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
1201da177e4SLinus Torvalds 
121fb9802faSLuming Yu /*--------------------------------------------------------------------------
122c8f7a62cSLen Brown                                   Dock Station
123c8f7a62cSLen Brown   -------------------------------------------------------------------------- */
1241253f7aaSShaohua Li struct acpi_dock_ops {
1251253f7aaSShaohua Li 	acpi_notify_handler handler;
1261253f7aaSShaohua Li 	acpi_notify_handler uevent;
1271253f7aaSShaohua Li };
1281253f7aaSShaohua Li 
129c8f7a62cSLen Brown #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
130c8f7a62cSLen Brown extern int is_dock_device(acpi_handle handle);
131c8f7a62cSLen Brown extern int register_dock_notifier(struct notifier_block *nb);
132c8f7a62cSLen Brown extern void unregister_dock_notifier(struct notifier_block *nb);
133c8f7a62cSLen Brown extern int register_hotplug_dock_device(acpi_handle handle,
1341253f7aaSShaohua Li 					struct acpi_dock_ops *ops,
135fd350943SLen Brown 					void *context);
136c8f7a62cSLen Brown extern void unregister_hotplug_dock_device(acpi_handle handle);
137c8f7a62cSLen Brown #else
138d94d3dffSAndrew Morton static inline int is_dock_device(acpi_handle handle)
139d94d3dffSAndrew Morton {
140d94d3dffSAndrew Morton 	return 0;
141d94d3dffSAndrew Morton }
142d94d3dffSAndrew Morton static inline int register_dock_notifier(struct notifier_block *nb)
143d94d3dffSAndrew Morton {
144d94d3dffSAndrew Morton 	return -ENODEV;
145d94d3dffSAndrew Morton }
146d94d3dffSAndrew Morton static inline void unregister_dock_notifier(struct notifier_block *nb)
147d94d3dffSAndrew Morton {
148d94d3dffSAndrew Morton }
149d94d3dffSAndrew Morton static inline int register_hotplug_dock_device(acpi_handle handle,
1501253f7aaSShaohua Li 					       struct acpi_dock_ops *ops,
151fd350943SLen Brown 					       void *context)
152d94d3dffSAndrew Morton {
153d94d3dffSAndrew Morton 	return -ENODEV;
154d94d3dffSAndrew Morton }
155d94d3dffSAndrew Morton static inline void unregister_hotplug_dock_device(acpi_handle handle)
156d94d3dffSAndrew Morton {
157d94d3dffSAndrew Morton }
158c8f7a62cSLen Brown #endif
159aafbcd16SAlexey Starikovskiy 
1601da177e4SLinus Torvalds #endif /*__ACPI_DRIVERS_H__*/
161