xref: /dflybsd-src/sys/dev/drm/include/linux/acpi.h (revision 3f2dd94a569761201b5b0a18b2f697f97fe1b9dc)
139cfddd2SFrançois Tigeot /*
2a3261f38SFrançois Tigeot  * Copyright (c) 2017-2020 François Tigeot <ftigeot@wolfpond.org>
339cfddd2SFrançois Tigeot  * All rights reserved.
439cfddd2SFrançois Tigeot  *
539cfddd2SFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
639cfddd2SFrançois Tigeot  * modification, are permitted provided that the following conditions
739cfddd2SFrançois Tigeot  * are met:
839cfddd2SFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
939cfddd2SFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
1039cfddd2SFrançois Tigeot  *    disclaimer.
1139cfddd2SFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
1239cfddd2SFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
1339cfddd2SFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
1439cfddd2SFrançois Tigeot  *
1539cfddd2SFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1639cfddd2SFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1739cfddd2SFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1839cfddd2SFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1939cfddd2SFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2039cfddd2SFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2139cfddd2SFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2239cfddd2SFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2339cfddd2SFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2439cfddd2SFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2539cfddd2SFrançois Tigeot  */
2639cfddd2SFrançois Tigeot 
2739cfddd2SFrançois Tigeot #ifndef _LINUX_ACPI_H_
2839cfddd2SFrançois Tigeot #define _LINUX_ACPI_H_
2939cfddd2SFrançois Tigeot 
30a3261f38SFrançois Tigeot #include <linux/errno.h>
31a85cb24fSFrançois Tigeot #include <linux/ioport.h>
32*3f2dd94aSFrançois Tigeot #include <linux/uuid.h>
33a3261f38SFrançois Tigeot #include <linux/device.h>
34a3261f38SFrançois Tigeot #include <linux/list.h>
35a3261f38SFrançois Tigeot #include <linux/mod_devicetable.h>
36a3261f38SFrançois Tigeot #include <linux/module.h>
37a3261f38SFrançois Tigeot #include <linux/mutex.h>
38a3261f38SFrançois Tigeot 
39a3261f38SFrançois Tigeot #include <contrib/dev/acpica/source/include/acpi.h>
40a3261f38SFrançois Tigeot 
41a3261f38SFrançois Tigeot static inline int
acpi_is_video_device(ACPI_HANDLE devh)42a3261f38SFrançois Tigeot acpi_is_video_device(ACPI_HANDLE devh) {
43a3261f38SFrançois Tigeot 	ACPI_HANDLE h;
44a3261f38SFrançois Tigeot 	if (ACPI_FAILURE(AcpiGetHandle(devh, "_DOD", &h)) ||
45a3261f38SFrançois Tigeot 	    ACPI_FAILURE(AcpiGetHandle(devh, "_DOS", &h))) {
46a3261f38SFrançois Tigeot 		return 0;
47a3261f38SFrançois Tigeot 	}
48a3261f38SFrançois Tigeot 	return 1;
49a3261f38SFrançois Tigeot }
50a3261f38SFrançois Tigeot 
5139cfddd2SFrançois Tigeot #endif	/* _LINUX_ACPI_H_ */
52