xref: /openbsd-src/sys/dev/pci/drm/include/linux/acpi.h (revision 4e1ee0786f11cc571bd0be17d38e46f635c719fc)
1 /* Public domain. */
2 
3 #ifndef _LINUX_ACPI_H
4 #define _LINUX_ACPI_H
5 
6 #include <sys/types.h>
7 #include <sys/param.h>
8 
9 #ifdef __HAVE_ACPI
10 #include <dev/acpi/acpireg.h>
11 #include <dev/acpi/acpivar.h>
12 #endif
13 
14 #include <linux/irqdomain.h>
15 
16 typedef size_t acpi_size;
17 typedef int acpi_status;
18 typedef struct aml_node *acpi_handle;
19 
20 struct acpi_bus_event {
21 	const char *device_class;
22 	int type;
23 };
24 
25 struct acpi_buffer {
26 	size_t length;
27 	void *pointer;
28 };
29 
30 #define ACPI_ALLOCATE_BUFFER	(size_t)-1
31 
32 union acpi_object {
33 	int type;
34 	struct {
35 		int type;
36 		uint64_t value;
37 	} integer;
38 	struct {
39 		int type;
40 		size_t length;
41 		void *pointer;
42 	} buffer;
43 };
44 
45 #define ACPI_TYPE_INTEGER	1
46 #define ACPI_TYPE_BUFFER	3
47 
48 struct acpi_object_list {
49 	int count;
50 	union acpi_object *pointer;
51 };
52 
53 struct acpi_table_header;
54 
55 #define ACPI_SUCCESS(x) ((x) == 0)
56 #define ACPI_FAILURE(x) ((x) != 0)
57 
58 #define AE_ERROR		1
59 #define AE_NOT_FOUND		2
60 #define AE_BAD_PARAMETER	3
61 
62 acpi_status acpi_evaluate_object(acpi_handle, const char *,
63 	struct acpi_object_list *, struct acpi_buffer *);
64 
65 acpi_status acpi_get_handle(acpi_handle, const char *, acpi_handle *);
66 acpi_status acpi_get_name(acpi_handle, int, struct acpi_buffer *);
67 acpi_status acpi_get_table(const char *, int, struct acpi_table_header **);
68 
69 #define ACPI_FULL_PATHNAME 1
70 
71 #define ACPI_VIDEO_CLASS   "video"
72 
73 #define ACPI_VIDEO_NOTIFY_PROBE		0x81
74 
75 #define ACPI_HANDLE(x)	((x)->node)
76 
77 const char *acpi_format_exception(acpi_status);
78 
79 struct notifier_block;
80 
81 int register_acpi_notifier(struct notifier_block *);
82 int unregister_acpi_notifier(struct notifier_block *);
83 
84 #endif
85