1a91b408aSEmmanuel Vadot /*-
2a91b408aSEmmanuel Vadot  * Copyright (c) 2020 The FreeBSD Foundation
3a91b408aSEmmanuel Vadot  *
4a91b408aSEmmanuel Vadot  * This software was developed by Emmanuel Vadot under sponsorship
5a91b408aSEmmanuel Vadot  * from the FreeBSD Foundation.
6a91b408aSEmmanuel Vadot  *
7a91b408aSEmmanuel Vadot  * Redistribution and use in source and binary forms, with or without
8a91b408aSEmmanuel Vadot  * modification, are permitted provided that the following conditions
9a91b408aSEmmanuel Vadot  * are met:
10a91b408aSEmmanuel Vadot  * 1. Redistributions of source code must retain the above copyright
11a91b408aSEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer.
12a91b408aSEmmanuel Vadot  * 2. Redistributions in binary form must reproduce the above copyright
13a91b408aSEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer in the
14a91b408aSEmmanuel Vadot  *    documentation and/or other materials provided with the distribution.
15a91b408aSEmmanuel Vadot  *
16a91b408aSEmmanuel Vadot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17a91b408aSEmmanuel Vadot  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18a91b408aSEmmanuel Vadot  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19a91b408aSEmmanuel Vadot  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20a91b408aSEmmanuel Vadot  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21a91b408aSEmmanuel Vadot  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22a91b408aSEmmanuel Vadot  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a91b408aSEmmanuel Vadot  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24a91b408aSEmmanuel Vadot  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25a91b408aSEmmanuel Vadot  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a91b408aSEmmanuel Vadot  * SUCH DAMAGE.
27a91b408aSEmmanuel Vadot  */
28a91b408aSEmmanuel Vadot 
29307f78f3SVladimir Kondratyev #ifndef __LINUXKPI_LINUX_MOD_DEVICETABLE_H__
30307f78f3SVladimir Kondratyev #define	__LINUXKPI_LINUX_MOD_DEVICETABLE_H__
31a91b408aSEmmanuel Vadot 
320bf56135SEmmanuel Vadot #include <linux/types.h>
330bf56135SEmmanuel Vadot 
34a91b408aSEmmanuel Vadot enum dmi_field {
35a91b408aSEmmanuel Vadot 	DMI_NONE,
36a91b408aSEmmanuel Vadot 	DMI_BIOS_VENDOR,
37a91b408aSEmmanuel Vadot 	DMI_BIOS_VERSION,
38a91b408aSEmmanuel Vadot 	DMI_BIOS_DATE,
39cf541690SJean-Sébastien Pédron 	DMI_BIOS_RELEASE,
40cf541690SJean-Sébastien Pédron 	DMI_EC_FIRMWARE_RELEASE,
41a91b408aSEmmanuel Vadot 	DMI_SYS_VENDOR,
42a91b408aSEmmanuel Vadot 	DMI_PRODUCT_NAME,
43a91b408aSEmmanuel Vadot 	DMI_PRODUCT_VERSION,
44a91b408aSEmmanuel Vadot 	DMI_PRODUCT_SERIAL,
45a91b408aSEmmanuel Vadot 	DMI_PRODUCT_UUID,
46cf541690SJean-Sébastien Pédron 	DMI_PRODUCT_SKU,
47cf541690SJean-Sébastien Pédron 	DMI_PRODUCT_FAMILY,
48a91b408aSEmmanuel Vadot 	DMI_BOARD_VENDOR,
49a91b408aSEmmanuel Vadot 	DMI_BOARD_NAME,
50a91b408aSEmmanuel Vadot 	DMI_BOARD_VERSION,
51a91b408aSEmmanuel Vadot 	DMI_BOARD_SERIAL,
52a91b408aSEmmanuel Vadot 	DMI_BOARD_ASSET_TAG,
53a91b408aSEmmanuel Vadot 	DMI_CHASSIS_VENDOR,
54a91b408aSEmmanuel Vadot 	DMI_CHASSIS_TYPE,
55a91b408aSEmmanuel Vadot 	DMI_CHASSIS_VERSION,
56a91b408aSEmmanuel Vadot 	DMI_CHASSIS_SERIAL,
57a91b408aSEmmanuel Vadot 	DMI_CHASSIS_ASSET_TAG,
58a91b408aSEmmanuel Vadot 	DMI_STRING_MAX,
59cf541690SJean-Sébastien Pédron 	DMI_OEM_STRING,
60a91b408aSEmmanuel Vadot };
61a91b408aSEmmanuel Vadot 
62a91b408aSEmmanuel Vadot struct dmi_strmatch {
6399902b1cSCorvin Köhne 	unsigned char slot : 7;
6499902b1cSCorvin Köhne 	unsigned char exact_match : 1;
65a91b408aSEmmanuel Vadot 	char substr[79];
66a91b408aSEmmanuel Vadot };
67a91b408aSEmmanuel Vadot 
68a91b408aSEmmanuel Vadot struct dmi_system_id {
69a91b408aSEmmanuel Vadot 	int (*callback)(const struct dmi_system_id *);
70a91b408aSEmmanuel Vadot 	const char *ident;
71a91b408aSEmmanuel Vadot 	struct dmi_strmatch matches[4];
72a91b408aSEmmanuel Vadot 	void *driver_data;
73a91b408aSEmmanuel Vadot };
74a91b408aSEmmanuel Vadot 
75a91b408aSEmmanuel Vadot #define DMI_MATCH(a, b) { .slot = a, .substr = b }
7699902b1cSCorvin Köhne #define DMI_EXACT_MATCH(a, b)   { .slot = a, .substr = b, .exact_match = 1 }
77a91b408aSEmmanuel Vadot 
787bf65b00SEmmanuel Vadot #define	I2C_NAME_SIZE		20
797bf65b00SEmmanuel Vadot #define	I2C_MODULE_PREFIX	"i2c:"
807bf65b00SEmmanuel Vadot 
81*8ce07593SVladimir Kondratyev #define	ACPI_ID_LEN		16
82*8ce07593SVladimir Kondratyev 
83307f78f3SVladimir Kondratyev #endif	/* __LINUXKPI_LINUX_MOD_DEVICETABLE_H__ */
84