소스 검색

Fix deferral issue in button driver

qzed 6 년 전
부모
커밋
49e4051332

+ 23 - 9
patches/4.19/0003-buttons.patch

@@ -1,15 +1,15 @@
-From ba453a89148ea2289e71741225273a02ae2db768 Mon Sep 17 00:00:00 2001
+From 65be92a4e7a1373a08dc1d75892dc6cafef830d0 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:49:56 +0200
 Subject: [PATCH 03/12] buttons
 
 ---
- drivers/input/misc/soc_button_array.c     | 145 ++++++++++++++++++++--
+ drivers/input/misc/soc_button_array.c     | 151 ++++++++++++++++++++--
  drivers/platform/x86/surfacepro3_button.c |  38 ++++++
- 2 files changed, 171 insertions(+), 12 deletions(-)
+ 2 files changed, 176 insertions(+), 13 deletions(-)
 
 diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
-index 55cd6e0b409c..bd8a8601cf0c 100644
+index 55cd6e0b409c..171d8a5c8bfd 100644
 --- a/drivers/input/misc/soc_button_array.c
 +++ b/drivers/input/misc/soc_button_array.c
 @@ -29,6 +29,17 @@ struct soc_button_info {
@@ -30,7 +30,21 @@ index 55cd6e0b409c..bd8a8601cf0c 100644
  /*
   * Some of the buttons like volume up/down are auto repeat, while others
   * are not. To support both, we register two platform devices, and put
-@@ -310,6 +321,7 @@ static int soc_button_probe(struct platform_device *pdev)
+@@ -91,8 +102,12 @@ soc_button_device_create(struct platform_device *pdev,
+ 			continue;
+ 
+ 		gpio = soc_button_lookup_gpio(&pdev->dev, info->acpi_index);
+-		if (!gpio_is_valid(gpio))
++		if (gpio == -EPROBE_DEFER) {
++			error = -EPROBE_DEFER;
++			goto err_free_mem;
++		} else if (!gpio_is_valid(gpio)) {
+ 			continue;
++		}
+ 
+ 		gpio_keys[n_buttons].type = info->event_type;
+ 		gpio_keys[n_buttons].code = info->event_code;
+@@ -310,6 +325,7 @@ static int soc_button_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	const struct acpi_device_id *id;
@@ -38,7 +52,7 @@ index 55cd6e0b409c..bd8a8601cf0c 100644
  	struct soc_button_info *button_info;
  	struct soc_button_data *priv;
  	struct platform_device *pd;
-@@ -320,18 +332,20 @@ static int soc_button_probe(struct platform_device *pdev)
+@@ -320,18 +336,20 @@ static int soc_button_probe(struct platform_device *pdev)
  	if (!id)
  		return -ENODEV;
  
@@ -68,7 +82,7 @@ index 55cd6e0b409c..bd8a8601cf0c 100644
  	}
  
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-@@ -357,12 +371,32 @@ static int soc_button_probe(struct platform_device *pdev)
+@@ -357,12 +375,32 @@ static int soc_button_probe(struct platform_device *pdev)
  	if (!priv->children[0] && !priv->children[1])
  		return -ENODEV;
  
@@ -102,7 +116,7 @@ index 55cd6e0b409c..bd8a8601cf0c 100644
  /*
   * Definition of buttons on the tablet. The ACPI index of each button
   * is defined in section 2.8.7.2 of "Windows ACPI Design Guide for SoC
-@@ -377,9 +411,96 @@ static struct soc_button_info soc_button_PNP0C40[] = {
+@@ -377,9 +415,96 @@ static struct soc_button_info soc_button_PNP0C40[] = {
  	{ }
  };
  
@@ -158,7 +172,7 @@ index 55cd6e0b409c..bd8a8601cf0c 100644
 +	 */
 +	gpios = gpiod_count(dev, NULL);
 +	if (gpios < 0)
-+		return -EAGAIN;
++		return -EPROBE_DEFER;
 +
 +	return 0;
 +}

+ 1 - 1
patches/4.19/0004-cameras.patch

@@ -1,4 +1,4 @@
-From 4f79924d2848c13e9a0830c0c575421768f8d58a Mon Sep 17 00:00:00 2001
+From fe4fe38ef47eddda5f5775bc86931970b99136f7 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:50:29 +0200
 Subject: [PATCH 04/12] cameras

+ 1 - 1
patches/4.19/0005-ipts.patch

@@ -1,4 +1,4 @@
-From aa2ce90ff8ee8ad90a5e84004b748e709167bd0f Mon Sep 17 00:00:00 2001
+From 9cd9e021158ba8b9f3fc9c52053f33178d36f400 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:50:47 +0200
 Subject: [PATCH 05/12] ipts

+ 1 - 1
patches/4.19/0006-hid.patch

@@ -1,4 +1,4 @@
-From 3895e7b026d525d70fdc0f4a6dd59b08c9f44022 Mon Sep 17 00:00:00 2001
+From de20ba5257222ac2d4789cafb9801f4849c8a913 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:51:26 +0200
 Subject: [PATCH 06/12] hid

+ 1 - 1
patches/4.19/0007-sdcard-reader.patch

@@ -1,4 +1,4 @@
-From 4cbc99c208e1938349aec603aee10b202a54f54a Mon Sep 17 00:00:00 2001
+From c334004001d2a1072ed1befbcc9e89c99449c5b7 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:51:55 +0200
 Subject: [PATCH 07/12] sdcard-reader

+ 1 - 1
patches/4.19/0008-wifi.patch

@@ -1,4 +1,4 @@
-From 52cb41ede0999511587b9a2523771238c12f8033 Mon Sep 17 00:00:00 2001
+From 614cf75ca3c727dbabfab49cdb471e0633110ce3 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:52:12 +0200
 Subject: [PATCH 08/12] wifi

+ 1 - 1
patches/4.19/0009-surface3-power.patch

@@ -1,4 +1,4 @@
-From 09ddddeb396321184eb2591c20e681d48623c34d Mon Sep 17 00:00:00 2001
+From a3e7b6ab8e6353069d520f29aae5e550863d94fb Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:52:29 +0200
 Subject: [PATCH 09/12] surface3-power

+ 1 - 1
patches/4.19/0010-mwlwifi.patch

@@ -1,4 +1,4 @@
-From d27de602a55f146e79c125287e6dbc3aa70ded38 Mon Sep 17 00:00:00 2001
+From c52333794334d2f60f544af7b27dedc2c0bf017d Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:52:52 +0200
 Subject: [PATCH 10/12] mwlwifi

+ 1 - 1
patches/4.19/0011-surface-lte.patch

@@ -1,4 +1,4 @@
-From 4b31faa2ddaffa6e6963c54ff6574178de94918e Mon Sep 17 00:00:00 2001
+From 0b925c6364aa6a504d590079c4be6ef15928d8cc Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:53:15 +0200
 Subject: [PATCH 11/12] surface-lte

+ 1 - 1
patches/4.19/0012-surfacebook2-dgpu.patch

@@ -1,4 +1,4 @@
-From c7eb71b21227f0ee6b46a13c9b4f9df49dd23979 Mon Sep 17 00:00:00 2001
+From b7412c8ac85479f185e0301bedb47542aa6ade1c Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Tue, 2 Jul 2019 23:58:22 +0200
 Subject: [PATCH 12/12] surfacebook2-dgpu

+ 23 - 9
patches/5.1/0003-buttons.patch

@@ -1,15 +1,15 @@
-From 8b583fd83792f28f23461186b0c44d9c1554204e Mon Sep 17 00:00:00 2001
+From 72bd00dbd59591de9cbcb05ecabf2eaefaec6787 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:25:27 +0200
 Subject: [PATCH 03/12] buttons
 
 ---
- drivers/input/misc/soc_button_array.c     | 145 ++++++++++++++++++++--
+ drivers/input/misc/soc_button_array.c     | 151 ++++++++++++++++++++--
  drivers/platform/x86/surfacepro3_button.c |  38 ++++++
- 2 files changed, 171 insertions(+), 12 deletions(-)
+ 2 files changed, 176 insertions(+), 13 deletions(-)
 
 diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
-index bb458beecb43..497fca2a9250 100644
+index bb458beecb43..0cd942781bac 100644
 --- a/drivers/input/misc/soc_button_array.c
 +++ b/drivers/input/misc/soc_button_array.c
 @@ -29,6 +29,17 @@ struct soc_button_info {
@@ -30,7 +30,21 @@ index bb458beecb43..497fca2a9250 100644
  /*
   * Some of the buttons like volume up/down are auto repeat, while others
   * are not. To support both, we register two platform devices, and put
-@@ -314,6 +325,7 @@ static int soc_button_probe(struct platform_device *pdev)
+@@ -91,8 +102,12 @@ soc_button_device_create(struct platform_device *pdev,
+ 			continue;
+ 
+ 		gpio = soc_button_lookup_gpio(&pdev->dev, info->acpi_index);
+-		if (!gpio_is_valid(gpio))
++		if (gpio == -EPROBE_DEFER) {
++			error = -EPROBE_DEFER;
++			goto err_free_mem;
++		} else if (!gpio_is_valid(gpio)) {
+ 			continue;
++		}
+ 
+ 		gpio_keys[n_buttons].type = info->event_type;
+ 		gpio_keys[n_buttons].code = info->event_code;
+@@ -314,6 +329,7 @@ static int soc_button_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	const struct acpi_device_id *id;
@@ -38,7 +52,7 @@ index bb458beecb43..497fca2a9250 100644
  	struct soc_button_info *button_info;
  	struct soc_button_data *priv;
  	struct platform_device *pd;
-@@ -324,18 +336,20 @@ static int soc_button_probe(struct platform_device *pdev)
+@@ -324,18 +340,20 @@ static int soc_button_probe(struct platform_device *pdev)
  	if (!id)
  		return -ENODEV;
  
@@ -68,7 +82,7 @@ index bb458beecb43..497fca2a9250 100644
  	}
  
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-@@ -361,12 +375,32 @@ static int soc_button_probe(struct platform_device *pdev)
+@@ -361,12 +379,32 @@ static int soc_button_probe(struct platform_device *pdev)
  	if (!priv->children[0] && !priv->children[1])
  		return -ENODEV;
  
@@ -102,7 +116,7 @@ index bb458beecb43..497fca2a9250 100644
  /*
   * Definition of buttons on the tablet. The ACPI index of each button
   * is defined in section 2.8.7.2 of "Windows ACPI Design Guide for SoC
-@@ -381,9 +415,96 @@ static struct soc_button_info soc_button_PNP0C40[] = {
+@@ -381,9 +419,96 @@ static struct soc_button_info soc_button_PNP0C40[] = {
  	{ }
  };
  
@@ -158,7 +172,7 @@ index bb458beecb43..497fca2a9250 100644
 +	 */
 +	gpios = gpiod_count(dev, NULL);
 +	if (gpios < 0)
-+		return -EAGAIN;
++		return -EPROBE_DEFER;
 +
 +	return 0;
 +}

+ 1 - 1
patches/5.1/0004-cameras.patch

@@ -1,4 +1,4 @@
-From ee99ccaced33d4db9d807b5452507c2b4257f595 Mon Sep 17 00:00:00 2001
+From 6e76138da8865b68218ab9e4e5718e5db436a397 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:27:27 +0200
 Subject: [PATCH 04/12] cameras

+ 1 - 1
patches/5.1/0005-ipts.patch

@@ -1,4 +1,4 @@
-From fa6be7e31d29959edc738986507fed1e1a877e2e Mon Sep 17 00:00:00 2001
+From 9ef92ec7722844fad196f74cfb1d5474af2c0130 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:28:10 +0200
 Subject: [PATCH 05/12] ipts

+ 1 - 1
patches/5.1/0006-hid.patch

@@ -1,4 +1,4 @@
-From d784fa6928c75c033a240d6db839c3aacd9edd33 Mon Sep 17 00:00:00 2001
+From ee74de82a113853b7ab8b24fc53df2f27ac77821 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:28:41 +0200
 Subject: [PATCH 06/12] hid

+ 1 - 1
patches/5.1/0007-sdcard-reader.patch

@@ -1,4 +1,4 @@
-From 1b434e8d2943d1c6a3fb9eb7936f8ecc5c1551e3 Mon Sep 17 00:00:00 2001
+From 125a9473c2c9fa07d1c20960543115193a61c9a2 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:29:19 +0200
 Subject: [PATCH 07/12] sdcard-reader

+ 1 - 1
patches/5.1/0008-wifi.patch

@@ -1,4 +1,4 @@
-From 8f2bb111745b57988030776899049153dadf2e3d Mon Sep 17 00:00:00 2001
+From ca8db7e884bbf493fb2fc6842a1b5981830d6f19 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:30:18 +0200
 Subject: [PATCH 08/12] wifi

+ 1 - 1
patches/5.1/0009-surface3-power.patch

@@ -1,4 +1,4 @@
-From facb57708454c1424e5dffe2be999356fc88984a Mon Sep 17 00:00:00 2001
+From 1861b1b09031f9a332b3e17c7c1e4aa8246bea34 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:30:44 +0200
 Subject: [PATCH 09/12] surface3-power

+ 1 - 1
patches/5.1/0010-mwlwifi.patch

@@ -1,4 +1,4 @@
-From 74d3a35c573f41861590ee786400067220c300b6 Mon Sep 17 00:00:00 2001
+From 84bd1e431a109f5edc42b1efd426ce5db251e1a1 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:31:18 +0200
 Subject: [PATCH 10/12] mwlwifi

+ 1 - 1
patches/5.1/0011-surface-lte.patch

@@ -1,4 +1,4 @@
-From ba5ab6c097f826ef6ec92379383f8b9963b8f48c Mon Sep 17 00:00:00 2001
+From 085e04dce01293f41ec1f48b4212d23a827ada14 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:32:00 +0200
 Subject: [PATCH 11/12] surface-lte

+ 1 - 1
patches/5.1/0012-surfacebook2-dgpu.patch

@@ -1,4 +1,4 @@
-From 42b801e957cc7aa47e7d6a869970c149d959b539 Mon Sep 17 00:00:00 2001
+From ff7a7f5931f8f0aae029daa36209686818aafbe1 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Wed, 3 Jul 2019 00:35:24 +0200
 Subject: [PATCH 12/12] surfacebook2-dgpu