stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, James John <me@donjajo.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.19 52/61] platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e
Date: Mon,  6 Nov 2023 14:03:48 +0100	[thread overview]
Message-ID: <20231106130301.380201361@linuxfoundation.org> (raw)
In-Reply-To: <20231106130259.573843228@linuxfoundation.org>

4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit f37cc2fc277b371fc491890afb7d8a26e36bb3a1 ]

Older Asus laptops change the backlight level themselves and then send
WMI events with different codes for different backlight levels.

The asus-wmi.c code maps the entire range of codes reported on
brightness down keypresses to an internal ASUS_WMI_BRN_DOWN code:

define NOTIFY_BRNUP_MIN                0x11
define NOTIFY_BRNUP_MAX                0x1f
define NOTIFY_BRNDOWN_MIN              0x20
define NOTIFY_BRNDOWN_MAX              0x2e

        if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
                code = ASUS_WMI_BRN_UP;
        else if (code >= NOTIFY_BRNDOWN_MIN && code <= NOTIFY_BRNDOWN_MAX)
                code = ASUS_WMI_BRN_DOWN;

Before this commit all the NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX
aka 0x20 - 0x2e events were mapped to 0x20.

This mapping is causing issues on new laptop models which actually
send 0x2b events for printscreen presses and 0x2c events for
capslock presses, which get translated into spurious brightness-down
presses.

The plan is disable the 0x11-0x2e special mapping on laptops
where asus-wmi does not register a backlight-device to avoid
the spurious brightness-down keypresses. New laptops always send
0x2e for brightness-down presses, change the special internal
ASUS_WMI_BRN_DOWN value from 0x20 to 0x2e to match this in
preparation for fixing the spurious brightness-down presses.

This change does not have any functional impact since all
of 0x20 - 0x2e is mapped to ASUS_WMI_BRN_DOWN first and only
then checked against the keymap code and the new 0x2e
value is still in the 0x20 - 0x2e range.

Reported-by: James John <me@donjajo.com>
Closes: https://lore.kernel.org/platform-driver-x86/a2c441fe-457e-44cf-a146-0ecd86b037cf@donjajo.com/
Closes: https://bbs.archlinux.org/viewtopic.php?pid=2123716
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231017090725.38163-2-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/platform/x86/asus-wmi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 57a79bddb2861..95612878a841f 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -31,7 +31,7 @@
 #include <linux/i8042.h>
 
 #define ASUS_WMI_KEY_IGNORE (-1)
-#define ASUS_WMI_BRN_DOWN	0x20
+#define ASUS_WMI_BRN_DOWN	0x2e
 #define ASUS_WMI_BRN_UP		0x2f
 
 struct module;
-- 
2.42.0




  parent reply	other threads:[~2023-11-06 13:11 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 13:02 [PATCH 4.19 00/61] 4.19.298-rc1 review Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.19 01/61] mmc: sdio: Dont re-initialize powered-on removable SDIO cards at resume Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.19 02/61] mmc: core: sdio: hold retuning if sdio in 1-bit mode Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.19 03/61] selftests/ftrace: Add new test case which checks non unique symbol Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 04/61] mcb: Return actual parsed size when reading chameleon table Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 05/61] mcb-lpc: Reallocate memory region to avoid memory overlapping Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 06/61] virtio_balloon: Fix endless deflation and inflation on arm64 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 07/61] virtio-mmio: fix memory leak of vm_dev Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 08/61] r8169: rename r8169.c to r8169_main.c Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 09/61] r8169: fix the KCSAN reported data-race in rtl_tx while reading TxDescArray[entry].opts1 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 10/61] r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 11/61] treewide: Spelling fix in comment Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 12/61] igb: Fix potential memory leak in igb_add_ethtool_nfc_entry Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 13/61] gtp: fix fragmentation needed check with gso Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 14/61] i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 15/61] i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 16/61] i2c: muxes: i2c-mux-gpmux: " Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 17/61] i2c: muxes: i2c-demux-pinctrl: " Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 18/61] i2c: stm32f7: Fix PEC handling in case of SMBUS transfers Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 19/61] nvmem: imx: correct nregs for i.MX6SLL Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 20/61] nvmem: imx: correct nregs for i.MX6UL Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 21/61] perf/core: Fix potential NULL deref Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 22/61] iio: exynos-adc: request second interupt only when touchscreen mode is used Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 23/61] x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 24/61] NFS: Dont call generic_error_remove_page() while holding locks Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 25/61] ARM: 8933/1: replace Sun/Solaris style flag on section directive Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 26/61] drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 27/61] arm64: fix a concurrency issue in emulation_proc_handler() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 28/61] kobject: Fix slab-out-of-bounds in fill_kobj_path() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 29/61] smbdirect: missing rc checks while waiting for rdma events Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 30/61] f2fs: fix to do sanity check on inode type during garbage collection Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 31/61] nfsd: lock_rename() needs both directories to live on the same fs Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 32/61] x86/mm: Simplify RESERVE_BRK() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 33/61] x86/mm: Fix RESERVE_BRK() for older binutils Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 34/61] driver: platform: Add helper for safer setting of driver_override Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 35/61] rpmsg: Constify local variable in field store macro Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 36/61] rpmsg: Fix kfree() of static memory on setting driver_override Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 37/61] rpmsg: Fix calling device_lock() on non-initialized device Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 38/61] rpmsg: glink: Release driver_override Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 39/61] rpmsg: Fix possible refcount leak in rpmsg_register_device_override() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 40/61] x86: Fix .brk attribute in linker script Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 41/61] MAINTAINERS: r8169: Update path to the driver Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 42/61] ASoC: simple-card: fixup asoc_simple_probe() error handling Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 43/61] Input: i8042 - add Fujitsu Lifebook E5411 to i8042 quirk table Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 44/61] irqchip/stm32-exti: add missing DT IRQ flag translation Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 45/61] dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 46/61] Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 47/61] fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 48/61] netfilter: nfnetlink_log: silence bogus compiler warning Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 49/61] ASoC: rt5650: fix the wrong result of key button Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 50/61] fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 51/61] scsi: mpt3sas: Fix in error path Greg Kroah-Hartman
2023-11-06 13:03 ` Greg Kroah-Hartman [this message]
2023-11-06 13:03 ` [PATCH 4.19 53/61] net: chelsio: cxgb4: add an error code check in t4_load_phy_fw Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 54/61] ata: ahci: fix enum constants for gcc-13 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 55/61] remove the sx8 block driver Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 56/61] PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 57/61] usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 58/61] tty: 8250: Remove UC-257 and UC-431 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 59/61] tty: 8250: Add support for additional Brainboxes UC cards Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 60/61] tty: 8250: Add support for Brainboxes UP cards Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.19 61/61] tty: 8250: Add support for Intashield IS-100 Greg Kroah-Hartman
2023-11-06 21:35 ` [PATCH 4.19 00/61] 4.19.298-rc1 review Pavel Machek
2023-11-06 21:56 ` Pavel Machek
2023-11-07 11:42 ` Jon Hunter
2023-11-07 15:55 ` Shuah Khan
2023-11-07 18:13 ` Naresh Kamboju
2023-11-07 18:53 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231106130301.380201361@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=me@donjajo.com \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).