xref: /linux/include/acpi/acpi_drivers.h (revision 89595b8f2850a080d290bf778ec933ea1d99f78e)
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 
341da177e4SLinus Torvalds #define ACPI_BUS_COMPONENT		0x00010000
35*89595b8fSBjorn Helgaas #define ACPI_AC_COMPONENT		0x00020000
36*89595b8fSBjorn Helgaas #define ACPI_BATTERY_COMPONENT		0x00040000
37*89595b8fSBjorn Helgaas #define ACPI_BUTTON_COMPONENT		0x00080000
38*89595b8fSBjorn Helgaas #define ACPI_SBS_COMPONENT		0x00080000
39*89595b8fSBjorn Helgaas #define ACPI_FAN_COMPONENT		0x00200000
40*89595b8fSBjorn Helgaas #define ACPI_PCI_COMPONENT		0x00400000
41*89595b8fSBjorn Helgaas #define ACPI_POWER_COMPONENT		0x00800000
42*89595b8fSBjorn Helgaas #define ACPI_CONTAINER_COMPONENT	0x01000000
43*89595b8fSBjorn Helgaas #define ACPI_PROCESSOR_COMPONENT	0x01000000
441da177e4SLinus Torvalds #define ACPI_SYSTEM_COMPONENT		0x02000000
45*89595b8fSBjorn Helgaas #define ACPI_THERMAL_COMPONENT		0x04000000
46*89595b8fSBjorn Helgaas #define ACPI_MEMORY_DEVICE_COMPONENT	0x08000000
47*89595b8fSBjorn Helgaas #define ACPI_VIDEO_COMPONENT		0x08000000
481da177e4SLinus Torvalds 
498c8eb78fSThomas Renninger /*
508c8eb78fSThomas Renninger  * _HID definitions
518c8eb78fSThomas Renninger  * HIDs must conform to ACPI spec(6.1.4)
528c8eb78fSThomas Renninger  * Linux specific HIDs do not apply to this and begin with LNX:
538c8eb78fSThomas Renninger  */
541da177e4SLinus Torvalds 
558c8eb78fSThomas Renninger #define ACPI_POWER_HID			"LNXPOWER"
5611bf04c4SAlexey Starikovskiy #define ACPI_PROCESSOR_HID		"ACPI0007"
578c8eb78fSThomas Renninger #define ACPI_SYSTEM_HID			"LNXSYSTM"
588c8eb78fSThomas Renninger #define ACPI_THERMAL_HID		"LNXTHERM"
598c8eb78fSThomas Renninger #define ACPI_BUTTON_HID_POWERF		"LNXPWRBN"
608c8eb78fSThomas Renninger #define ACPI_BUTTON_HID_SLEEPF		"LNXSLPBN"
618c8eb78fSThomas Renninger #define ACPI_VIDEO_HID			"LNXVIDEO"
628c8eb78fSThomas Renninger #define ACPI_BAY_HID			"LNXIOBAY"
63a340af14SFrank Seidel #define ACPI_DOCK_HID			"LNXDOCK"
648c8eb78fSThomas Renninger 
651da177e4SLinus Torvalds /* --------------------------------------------------------------------------
661da177e4SLinus Torvalds                                        PCI
671da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
681da177e4SLinus Torvalds 
691da177e4SLinus Torvalds 
701da177e4SLinus Torvalds /* ACPI PCI Interrupt Link (pci_link.c) */
711da177e4SLinus Torvalds 
721da177e4SLinus Torvalds int acpi_irq_penalty_init(void);
7350eca3ebSBob Moore int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
7450eca3ebSBob Moore 			       int *polarity, char **name);
7587bec66bSDavid Shaohua Li int acpi_pci_link_free_irq(acpi_handle handle);
761da177e4SLinus Torvalds 
771da177e4SLinus Torvalds /* ACPI PCI Interrupt Routing (pci_irq.c) */
781da177e4SLinus Torvalds 
791da177e4SLinus Torvalds int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus);
801da177e4SLinus Torvalds void acpi_pci_irq_del_prt(int segment, int bus);
811da177e4SLinus Torvalds 
821da177e4SLinus Torvalds /* ACPI PCI Device Binding (pci_bind.c) */
831da177e4SLinus Torvalds 
841da177e4SLinus Torvalds struct pci_bus;
851da177e4SLinus Torvalds 
864ce448e5SRajesh Shah acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id);
871da177e4SLinus Torvalds int acpi_pci_bind(struct acpi_device *device);
884be44fcdSLen Brown int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id,
894be44fcdSLen Brown 		       struct pci_bus *bus);
901da177e4SLinus Torvalds 
911da177e4SLinus Torvalds /* Arch-defined function to add a bus to the system */
921da177e4SLinus Torvalds 
934be44fcdSLen Brown struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain,
944be44fcdSLen Brown 				   int bus);
951da177e4SLinus Torvalds 
961da177e4SLinus Torvalds /* --------------------------------------------------------------------------
971da177e4SLinus Torvalds                                   Power Resource
981da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
991da177e4SLinus Torvalds 
10077e76609SRafael J. Wysocki int acpi_device_sleep_wake(struct acpi_device *dev,
10177e76609SRafael J. Wysocki                            int enable, int sleep_state, int dev_state);
10277e76609SRafael J. Wysocki int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state);
1031da177e4SLinus Torvalds int acpi_disable_wakeup_device_power(struct acpi_device *dev);
1041da177e4SLinus Torvalds int acpi_power_get_inferred_state(struct acpi_device *device);
1051da177e4SLinus Torvalds int acpi_power_transition(struct acpi_device *device, int state);
106f5adfaa3SZhao Yakui extern int acpi_power_nocheck;
1071da177e4SLinus Torvalds 
1081da177e4SLinus Torvalds /* --------------------------------------------------------------------------
1091da177e4SLinus Torvalds                                   Embedded Controller
1101da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
1111da177e4SLinus Torvalds int acpi_ec_ecdt_probe(void);
112455c8793SZhao Yakui int acpi_boot_ec_enable(void);
1131da177e4SLinus Torvalds 
1141da177e4SLinus Torvalds /* --------------------------------------------------------------------------
1151da177e4SLinus Torvalds                                     Processor
1161da177e4SLinus Torvalds    -------------------------------------------------------------------------- */
1171da177e4SLinus Torvalds 
1181da177e4SLinus Torvalds #define ACPI_PROCESSOR_LIMIT_NONE	0x00
1191da177e4SLinus Torvalds #define ACPI_PROCESSOR_LIMIT_INCREMENT	0x01
1201da177e4SLinus Torvalds #define ACPI_PROCESSOR_LIMIT_DECREMENT	0x02
1211da177e4SLinus Torvalds 
1221da177e4SLinus Torvalds int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
1231da177e4SLinus Torvalds 
124fb9802faSLuming Yu /*--------------------------------------------------------------------------
125c8f7a62cSLen Brown                                   Dock Station
126c8f7a62cSLen Brown   -------------------------------------------------------------------------- */
1271253f7aaSShaohua Li struct acpi_dock_ops {
1281253f7aaSShaohua Li 	acpi_notify_handler handler;
1291253f7aaSShaohua Li 	acpi_notify_handler uevent;
1301253f7aaSShaohua Li };
1311253f7aaSShaohua Li 
132c8f7a62cSLen Brown #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
133c8f7a62cSLen Brown extern int is_dock_device(acpi_handle handle);
134c8f7a62cSLen Brown extern int register_dock_notifier(struct notifier_block *nb);
135c8f7a62cSLen Brown extern void unregister_dock_notifier(struct notifier_block *nb);
136c8f7a62cSLen Brown extern int register_hotplug_dock_device(acpi_handle handle,
1371253f7aaSShaohua Li 					struct acpi_dock_ops *ops,
138fd350943SLen Brown 					void *context);
139c8f7a62cSLen Brown extern void unregister_hotplug_dock_device(acpi_handle handle);
140c8f7a62cSLen Brown #else
141d94d3dffSAndrew Morton static inline int is_dock_device(acpi_handle handle)
142d94d3dffSAndrew Morton {
143d94d3dffSAndrew Morton 	return 0;
144d94d3dffSAndrew Morton }
145d94d3dffSAndrew Morton static inline int register_dock_notifier(struct notifier_block *nb)
146d94d3dffSAndrew Morton {
147d94d3dffSAndrew Morton 	return -ENODEV;
148d94d3dffSAndrew Morton }
149d94d3dffSAndrew Morton static inline void unregister_dock_notifier(struct notifier_block *nb)
150d94d3dffSAndrew Morton {
151d94d3dffSAndrew Morton }
152d94d3dffSAndrew Morton static inline int register_hotplug_dock_device(acpi_handle handle,
1531253f7aaSShaohua Li 					       struct acpi_dock_ops *ops,
154fd350943SLen Brown 					       void *context)
155d94d3dffSAndrew Morton {
156d94d3dffSAndrew Morton 	return -ENODEV;
157d94d3dffSAndrew Morton }
158d94d3dffSAndrew Morton static inline void unregister_hotplug_dock_device(acpi_handle handle)
159d94d3dffSAndrew Morton {
160d94d3dffSAndrew Morton }
161c8f7a62cSLen Brown #endif
162aafbcd16SAlexey Starikovskiy 
163aafbcd16SAlexey Starikovskiy /*--------------------------------------------------------------------------
164aafbcd16SAlexey Starikovskiy                                   Suspend/Resume
165aafbcd16SAlexey Starikovskiy   -------------------------------------------------------------------------- */
166aafbcd16SAlexey Starikovskiy extern int acpi_sleep_init(void);
167aafbcd16SAlexey Starikovskiy 
1681da177e4SLinus Torvalds #endif /*__ACPI_DRIVERS_H__*/
169