update checks for buttons patch
This commit is contained in:
parent
04da26f263
commit
1c7818f785
|
@ -28,10 +28,10 @@ index 8fd5b93bb20d..28c4cede2d91 100644
|
||||||
obj-$(CONFIG_ACPI_SURFACE) += surface_platform.o
|
obj-$(CONFIG_ACPI_SURFACE) += surface_platform.o
|
||||||
diff --git a/drivers/platform/x86/surfacebook2_button.c b/drivers/platform/x86/surfacebook2_button.c
|
diff --git a/drivers/platform/x86/surfacebook2_button.c b/drivers/platform/x86/surfacebook2_button.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 000000000000..8dc48435b5f4
|
index 000000000000..9a23bfd32c97
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/platform/x86/surfacebook2_button.c
|
+++ b/drivers/platform/x86/surfacebook2_button.c
|
||||||
@@ -0,0 +1,238 @@
|
@@ -0,0 +1,242 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Supports for Surface Book 2 and Surface Pro (2017) power and volume
|
+ * Supports for Surface Book 2 and Surface Pro (2017) power and volume
|
||||||
+ * buttons.
|
+ * buttons.
|
||||||
|
@ -71,6 +71,7 @@ index 000000000000..8dc48435b5f4
|
||||||
+ * buttons into them based on whether the key should be auto repeat.
|
+ * buttons into them based on whether the key should be auto repeat.
|
||||||
+ */
|
+ */
|
||||||
+#define BUTTON_TYPES 2
|
+#define BUTTON_TYPES 2
|
||||||
|
+#define SURFACE_METHOD_DSM "_DSM"
|
||||||
+
|
+
|
||||||
+struct soc_button_data {
|
+struct soc_button_data {
|
||||||
+ struct platform_device *children[BUTTON_TYPES];
|
+ struct platform_device *children[BUTTON_TYPES];
|
||||||
|
@ -201,6 +202,9 @@ index 000000000000..8dc48435b5f4
|
||||||
+ if (!id)
|
+ if (!id)
|
||||||
+ return -ENODEV;
|
+ return -ENODEV;
|
||||||
+
|
+
|
||||||
|
+ if (!acpi_has_method(ACPI_HANDLE(dev), SURFACE_METHOD_DSM))
|
||||||
|
+ return -ENODEV;
|
||||||
|
+
|
||||||
+ button_info = (struct soc_button_info *)id->driver_data;
|
+ button_info = (struct soc_button_info *)id->driver_data;
|
||||||
+
|
+
|
||||||
+ error = gpiod_count(dev, NULL);
|
+ error = gpiod_count(dev, NULL);
|
||||||
|
|
Loading…
Reference in a new issue