Skip to contentSkip to conversation

platform/x86: asus-wmi: add support for ASUS screenpad

PATCH Superseded Luke D. Jones 3 participants 5 messages May 3, 2023 – May 5, 2023

Subsystems (2)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Luke D. Jones

author maintainer
#0 lore raw

PATCH 1/1 platform/x86: asus-wmi: add support for ASUS screenpad

Add support for the WMI methods used to turn off and adjust the brightness of the secondary "screenpad" device found on some high-end ASUS laptops like the GX650P series and others.

---
 .../ABI/testing/sysfs-platform-asus-wmi       |  20 +++
 drivers/platform/x86/asus-wmi.c               | 121 ++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h    |   4 +
 3 files changed, 145 insertions(+)
Documentation/ABI/testing/sysfs-platform-asus-wmi +20 -0
index a77a004a1baa..97028c919c03 100644
@@ -98,3 +98,23 @@ Description:
 		Enable an LCD response-time boost to reduce or remove ghosting:
 			* 0 - Disable,
 			* 1 - Enable
+
+What:		/sys/devices/platform/<platform>/screenpad_enable
+Date:		May 2023
+KernelVersion:	6.4
+Contact:	"Luke Jones" <[email protected]>
+Description:
+		Enable the secondary "screenpad" screen found on some ASUS
+		devices which is typically a short screen mounted above the
+		keyboard and below the main screen:
+			* 0 - Disable,
+			* 1 - Enable
+
+What:		/sys/devices/platform/<platform>/screenpad_brightness
+Date:		May 2023
+KernelVersion:	6.4
+Contact:	"Luke Jones" <[email protected]>
+Description:
+		Control the brightness of the secondary "screenpad" screen
+		found on some ASUS devices:
+			* 0-255 where 255 is maximum brightness
\ No newline at end of file
drivers/platform/x86/asus-wmi.c +121 -0

151 lines not on this page · raw message

include/linux/platform_data/x86/asus-wmi.h +4 -0
index 28234dc9fa6a..978627aac87c 100644
@@ -58,6 +58,10 @@
 #define ASUS_WMI_DEVID_KBD_BACKLIGHT	0x00050021
 #define ASUS_WMI_DEVID_LIGHT_SENSOR	0x00050022 /* ?? */
 #define ASUS_WMI_DEVID_LIGHTBAR		0x00050025
+/* This can only be used to disable the screen, not re-enable */
+#define ASUS_WMI_DEVID_SCREENPAD_DISABLE	0x00050031
+/* Writing a brightness re-enables the screen if disabled */
+#define ASUS_WMI_DEVID_SCREENPAD_LIGHT	0x00050032
 #define ASUS_WMI_DEVID_FAN_BOOST_MODE	0x00110018
 #define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY 0x00120075
 
Signature · 1 line
2.40.0
#1 lore raw

Hi

2023. május 3., szerda 6:02 keltezéssel, Luke D. Jones <[email protected]> írta:

Quoted 3 lines

Add support for the WMI methods used to turn off and adjust the brightness of the secondary "screenpad" device found on some high-end ASUS laptops like the GX650P series and others.

Is it this one: https://www.asus.com/content/rog-screenpad-plus/ ? Or is the "plus" version something different?

If it's a "proper" screen, wouldn't it be better to add support for it in the respective subsystems? E.g. why not register a backlight device?

Quoted 4 lines

---
[...]

Regards,
Barnabás Pőcze

author maintainer
#2 lore raw
Quoted 10 lines · Barnabás Pőcze

Hi

2023. május 3., szerda 6:02 keltezéssel, Luke D. Jones <[email protected]> írta:

Quoted 4 lines

Add support for the WMI methods used to turn off and adjust the brightness of the secondary "screenpad" device found on some
high-end
ASUS laptops like the GX650P series and others.

Quoted 5 lines

Is it this one: https://www.asus.com/content/rog-screenpad-plus/ ? Or is the "plus" version something different?

If it's a "proper" screen, wouldn't it be better to add support for it in the respective subsystems? E.g. why not register a backlight device?

I think it is similar yes, likely the same thing.

Adding as a proper backlight is what I wanted to do but at first blush I wasn't sure.

Looking at include/linux/backlight.h + some examples it looks clear now. I'll try to work up a revised patch and get it tested by the folks with the actual laptop.

My only possible issue would be how to handle the on/off part?

Cheers,
Luke.

author maintainer
#3 lore raw
Quoted 23 lines · Luke Jones
Quoted 10 lines · Barnabás Pőcze

Hi

2023. május 3., szerda 6:02 keltezéssel, Luke D. Jones <[email protected]> írta:

Quoted 4 lines

Add support for the WMI methods used to turn off and adjust the brightness of the secondary "screenpad" device found on some
high-end
ASUS laptops like the GX650P series and others.

Quoted 5 lines

Is it this one: https://www.asus.com/content/rog-screenpad-plus/ ? Or is the "plus" version something different?

If it's a "proper" screen, wouldn't it be better to add support for it in the respective subsystems? E.g. why not register a backlight device?

I think it is similar yes, likely the same thing.

Adding as a proper backlight is what I wanted to do but at first blush I wasn't sure.

Quoted 7 lines

Looking at include/linux/backlight.h + some examples it looks clear now. I'll try to work up a revised patch and get it tested by the folks with the actual laptop.

My only possible issue would be how to handle the on/off part?

Cheers,
Luke.

This has now been addressed with "[PATCH v2 0/1] platform/x86: asus-wmi: add support for ASUS screenpad" at https://lkml.org/lkml/2023/5/5/9

#4 lore raw
In reply to Luke D. Jones
kernel test robot noticed the following build warnings:

Hi Luke,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linus/master v6.3 next-20230428] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Luke-D-Jones/platform-x86-asus-wmi-add-support-for-ASUS-screenpad/20230503-120548
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20230503040207.257406-1-luke%40ljones.dev
patch subject: [PATCH] platform/x86: asus-wmi: add support for ASUS screenpad
reproduce:
        # https://github.com/intel-lab-lkp/linux/commit/ff073483de3660059cb167912c02e51226e4b32e
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Luke-D-Jones/platform-x86-asus-wmi-add-support-for-ASUS-screenpad/20230503-120548
        git checkout ff073483de3660059cb167912c02e51226e4b32e
        make menuconfig
        # enable CONFIG_COMPILE_TEST, CONFIG_WARN_MISSING_DOCUMENTS, CONFIG_WARN_ABI_ERRORS
        make htmldocs

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> Documentation/ABI/testing/sysfs-platform-asus-wmi:114: WARNING: Unexpected indentation.

vim +114 Documentation/ABI/testing/sysfs-platform-asus-wmi

 > 114	Date:		May 2023
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests