]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.16-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Mar 2022 09:58:14 +0000 (10:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Mar 2022 09:58:14 +0000 (10:58 +0100)
added patches:
hid-add-mapping-for-key_all_applications.patch
hid-add-mapping-for-key_dictate.patch
input-elan_i2c-fix-regulator-enable-count-imbalance-after-suspend-resume.patch
input-elan_i2c-move-regulator_able-out-of-elan_able_power.patch
input-samsung-keypad-properly-state-iomem-dependency.patch

queue-5.16/hid-add-mapping-for-key_all_applications.patch [new file with mode: 0644]
queue-5.16/hid-add-mapping-for-key_dictate.patch [new file with mode: 0644]
queue-5.16/input-elan_i2c-fix-regulator-enable-count-imbalance-after-suspend-resume.patch [new file with mode: 0644]
queue-5.16/input-elan_i2c-move-regulator_able-out-of-elan_able_power.patch [new file with mode: 0644]
queue-5.16/input-samsung-keypad-properly-state-iomem-dependency.patch [new file with mode: 0644]
queue-5.16/series

diff --git a/queue-5.16/hid-add-mapping-for-key_all_applications.patch b/queue-5.16/hid-add-mapping-for-key_all_applications.patch
new file mode 100644 (file)
index 0000000..76b9024
--- /dev/null
@@ -0,0 +1,61 @@
+From 327b89f0acc4c20a06ed59e4d9af7f6d804dc2e2 Mon Sep 17 00:00:00 2001
+From: William Mahon <wmahon@chromium.org>
+Date: Thu, 3 Mar 2022 18:26:22 -0800
+Subject: HID: add mapping for KEY_ALL_APPLICATIONS
+
+From: William Mahon <wmahon@chromium.org>
+
+commit 327b89f0acc4c20a06ed59e4d9af7f6d804dc2e2 upstream.
+
+This patch adds a new key definition for KEY_ALL_APPLICATIONS
+and aliases KEY_DASHBOARD to it.
+
+It also maps the 0x0c/0x2a2 usage code to KEY_ALL_APPLICATIONS.
+
+Signed-off-by: William Mahon <wmahon@chromium.org>
+Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20220303035618.1.I3a7746ad05d270161a18334ae06e3b6db1a1d339@changeid
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/hid-debug.c                |    4 +++-
+ drivers/hid/hid-input.c                |    2 ++
+ include/uapi/linux/input-event-codes.h |    3 ++-
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+--- a/drivers/hid/hid-debug.c
++++ b/drivers/hid/hid-debug.c
+@@ -825,7 +825,9 @@ static const char *keys[KEY_MAX + 1] = {
+       [KEY_F22] = "F22",                      [KEY_F23] = "F23",
+       [KEY_F24] = "F24",                      [KEY_PLAYCD] = "PlayCD",
+       [KEY_PAUSECD] = "PauseCD",              [KEY_PROG3] = "Prog3",
+-      [KEY_PROG4] = "Prog4",                  [KEY_SUSPEND] = "Suspend",
++      [KEY_PROG4] = "Prog4",
++      [KEY_ALL_APPLICATIONS] = "AllApplications",
++      [KEY_SUSPEND] = "Suspend",
+       [KEY_CLOSE] = "Close",                  [KEY_PLAY] = "Play",
+       [KEY_FASTFORWARD] = "FastForward",      [KEY_BASSBOOST] = "BassBoost",
+       [KEY_PRINT] = "Print",                  [KEY_HP] = "HP",
+--- a/drivers/hid/hid-input.c
++++ b/drivers/hid/hid-input.c
+@@ -1086,6 +1086,8 @@ static void hidinput_configure_usage(str
+               case 0x29d: map_key_clear(KEY_KBD_LAYOUT_NEXT); break;
++              case 0x2a2: map_key_clear(KEY_ALL_APPLICATIONS);        break;
++
+               case 0x2c7: map_key_clear(KEY_KBDINPUTASSIST_PREV);             break;
+               case 0x2c8: map_key_clear(KEY_KBDINPUTASSIST_NEXT);             break;
+               case 0x2c9: map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP);                break;
+--- a/include/uapi/linux/input-event-codes.h
++++ b/include/uapi/linux/input-event-codes.h
+@@ -278,7 +278,8 @@
+ #define KEY_PAUSECD           201
+ #define KEY_PROG3             202
+ #define KEY_PROG4             203
+-#define KEY_DASHBOARD         204     /* AL Dashboard */
++#define KEY_ALL_APPLICATIONS  204     /* AC Desktop Show All Applications */
++#define KEY_DASHBOARD         KEY_ALL_APPLICATIONS
+ #define KEY_SUSPEND           205
+ #define KEY_CLOSE             206     /* AC Close */
+ #define KEY_PLAY              207
diff --git a/queue-5.16/hid-add-mapping-for-key_dictate.patch b/queue-5.16/hid-add-mapping-for-key_dictate.patch
new file mode 100644 (file)
index 0000000..0f92884
--- /dev/null
@@ -0,0 +1,57 @@
+From bfa26ba343c727e055223be04e08f2ebdd43c293 Mon Sep 17 00:00:00 2001
+From: William Mahon <wmahon@chromium.org>
+Date: Thu, 3 Mar 2022 18:23:42 -0800
+Subject: HID: add mapping for KEY_DICTATE
+
+From: William Mahon <wmahon@chromium.org>
+
+commit bfa26ba343c727e055223be04e08f2ebdd43c293 upstream.
+
+Numerous keyboards are adding dictate keys which allows for text
+messages to be dictated by a microphone.
+
+This patch adds a new key definition KEY_DICTATE and maps 0x0c/0x0d8
+usage code to this new keycode. Additionally hid-debug is adjusted to
+recognize this new usage code as well.
+
+Signed-off-by: William Mahon <wmahon@chromium.org>
+Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20220303021501.1.I5dbf50eb1a7a6734ee727bda4a8573358c6d3ec0@changeid
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/hid-debug.c                |    1 +
+ drivers/hid/hid-input.c                |    1 +
+ include/uapi/linux/input-event-codes.h |    1 +
+ 3 files changed, 3 insertions(+)
+
+--- a/drivers/hid/hid-debug.c
++++ b/drivers/hid/hid-debug.c
+@@ -934,6 +934,7 @@ static const char *keys[KEY_MAX + 1] = {
+       [KEY_ASSISTANT] = "Assistant",
+       [KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext",
+       [KEY_EMOJI_PICKER] = "EmojiPicker",
++      [KEY_DICTATE] = "Dictate",
+       [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
+       [KEY_BRIGHTNESS_MAX] = "BrightnessMax",
+       [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto",
+--- a/drivers/hid/hid-input.c
++++ b/drivers/hid/hid-input.c
+@@ -994,6 +994,7 @@ static void hidinput_configure_usage(str
+               case 0x0cd: map_key_clear(KEY_PLAYPAUSE);       break;
+               case 0x0cf: map_key_clear(KEY_VOICECOMMAND);    break;
++              case 0x0d8: map_key_clear(KEY_DICTATE);         break;
+               case 0x0d9: map_key_clear(KEY_EMOJI_PICKER);    break;
+               case 0x0e0: map_abs_clear(ABS_VOLUME);          break;
+--- a/include/uapi/linux/input-event-codes.h
++++ b/include/uapi/linux/input-event-codes.h
+@@ -612,6 +612,7 @@
+ #define KEY_ASSISTANT         0x247   /* AL Context-aware desktop assistant */
+ #define KEY_KBD_LAYOUT_NEXT   0x248   /* AC Next Keyboard Layout Select */
+ #define KEY_EMOJI_PICKER      0x249   /* Show/hide emoji picker (HUTRR101) */
++#define KEY_DICTATE           0x24a   /* Start or Stop Voice Dictation Session (HUTRR99) */
+ #define KEY_BRIGHTNESS_MIN            0x250   /* Set Brightness to Minimum */
+ #define KEY_BRIGHTNESS_MAX            0x251   /* Set Brightness to Maximum */
diff --git a/queue-5.16/input-elan_i2c-fix-regulator-enable-count-imbalance-after-suspend-resume.patch b/queue-5.16/input-elan_i2c-fix-regulator-enable-count-imbalance-after-suspend-resume.patch
new file mode 100644 (file)
index 0000000..a6eaca5
--- /dev/null
@@ -0,0 +1,56 @@
+From 04b7762e37c95d9b965d16bb0e18dbd1fa2e2861 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 28 Feb 2022 23:39:50 -0800
+Subject: Input: elan_i2c - fix regulator enable count imbalance after suspend/resume
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 04b7762e37c95d9b965d16bb0e18dbd1fa2e2861 upstream.
+
+Before these changes elan_suspend() would only disable the regulator
+when device_may_wakeup() returns false; whereas elan_resume() would
+unconditionally enable it, leading to an enable count imbalance when
+device_may_wakeup() returns true.
+
+This triggers the "WARN_ON(regulator->enable_count)" in regulator_put()
+when the elan_i2c driver gets unbound, this happens e.g. with the
+hot-plugable dock with Elan I2C touchpad for the Asus TF103C 2-in-1.
+
+Fix this by making the regulator_enable() call also be conditional
+on device_may_wakeup() returning false.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20220131135436.29638-2-hdegoede@redhat.com
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/mouse/elan_i2c_core.c |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/drivers/input/mouse/elan_i2c_core.c
++++ b/drivers/input/mouse/elan_i2c_core.c
+@@ -1388,17 +1388,17 @@ static int __maybe_unused elan_resume(st
+       struct elan_tp_data *data = i2c_get_clientdata(client);
+       int error;
+-      if (device_may_wakeup(dev) && data->irq_wake) {
++      if (!device_may_wakeup(dev)) {
++              error = regulator_enable(data->vcc);
++              if (error) {
++                      dev_err(dev, "error %d enabling regulator\n", error);
++                      goto err;
++              }
++      } else if (data->irq_wake) {
+               disable_irq_wake(client->irq);
+               data->irq_wake = false;
+       }
+-      error = regulator_enable(data->vcc);
+-      if (error) {
+-              dev_err(dev, "error %d enabling regulator\n", error);
+-              goto err;
+-      }
+-
+       error = elan_set_power(data, true);
+       if (error) {
+               dev_err(dev, "power up when resuming failed: %d\n", error);
diff --git a/queue-5.16/input-elan_i2c-move-regulator_able-out-of-elan_able_power.patch b/queue-5.16/input-elan_i2c-move-regulator_able-out-of-elan_able_power.patch
new file mode 100644 (file)
index 0000000..80151bf
--- /dev/null
@@ -0,0 +1,125 @@
+From 81a36d8ce554b82b0a08e2b95d0bd44fcbff339b Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 28 Feb 2022 23:39:38 -0800
+Subject: Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power()
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 81a36d8ce554b82b0a08e2b95d0bd44fcbff339b upstream.
+
+elan_disable_power() is called conditionally on suspend, where as
+elan_enable_power() is always called on resume. This leads to
+an imbalance in the regulator's enable count.
+
+Move the regulator_[en|dis]able() calls out of elan_[en|dis]able_power()
+in preparation of fixing this.
+
+No functional changes intended.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20220131135436.29638-1-hdegoede@redhat.com
+[dtor: consolidate elan_[en|dis]able() into elan_set_power()]
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/mouse/elan_i2c_core.c |   62 ++++++++++++------------------------
+ 1 file changed, 22 insertions(+), 40 deletions(-)
+
+--- a/drivers/input/mouse/elan_i2c_core.c
++++ b/drivers/input/mouse/elan_i2c_core.c
+@@ -186,55 +186,21 @@ static int elan_get_fwinfo(u16 ic_type,
+       return 0;
+ }
+-static int elan_enable_power(struct elan_tp_data *data)
++static int elan_set_power(struct elan_tp_data *data, bool on)
+ {
+       int repeat = ETP_RETRY_COUNT;
+       int error;
+-      error = regulator_enable(data->vcc);
+-      if (error) {
+-              dev_err(&data->client->dev,
+-                      "failed to enable regulator: %d\n", error);
+-              return error;
+-      }
+-
+       do {
+-              error = data->ops->power_control(data->client, true);
++              error = data->ops->power_control(data->client, on);
+               if (error >= 0)
+                       return 0;
+               msleep(30);
+       } while (--repeat > 0);
+-      dev_err(&data->client->dev, "failed to enable power: %d\n", error);
+-      return error;
+-}
+-
+-static int elan_disable_power(struct elan_tp_data *data)
+-{
+-      int repeat = ETP_RETRY_COUNT;
+-      int error;
+-
+-      do {
+-              error = data->ops->power_control(data->client, false);
+-              if (!error) {
+-                      error = regulator_disable(data->vcc);
+-                      if (error) {
+-                              dev_err(&data->client->dev,
+-                                      "failed to disable regulator: %d\n",
+-                                      error);
+-                              /* Attempt to power the chip back up */
+-                              data->ops->power_control(data->client, true);
+-                              break;
+-                      }
+-
+-                      return 0;
+-              }
+-
+-              msleep(30);
+-      } while (--repeat > 0);
+-
+-      dev_err(&data->client->dev, "failed to disable power: %d\n", error);
++      dev_err(&data->client->dev, "failed to set power %s: %d\n",
++              on ? "on" : "off", error);
+       return error;
+ }
+@@ -1399,9 +1365,19 @@ static int __maybe_unused elan_suspend(s
+               /* Enable wake from IRQ */
+               data->irq_wake = (enable_irq_wake(client->irq) == 0);
+       } else {
+-              ret = elan_disable_power(data);
++              ret = elan_set_power(data, false);
++              if (ret)
++                      goto err;
++
++              ret = regulator_disable(data->vcc);
++              if (ret) {
++                      dev_err(dev, "error %d disabling regulator\n", ret);
++                      /* Attempt to power the chip back up */
++                      elan_set_power(data, true);
++              }
+       }
++err:
+       mutex_unlock(&data->sysfs_mutex);
+       return ret;
+ }
+@@ -1417,7 +1393,13 @@ static int __maybe_unused elan_resume(st
+               data->irq_wake = false;
+       }
+-      error = elan_enable_power(data);
++      error = regulator_enable(data->vcc);
++      if (error) {
++              dev_err(dev, "error %d enabling regulator\n", error);
++              goto err;
++      }
++
++      error = elan_set_power(data, true);
+       if (error) {
+               dev_err(dev, "power up when resuming failed: %d\n", error);
+               goto err;
diff --git a/queue-5.16/input-samsung-keypad-properly-state-iomem-dependency.patch b/queue-5.16/input-samsung-keypad-properly-state-iomem-dependency.patch
new file mode 100644 (file)
index 0000000..e51238d
--- /dev/null
@@ -0,0 +1,36 @@
+From ba115adf61b36b8c167126425a62b0efc23f72c0 Mon Sep 17 00:00:00 2001
+From: David Gow <davidgow@google.com>
+Date: Sun, 27 Feb 2022 21:00:10 -0800
+Subject: Input: samsung-keypad - properly state IOMEM dependency
+
+From: David Gow <davidgow@google.com>
+
+commit ba115adf61b36b8c167126425a62b0efc23f72c0 upstream.
+
+Make the samsung-keypad driver explicitly depend on CONFIG_HAS_IOMEM, as it
+calls devm_ioremap(). This prevents compile errors in some configs (e.g,
+allyesconfig/randconfig under UML):
+
+/usr/bin/ld: drivers/input/keyboard/samsung-keypad.o: in function `samsung_keypad_probe':
+samsung-keypad.c:(.text+0xc60): undefined reference to `devm_ioremap'
+
+Signed-off-by: David Gow <davidgow@google.com>
+Acked-by: anton ivanov <anton.ivanov@cambridgegreys.com>
+Link: https://lore.kernel.org/r/20220225041727.1902850-1-davidgow@google.com
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/keyboard/Kconfig |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/input/keyboard/Kconfig
++++ b/drivers/input/keyboard/Kconfig
+@@ -556,7 +556,7 @@ config KEYBOARD_PMIC8XXX
+ config KEYBOARD_SAMSUNG
+       tristate "Samsung keypad support"
+-      depends on HAVE_CLK
++      depends on HAS_IOMEM && HAVE_CLK
+       select INPUT_MATRIXKMAP
+       help
+         Say Y here if you want to use the keypad on your Samsung mobile
index 1d46c4afb162e6699c7fdfa3464a0ead3482061f..35b80fd112bac00096f146d232cd3dd290a9ea22 100644 (file)
@@ -163,3 +163,8 @@ drm-amdgpu-fix-suspend-resume-hang-regression.patch
 net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch
 selftests-mlxsw-resource_scale-fix-return-value.patch
 net-stmmac-perserve-tx-and-rx-coalesce-value-during-xdp-setup.patch
+input-elan_i2c-move-regulator_able-out-of-elan_able_power.patch
+input-elan_i2c-fix-regulator-enable-count-imbalance-after-suspend-resume.patch
+input-samsung-keypad-properly-state-iomem-dependency.patch
+hid-add-mapping-for-key_dictate.patch
+hid-add-mapping-for-key_all_applications.patch