diff options
| author | Denis Benato <denis.benato@linux.dev> | 2026-09-25 14:42:26 +0000 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2026-10-07 13:06:39 +0300 |
| commit | 96c6f54591d0bc24c2a3ead80bbe23f20d930bce (patch) | |
| tree | b534c9bd4aa0ab8dc883e2e1d39d2b5415ffb3ba /include/linux/platform_data | |
| parent | effd8855745596435bbca4f72187664a2f42d613 (diff) | |
| download | linux-next-96c6f54591d0bc24c2a3ead80bbe23f20d930bce.tar.gz linux-next-96c6f54591d0bc24c2a3ead80bbe23f20d930bce.zip | |
platform/x86: asus-armoury: let attribute groups decide their own visibility
mini_led_mode, gpu_mux_mode and dgpu_disable are created by ad-hoc
conditional blocks in asus_fw_attr_add() which must be manually tracked
by the error and exit paths; those paths also re-probe WMI to know which
groups were actually created.
Give every attribute group its own .is_visible() callback: all groups
are created unconditionally through the common loop and sysfs hides the
unsupported ones entirely. The plain group macros now gate their
visibility on the WMI presence of their device, the
ASUS_ATTR_GROUP_BOOL() and ASUS_ATTR_GROUP_ENUM() macros declare groups
backed by a device ID resolved at probe time, and the power tunable
macros are additionally gated on the platform limits defining a max
value, replacing the special-casing in asus_fw_attr_add() and with it
is_power_tunable_attr().
The dgpu_disable attribute now goes through the same resolved device ID
scheme as mini_led_mode and gpu_mux_mode, storing the device ID to use
in asus_armoury.dgpu_disable_dev_id instead of always operating on
ASUS_WMI_DEVID_DGPU.
No functional change is intended.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20260925144229.3693-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 'include/linux/platform_data')
0 files changed, 0 insertions, 0 deletions
