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