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