Skip to content

platform/x86: Add asus-armoury driver

Luke Jones lkml platform-driver-x86 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest8 patches 10 repliesIn review
  2. v78 patches 5 repliesSuperseded
  3. v69 patches 12 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v59 patches6 repliesSuperseded
v3 posting 2/20 of 5 patches0 repliesSuperseded
v49 patches28 repliesSuperseded
v3 posting 1/25 patches10 repliesSuperseded
v2 posting 2/26 patches12 repliesSuperseded
v2 posting 1/21 patch1 replySuperseded
v11 patch1 replySuperseded

Changelog from the cover letter · 63 lines

- v1
- Initial submission
- v2
- Too many changes to list, but all concerns raised in previous submission addressed.
- History: https://lore.kernel.org/platform-driver-x86/[email protected]/
- v3
- All concerns addressed.
- History: https://lore.kernel.org/platform-driver-x86/[email protected]/
- v4
- Use EXPORT_SYMBOL_NS_GPL() for the symbols required in this patch series
- Add patch for hid-asus due to the use of EXPORT_SYMBOL_NS_GPL()
- Split the PPT knobs out to a separate patch
- Split the hd_panel setting out to a new patch
- Clarify some of APU MEM configuration and convert int to hex
- Rename deprecated Kconfig option to ASUS_WMI_DEPRECATED_ATTRS
- Fixup cyclic dependency in Kconfig
- v5
- deprecate patch: cleanup ``#if`, ``#endif` statements, edit kconfig detail, edit commit msg
- cleanup ppt* tuning patch
- proper error handling in module init, plus pr_err()
- ppt tunables have a notice if there is no match to get defaults
- better error handling in cpu core handling
- don't continue if failure
- use the mutex to gate WMI writes
- V6
- correctly cleanup/unwind if module init fails
- V7
- Remove review tags where the code changed significantly
- Add auto_screen_brightness WMI attribute support
- Move PPT patch to end
- Add support min/max PPT values for 36 laptops (and two handhelds)
- reword commit for "asus-wmi: export symbols used for read/write WMI"
- asus-armoury: move existing tunings to asus-armoury
- Correction to license header
- Remove the (initial) mutex use (added for core count only in that patch)
- Clarify some doc comments (attr_int_store)
- Cleanup pr_warn in dgpu/egpu/mux functions
- Restructure logic in asus_fw_attr_add()
- Check gpu_mux_dev_id and mini_led_dev_id before remove attrs
- asus-armoury: add core count control:
- add mutex to prevent possible concurrent write to the core
count WMI due to separated bit/little attributes
- asus-armoury: add ppt_* and nv_* tuning knobs:
- Move to end of series
- Refactor to use a table of allowed min/max values to
ensure safe settings
- General code cleanup
- Ensure checkpatch.pl returns clean for all
- V8
- asus-armoury: move existing tunings to asus-armoury module
- Further cleanup: https://lore.kernel.org/platform-driver-x86/[email protected]/T/#m72e203f64a5a28c9c21672406b2e9f554a8a8e38
- asus-armoury: add ppt_* and nv_* tuning knobs
- Address concerns in https://lore.kernel.org/platform-driver-x86/[email protected]/T/#m77971b5c1e7f018954c16354e623fc06522c5e41
- Refactor struct asus_armoury_priv to record both AC and DC settings
- Tidy macros and functions affected by the above to be clearer as a result
- Move repeated strings such as "ppt_pl1_spl" to #defines
- Split should_create_tunable_attr() in to two functions to better clarify:
- is_power_tunable_attr()
- has_valid_limit()
- Restructure init_rog_tunables() to initialise AC and DC in a
way that makes more sense.
- Ensure that if DC setting table is not available then attributes
return -ENODEV only if on DC mode.

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8platform/x86: asus-wmi: export symbols used for read/write WMIdrivers/platform/x86/asus-wmi.c include/linux/platform_data/x86/asus-wmi.h+51 -31 reply
2/8platform/x86: asus-armoury: move existing tunings to asus-armoury moduledrivers/platform/x86/Kconfig drivers/platform/x86/Makefile drivers/platform/x86/asus-armoury.c +3 more+720 -41 reply
3/8platform/x86: asus-armoury: add panel_hd_mode attributedrivers/platform/x86/asus-armoury.c include/linux/platform_data/x86/asus-wmi.h+6 -11 reply
4/8platform/x86: asus-armoury: add apu-mem control supportdrivers/platform/x86/asus-armoury.c include/linux/platform_data/x86/asus-wmi.h+116 -01 reply
5/8platform/x86: asus-armoury: add core count controldrivers/platform/x86/asus-armoury.c drivers/platform/x86/asus-armoury.h include/linux/platform_data/x86/asus-wmi.h+289 -11 reply
6/8platform/x86: asus-armoury: add screen auto-brightness toggledrivers/platform/x86/asus-armoury.c include/linux/platform_data/x86/asus-wmi.h+4 -02 replies
7/8platform/x86: asus-wmi: deprecate bios featuresDocumentation/ABI/testing/sysfs-platform-asus-wmi drivers/platform/x86/Kconfig drivers/platform/x86/asus-wmi.c+124 -251 reply
8/8platform/x86: asus-armoury: add ppt_* and nv_* tuning knobsdrivers/platform/x86/asus-armoury.c drivers/platform/x86/asus-armoury.h include/linux/platform_data/x86/asus-wmi.h+1382 -72 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchMario LimoncielloIlpo Järvinen
1/8R-b
2/8R-b
3/8R-b R-b
4/8R-b
5/8R-b
6/8R-b R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/8] platform/x86: Add asus-armoury driver

Hi all,

the TL;DR:
1. Introduce new module to contain bios attributes, using fw_attributes_class
2. Deprecate all possible attributes from asus-wmi that were added ad-hoc
3. Remove those in the next LTS cycle

The idea for this originates from a conversation with Mario Limonciello
https://lore.kernel.org/platform-driver-x86/[email protected]/

It is without a doubt much cleaner to use, easier to discover, and the API is well defined as opposed to the random clutter of attributes I had been placing in the platform sysfs. Given that Derek is also working on a similar approach to Lenovo in part based on my initial work I'd like to think that the overall approach is good and may become standardised for these types of things.

Regarding PPT: it is intended to add support for "custom" platform profile soon. If it's a blocker for this patch series being accepted I will drop the platform-x86-asus-armoury-add-ppt_-and-nv_-tuning.patch and get that done separately to avoid holding the bulk of the series up. Ideally I would like to get the safe limits in so users don't fully lose functionality or continue to be exposed to potential instability from setting too low, or be mislead in to thinking they can set limits higher than actual limit.

The bulk of the PPT patch is data, the actual functional part is relatively small and similar to the last version.

Unfortunately I've been rather busy over the months and may not cover everything in the v7 changelog but I've tried to be as comprehensive as I can.

Regards,
Luke

Changelog:
- v1
- Initial submission
- v2
- Too many changes to list, but all concerns raised in previous submission addressed.
- History: https://lore.kernel.org/platform-driver-x86/[email protected]/
- v3
- All concerns addressed.
- History: https://lore.kernel.org/platform-driver-x86/[email protected]/
- v4
- Use EXPORT_SYMBOL_NS_GPL() for the symbols required in this patch series
- Add patch for hid-asus due to the use of EXPORT_SYMBOL_NS_GPL()
- Split the PPT knobs out to a separate patch
- Split the hd_panel setting out to a new patch
- Clarify some of APU MEM configuration and convert int to hex
- Rename deprecated Kconfig option to ASUS_WMI_DEPRECATED_ATTRS
- Fixup cyclic dependency in Kconfig
- v5
- deprecate patch: cleanup ``#if`, ``#endif` statements, edit kconfig detail, edit commit msg
- cleanup ppt* tuning patch
- proper error handling in module init, plus pr_err()
- ppt tunables have a notice if there is no match to get defaults
- better error handling in cpu core handling
- don't continue if failure
- use the mutex to gate WMI writes
- V6
- correctly cleanup/unwind if module init fails
- V7
- Remove review tags where the code changed significantly
- Add auto_screen_brightness WMI attribute support
- Move PPT patch to end
- Add support min/max PPT values for 36 laptops (and two handhelds)
- reword commit for "asus-wmi: export symbols used for read/write WMI"
- asus-armoury: move existing tunings to asus-armoury
- Correction to license header
- Remove the (initial) mutex use (added for core count only in that patch)
- Clarify some doc comments (attr_int_store)
- Cleanup pr_warn in dgpu/egpu/mux functions
- Restructure logic in asus_fw_attr_add()
- Check gpu_mux_dev_id and mini_led_dev_id before remove attrs
- asus-armoury: add core count control:
- add mutex to prevent possible concurrent write to the core
count WMI due to separated bit/little attributes
- asus-armoury: add ppt_* and nv_* tuning knobs:
- Move to end of series
- Refactor to use a table of allowed min/max values to
ensure safe settings
- General code cleanup
- Ensure checkpatch.pl returns clean for all
- V8
- asus-armoury: move existing tunings to asus-armoury module
- Further cleanup: https://lore.kernel.org/platform-driver-x86/[email protected]/T/#m72e203f64a5a28c9c21672406b2e9f554a8a8e38
- asus-armoury: add ppt_* and nv_* tuning knobs
- Address concerns in https://lore.kernel.org/platform-driver-x86/[email protected]/T/#m77971b5c1e7f018954c16354e623fc06522c5e41
- Refactor struct asus_armoury_priv to record both AC and DC settings
- Tidy macros and functions affected by the above to be clearer as a result
- Move repeated strings such as "ppt_pl1_spl" to #defines
- Split should_create_tunable_attr() in to two functions to better clarify:
- is_power_tunable_attr()
- has_valid_limit()
- Restructure init_rog_tunables() to initialise AC and DC in a
way that makes more sense.
- Ensure that if DC setting table is not available then attributes
return -ENODEV only if on DC mode.

Luke D. Jones (7):
platform/x86: asus-wmi: export symbols used for read/write WMI platform/x86: asus-armoury: move existing tunings to asus-armoury
module
platform/x86: asus-armoury: add panel_hd_mode attribute platform/x86: asus-armoury: add apu-mem control support platform/x86: asus-armoury: add core count control platform/x86: asus-wmi: deprecate bios features platform/x86: asus-armoury: add ppt_* and nv_* tuning knobs

Luke Jones (1):
platform/x86: asus-armoury: add screen auto-brightness toggle

 .../ABI/testing/sysfs-platform-asus-wmi       |   17 +
 drivers/platform/x86/Kconfig                  |   23 +
 drivers/platform/x86/Makefile                 |    1 +
 drivers/platform/x86/asus-armoury.c           | 1202 ++++++++++++++++
 drivers/platform/x86/asus-armoury.h           | 1278 +++++++++++++++++
 drivers/platform/x86/asus-wmi.c               |  170 ++-
 include/linux/platform_data/x86/asus-wmi.h    |   24 +
 7 files changed, 2683 insertions(+), 32 deletions(-)
 create mode 100644 drivers/platform/x86/asus-armoury.c
 create mode 100644 drivers/platform/x86/asus-armoury.h
Signature · 1 line
2.49.0