summaryrefslogtreecommitdiff
path: root/tools/perf/python/stackcollapse.py
diff options
context:
space:
mode:
authorDenis Benato <denis.benato@linux.dev>2026-09-16 14:38:26 +0000
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-09-18 21:07:11 +0300
commit341b4769f5cf2836d1d3ee7ea2259ffa7a477546 (patch)
tree5b26d857833a6c5a7827fc4ae5a94993fc42d364 /tools/perf/python/stackcollapse.py
parent159e956fd4f9cf863b2759cffb4f01fd4d6c2742 (diff)
downloadlinux-next-341b4769f5cf2836d1d3ee7ea2259ffa7a477546.tar.gz
linux-next-341b4769f5cf2836d1d3ee7ea2259ffa7a477546.zip
platform/x86: asus-wmi: fix screenpad power state detection
On some models, e.g. the UX5400EA, the screenpad power state cannot be read back: DSTS(ASUS_WMI_DEVID_SCREENPAD_POWER) never sets ASUS_WMI_DSTS_STATUS_BIT, so asus_wmi_get_devstate_simple() reports the panel as powered off regardless of its real state. The DSDT shows DSTS 0x00050031 (POWER) and DSTS 0x00050032 (LIGHT) both read the same two-byte EC register, each returning a different byte: byte 0 is a raw EC status byte, which is 0xa0 when the panel is powered and 0x00 when it is off, and byte 1 is the brightness. Read the power state from the low byte instead of ASUS_WMI_DSTS_STATUS_BIT: firmware reporting the power through the status bit is covered too, since ASUS_WMI_DSTS_STATUS_BIT lies inside ASUS_WMI_DSTS_BRIGHTNESS_MASK. Reuse read_screenpad_backlight_power() in asus_screenpad_init() in place of the raw devstate read. This makes the brightness read reachable on models like the UX5400EA, so mask the SCREENPAD_LIGHT value with ASUS_WMI_DSTS_BRIGHTNESS_MASK before storing it: the unmasked devstate (0x0001ffa0 when the panel is on) would otherwise be exposed to userspace as an out-of-range brightness (max_brightness is 255) which systemd-backlight then persists. While at it, pass asus_wmi_get_devstate() the u32 it expects. Fixes: 130d29c5627c ("platform/x86: asus-wmi: adjust screenpad power/brightness handling") Reported-by: Hugo Baigue <hugobaigue2004@gmail.com> Closes: https://lore.kernel.org/all/CAO84+x+P2_xyHP89+nGVSMV6bL+dy0P9=vyEEfZGnFhv0hBNWw@mail.gmail.com/ Suggested-by: Hugo Baigue <hugobaigue2004@gmail.com> Tested-by: Hugo Baigue <hugobaigue2004@gmail.com> Cc: stable@vger.kernel.org Assisted-by: zcode:glm-5.3-flash Signed-off-by: Denis Benato <denis.benato@linux.dev> Link: https://patch.msgid.link/20260916143838.170950-3-denis.benato@linux.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'tools/perf/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions