113 lines
3.6 KiB
Diff
113 lines
3.6 KiB
Diff
From b8dae24b8f4bf24c3d1aeccc3efef81fc0f8b08d Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Sat, 1 Jun 2019 21:17:15 +0200
|
|
Subject: [PATCH 02/16] Add support for Intel Management Engine bus
|
|
|
|
Add support for devices connected via the Intel Management Engine (MEI).
|
|
This is required to support IPTS based devices, such as (among others)
|
|
the Microsoft Surface Books, Surface Pro 5 and 6, and Surface Laptops.
|
|
---
|
|
libwacom/libwacom-database.c | 4 ++++
|
|
libwacom/libwacom.c | 5 +++++
|
|
libwacom/libwacom.h | 1 +
|
|
test/test-tablet-validity.c | 1 +
|
|
test/test_data_files.py | 1 +
|
|
tools/debug-device.c | 1 +
|
|
6 files changed, 13 insertions(+)
|
|
|
|
diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
|
|
index c5e2fcf..d9fc0c4 100644
|
|
--- a/libwacom/libwacom-database.c
|
|
+++ b/libwacom/libwacom-database.c
|
|
@@ -132,6 +132,8 @@ bus_from_str (const char *str)
|
|
return WBUSTYPE_I2C;
|
|
if (g_str_equal(str, "virt"))
|
|
return WBUSTYPE_VIRTUAL;
|
|
+ if (strcmp (str, "mei") == 0)
|
|
+ return WBUSTYPE_MEI;
|
|
return WBUSTYPE_UNKNOWN;
|
|
}
|
|
|
|
@@ -152,6 +154,8 @@ bus_to_str (WacomBusType bus)
|
|
return "i2c";
|
|
case WBUSTYPE_VIRTUAL:
|
|
return "virt";
|
|
+ case WBUSTYPE_MEI:
|
|
+ return "mei";
|
|
}
|
|
g_assert_not_reached ();
|
|
}
|
|
diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
|
|
index c028bde..0d34227 100644
|
|
--- a/libwacom/libwacom.c
|
|
+++ b/libwacom/libwacom.c
|
|
@@ -153,6 +153,10 @@ get_bus_vid_pid (GUdevDevice *device,
|
|
*bus = WBUSTYPE_VIRTUAL;
|
|
retval = TRUE;
|
|
break;
|
|
+ case 68:
|
|
+ *bus = WBUSTYPE_MEI;
|
|
+ retval = TRUE;
|
|
+ break;
|
|
}
|
|
|
|
out:
|
|
@@ -1027,6 +1031,7 @@ static void print_match(int fd, const WacomMatch *match)
|
|
case WBUSTYPE_SERIAL: bus_name = "serial"; break;
|
|
case WBUSTYPE_I2C: bus_name = "i2c"; break;
|
|
case WBUSTYPE_VIRTUAL: bus_name = "virt"; break;
|
|
+ case WBUSTYPE_MEI: bus_name = "mei"; break;
|
|
case WBUSTYPE_UNKNOWN: bus_name = "unknown"; break;
|
|
default: g_assert_not_reached(); break;
|
|
}
|
|
diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
|
|
index a4fbb17..dfc6d7b 100644
|
|
--- a/libwacom/libwacom.h
|
|
+++ b/libwacom/libwacom.h
|
|
@@ -155,6 +155,7 @@ typedef enum {
|
|
WBUSTYPE_BLUETOOTH, /**< Bluetooth tablet */
|
|
WBUSTYPE_I2C, /**< I2C tablet */
|
|
WBUSTYPE_VIRTUAL, /**< Virtual (uinput) tablet */
|
|
+ WBUSTYPE_MEI, /**< MEI */
|
|
} WacomBusType;
|
|
|
|
/**
|
|
diff --git a/test/test-tablet-validity.c b/test/test-tablet-validity.c
|
|
index 964fce0..5178583 100644
|
|
--- a/test/test-tablet-validity.c
|
|
+++ b/test/test-tablet-validity.c
|
|
@@ -178,6 +178,7 @@ assert_vidpid(WacomBusType bus, int vid, int pid)
|
|
case WBUSTYPE_BLUETOOTH:
|
|
case WBUSTYPE_I2C:
|
|
case WBUSTYPE_VIRTUAL:
|
|
+ case WBUSTYPE_MEI:
|
|
g_assert_cmpint(vid, >, 0);
|
|
g_assert_cmpint(pid, >, 0);
|
|
break;
|
|
diff --git a/test/test_data_files.py b/test/test_data_files.py
|
|
index f76c3f3..f7cf9bc 100755
|
|
--- a/test/test_data_files.py
|
|
+++ b/test/test_data_files.py
|
|
@@ -48,6 +48,7 @@ def test_device_match(tabletfile):
|
|
"i2c",
|
|
"serial",
|
|
"virt",
|
|
+ "mei",
|
|
], f"{tabletfile}: unknown bus type"
|
|
assert re.match(
|
|
"[0-9a-f]{4}", vid
|
|
diff --git a/tools/debug-device.c b/tools/debug-device.c
|
|
index 51ec53e..6a00f9d 100644
|
|
--- a/tools/debug-device.c
|
|
+++ b/tools/debug-device.c
|
|
@@ -123,6 +123,7 @@ handle_device(WacomDeviceDatabase *db, const char *path)
|
|
case WBUSTYPE_BLUETOOTH: busstr = "BLUETOOTH"; break;
|
|
case WBUSTYPE_I2C: busstr = "I2C"; break;
|
|
case WBUSTYPE_VIRTUAL: busstr = "VIRTUAL"; break;
|
|
+ case WBUSTYPE_MEI: busstr = "MEI"; break;
|
|
}
|
|
func(libwacom_get_bustype, "%s", busstr);
|
|
}
|
|
--
|
|
2.45.1
|
|
|