mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
platform/x86: asus-wmi: deprecate bios features
With the existence of the asus-armoury module the attributes no longer need to live under the /sys/devices/platform/asus-nb-wmi/ path. Deprecate all those that were implemented in asus-bioscfg with the goal of removing them fully in the next LTS cycle. Signed-off-by: Denis Benato <denis.benato@linux.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20251102215319.3126879-8-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>
This commit is contained in:
parent
7725a2dc58
commit
c683651b67
|
|
@ -63,6 +63,7 @@ Date: Aug 2022
|
||||||
KernelVersion: 6.1
|
KernelVersion: 6.1
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Switch the GPU hardware MUX mode. Laptops with this feature can
|
Switch the GPU hardware MUX mode. Laptops with this feature can
|
||||||
can be toggled to boot with only the dGPU (discrete mode) or in
|
can be toggled to boot with only the dGPU (discrete mode) or in
|
||||||
standard Optimus/Hybrid mode. On switch a reboot is required:
|
standard Optimus/Hybrid mode. On switch a reboot is required:
|
||||||
|
|
@ -75,6 +76,7 @@ Date: Aug 2022
|
||||||
KernelVersion: 5.17
|
KernelVersion: 5.17
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Disable discrete GPU:
|
Disable discrete GPU:
|
||||||
* 0 - Enable dGPU,
|
* 0 - Enable dGPU,
|
||||||
* 1 - Disable dGPU
|
* 1 - Disable dGPU
|
||||||
|
|
@ -84,6 +86,7 @@ Date: Aug 2022
|
||||||
KernelVersion: 5.17
|
KernelVersion: 5.17
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Enable the external GPU paired with ROG X-Flow laptops.
|
Enable the external GPU paired with ROG X-Flow laptops.
|
||||||
Toggling this setting will also trigger ACPI to disable the dGPU:
|
Toggling this setting will also trigger ACPI to disable the dGPU:
|
||||||
|
|
||||||
|
|
@ -95,6 +98,7 @@ Date: Aug 2022
|
||||||
KernelVersion: 5.17
|
KernelVersion: 5.17
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Enable an LCD response-time boost to reduce or remove ghosting:
|
Enable an LCD response-time boost to reduce or remove ghosting:
|
||||||
* 0 - Disable,
|
* 0 - Disable,
|
||||||
* 1 - Enable
|
* 1 - Enable
|
||||||
|
|
@ -104,6 +108,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Get the current charging mode being used:
|
Get the current charging mode being used:
|
||||||
* 1 - Barrel connected charger,
|
* 1 - Barrel connected charger,
|
||||||
* 2 - USB-C charging
|
* 2 - USB-C charging
|
||||||
|
|
@ -114,6 +119,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Show if the egpu (XG Mobile) is correctly connected:
|
Show if the egpu (XG Mobile) is correctly connected:
|
||||||
* 0 - False,
|
* 0 - False,
|
||||||
* 1 - True
|
* 1 - True
|
||||||
|
|
@ -123,6 +129,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Change the mini-LED mode:
|
Change the mini-LED mode:
|
||||||
* 0 - Single-zone,
|
* 0 - Single-zone,
|
||||||
* 1 - Multi-zone
|
* 1 - Multi-zone
|
||||||
|
|
@ -133,6 +140,7 @@ Date: Apr 2024
|
||||||
KernelVersion: 6.10
|
KernelVersion: 6.10
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
List the available mini-led modes.
|
List the available mini-led modes.
|
||||||
|
|
||||||
What: /sys/devices/platform/<platform>/ppt_pl1_spl
|
What: /sys/devices/platform/<platform>/ppt_pl1_spl
|
||||||
|
|
@ -140,6 +148,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the Package Power Target total of CPU: PL1 on Intel, SPL on AMD.
|
Set the Package Power Target total of CPU: PL1 on Intel, SPL on AMD.
|
||||||
Shown on Intel+Nvidia or AMD+Nvidia based systems:
|
Shown on Intel+Nvidia or AMD+Nvidia based systems:
|
||||||
|
|
||||||
|
|
@ -150,6 +159,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the Slow Package Power Tracking Limit of CPU: PL2 on Intel, SPPT,
|
Set the Slow Package Power Tracking Limit of CPU: PL2 on Intel, SPPT,
|
||||||
on AMD. Shown on Intel+Nvidia or AMD+Nvidia based systems:
|
on AMD. Shown on Intel+Nvidia or AMD+Nvidia based systems:
|
||||||
|
|
||||||
|
|
@ -160,6 +170,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the Fast Package Power Tracking Limit of CPU. AMD+Nvidia only:
|
Set the Fast Package Power Tracking Limit of CPU. AMD+Nvidia only:
|
||||||
* min=5, max=250
|
* min=5, max=250
|
||||||
|
|
||||||
|
|
@ -168,6 +179,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the APU SPPT limit. Shown on full AMD systems only:
|
Set the APU SPPT limit. Shown on full AMD systems only:
|
||||||
* min=5, max=130
|
* min=5, max=130
|
||||||
|
|
||||||
|
|
@ -176,6 +188,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the platform SPPT limit. Shown on full AMD systems only:
|
Set the platform SPPT limit. Shown on full AMD systems only:
|
||||||
* min=5, max=130
|
* min=5, max=130
|
||||||
|
|
||||||
|
|
@ -184,6 +197,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the dynamic boost limit of the Nvidia dGPU:
|
Set the dynamic boost limit of the Nvidia dGPU:
|
||||||
* min=5, max=25
|
* min=5, max=25
|
||||||
|
|
||||||
|
|
@ -192,6 +206,7 @@ Date: Jun 2023
|
||||||
KernelVersion: 6.5
|
KernelVersion: 6.5
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set the target temperature limit of the Nvidia dGPU:
|
Set the target temperature limit of the Nvidia dGPU:
|
||||||
* min=75, max=87
|
* min=75, max=87
|
||||||
|
|
||||||
|
|
@ -200,6 +215,7 @@ Date: Apr 2024
|
||||||
KernelVersion: 6.10
|
KernelVersion: 6.10
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set if the BIOS POST sound is played on boot.
|
Set if the BIOS POST sound is played on boot.
|
||||||
* 0 - False,
|
* 0 - False,
|
||||||
* 1 - True
|
* 1 - True
|
||||||
|
|
@ -209,6 +225,7 @@ Date: Apr 2024
|
||||||
KernelVersion: 6.10
|
KernelVersion: 6.10
|
||||||
Contact: "Luke Jones" <luke@ljones.dev>
|
Contact: "Luke Jones" <luke@ljones.dev>
|
||||||
Description:
|
Description:
|
||||||
|
DEPRECATED, WILL BE REMOVED SOON: please use asus-armoury
|
||||||
Set if the MCU can go in to low-power mode on system sleep
|
Set if the MCU can go in to low-power mode on system sleep
|
||||||
* 0 - False,
|
* 0 - False,
|
||||||
* 1 - True
|
* 1 - True
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,17 @@ config ASUS_WMI
|
||||||
To compile this driver as a module, choose M here: the module will
|
To compile this driver as a module, choose M here: the module will
|
||||||
be called asus-wmi.
|
be called asus-wmi.
|
||||||
|
|
||||||
|
config ASUS_WMI_DEPRECATED_ATTRS
|
||||||
|
bool "BIOS option support in WMI platform (DEPRECATED)"
|
||||||
|
depends on ASUS_WMI
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Say Y to expose the configurable BIOS options through the asus-wmi
|
||||||
|
driver.
|
||||||
|
|
||||||
|
This can be used with or without the asus-armoury driver which
|
||||||
|
has the same attributes, but more, and better features.
|
||||||
|
|
||||||
config ASUS_NB_WMI
|
config ASUS_NB_WMI
|
||||||
tristate "Asus Notebook WMI Driver"
|
tristate "Asus Notebook WMI Driver"
|
||||||
depends on ASUS_WMI
|
depends on ASUS_WMI
|
||||||
|
|
|
||||||
|
|
@ -338,6 +338,13 @@ struct asus_wmi {
|
||||||
/* Global to allow setting externally without requiring driver data */
|
/* Global to allow setting externally without requiring driver data */
|
||||||
static enum asus_ally_mcu_hack use_ally_mcu_hack = ASUS_WMI_ALLY_MCU_HACK_INIT;
|
static enum asus_ally_mcu_hack use_ally_mcu_hack = ASUS_WMI_ALLY_MCU_HACK_INIT;
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
|
static void asus_wmi_show_deprecated(void)
|
||||||
|
{
|
||||||
|
pr_notice_once("Accessing attributes through /sys/bus/platform/asus_wmi is deprecated and will be removed in a future release. Please switch over to /sys/class/firmware_attributes.\n");
|
||||||
|
}
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* WMI ************************************************************************/
|
/* WMI ************************************************************************/
|
||||||
|
|
||||||
static int asus_wmi_evaluate_method3(u32 method_id,
|
static int asus_wmi_evaluate_method3(u32 method_id,
|
||||||
|
|
@ -730,6 +737,7 @@ static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Charging mode, 1=Barrel, 2=USB ******************************************/
|
/* Charging mode, 1=Barrel, 2=USB ******************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t charge_mode_show(struct device *dev,
|
static ssize_t charge_mode_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -740,12 +748,16 @@ static ssize_t charge_mode_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", value & 0xff);
|
return sysfs_emit(buf, "%d\n", value & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR_RO(charge_mode);
|
static DEVICE_ATTR_RO(charge_mode);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* dGPU ********************************************************************/
|
/* dGPU ********************************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t dgpu_disable_show(struct device *dev,
|
static ssize_t dgpu_disable_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -756,6 +768,8 @@ static ssize_t dgpu_disable_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -809,8 +823,10 @@ static ssize_t dgpu_disable_store(struct device *dev,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(dgpu_disable);
|
static DEVICE_ATTR_RW(dgpu_disable);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* eGPU ********************************************************************/
|
/* eGPU ********************************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t egpu_enable_show(struct device *dev,
|
static ssize_t egpu_enable_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -821,6 +837,8 @@ static ssize_t egpu_enable_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -877,8 +895,10 @@ static ssize_t egpu_enable_store(struct device *dev,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(egpu_enable);
|
static DEVICE_ATTR_RW(egpu_enable);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Is eGPU connected? *********************************************************/
|
/* Is eGPU connected? *********************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t egpu_connected_show(struct device *dev,
|
static ssize_t egpu_connected_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -889,12 +909,16 @@ static ssize_t egpu_connected_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR_RO(egpu_connected);
|
static DEVICE_ATTR_RO(egpu_connected);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* gpu mux switch *************************************************************/
|
/* gpu mux switch *************************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t gpu_mux_mode_show(struct device *dev,
|
static ssize_t gpu_mux_mode_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -905,6 +929,8 @@ static ssize_t gpu_mux_mode_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -963,6 +989,7 @@ static ssize_t gpu_mux_mode_store(struct device *dev,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(gpu_mux_mode);
|
static DEVICE_ATTR_RW(gpu_mux_mode);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* TUF Laptop Keyboard RGB Modes **********************************************/
|
/* TUF Laptop Keyboard RGB Modes **********************************************/
|
||||||
static ssize_t kbd_rgb_mode_store(struct device *dev,
|
static ssize_t kbd_rgb_mode_store(struct device *dev,
|
||||||
|
|
@ -1086,6 +1113,7 @@ static const struct attribute_group *kbd_rgb_mode_groups[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Tunable: PPT: Intel=PL1, AMD=SPPT *****************************************/
|
/* Tunable: PPT: Intel=PL1, AMD=SPPT *****************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t ppt_pl2_sppt_store(struct device *dev,
|
static ssize_t ppt_pl2_sppt_store(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
|
|
@ -1124,6 +1152,8 @@ static ssize_t ppt_pl2_sppt_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->ppt_pl2_sppt);
|
return sysfs_emit(buf, "%u\n", asus->ppt_pl2_sppt);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(ppt_pl2_sppt);
|
static DEVICE_ATTR_RW(ppt_pl2_sppt);
|
||||||
|
|
@ -1166,6 +1196,8 @@ static ssize_t ppt_pl1_spl_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->ppt_pl1_spl);
|
return sysfs_emit(buf, "%u\n", asus->ppt_pl1_spl);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(ppt_pl1_spl);
|
static DEVICE_ATTR_RW(ppt_pl1_spl);
|
||||||
|
|
@ -1209,6 +1241,8 @@ static ssize_t ppt_fppt_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->ppt_fppt);
|
return sysfs_emit(buf, "%u\n", asus->ppt_fppt);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(ppt_fppt);
|
static DEVICE_ATTR_RW(ppt_fppt);
|
||||||
|
|
@ -1252,6 +1286,8 @@ static ssize_t ppt_apu_sppt_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->ppt_apu_sppt);
|
return sysfs_emit(buf, "%u\n", asus->ppt_apu_sppt);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(ppt_apu_sppt);
|
static DEVICE_ATTR_RW(ppt_apu_sppt);
|
||||||
|
|
@ -1295,6 +1331,8 @@ static ssize_t ppt_platform_sppt_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->ppt_platform_sppt);
|
return sysfs_emit(buf, "%u\n", asus->ppt_platform_sppt);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(ppt_platform_sppt);
|
static DEVICE_ATTR_RW(ppt_platform_sppt);
|
||||||
|
|
@ -1338,6 +1376,8 @@ static ssize_t nv_dynamic_boost_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->nv_dynamic_boost);
|
return sysfs_emit(buf, "%u\n", asus->nv_dynamic_boost);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(nv_dynamic_boost);
|
static DEVICE_ATTR_RW(nv_dynamic_boost);
|
||||||
|
|
@ -1381,9 +1421,12 @@ static ssize_t nv_temp_target_show(struct device *dev,
|
||||||
{
|
{
|
||||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%u\n", asus->nv_temp_target);
|
return sysfs_emit(buf, "%u\n", asus->nv_temp_target);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(nv_temp_target);
|
static DEVICE_ATTR_RW(nv_temp_target);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Ally MCU Powersave ********************************************************/
|
/* Ally MCU Powersave ********************************************************/
|
||||||
|
|
||||||
|
|
@ -1424,6 +1467,7 @@ void set_ally_mcu_powersave(bool enabled)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_NS_GPL(set_ally_mcu_powersave, "ASUS_WMI");
|
EXPORT_SYMBOL_NS_GPL(set_ally_mcu_powersave, "ASUS_WMI");
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t mcu_powersave_show(struct device *dev,
|
static ssize_t mcu_powersave_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -1434,6 +1478,8 @@ static ssize_t mcu_powersave_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1469,6 +1515,7 @@ static ssize_t mcu_powersave_store(struct device *dev,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(mcu_powersave);
|
static DEVICE_ATTR_RW(mcu_powersave);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Battery ********************************************************************/
|
/* Battery ********************************************************************/
|
||||||
|
|
||||||
|
|
@ -2342,6 +2389,7 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Panel Overdrive ************************************************************/
|
/* Panel Overdrive ************************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t panel_od_show(struct device *dev,
|
static ssize_t panel_od_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -2352,6 +2400,8 @@ static ssize_t panel_od_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2388,9 +2438,10 @@ static ssize_t panel_od_store(struct device *dev,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(panel_od);
|
static DEVICE_ATTR_RW(panel_od);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Bootup sound ***************************************************************/
|
/* Bootup sound ***************************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t boot_sound_show(struct device *dev,
|
static ssize_t boot_sound_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -2401,6 +2452,8 @@ static ssize_t boot_sound_show(struct device *dev,
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", result);
|
return sysfs_emit(buf, "%d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2436,8 +2489,10 @@ static ssize_t boot_sound_store(struct device *dev,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RW(boot_sound);
|
static DEVICE_ATTR_RW(boot_sound);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Mini-LED mode **************************************************************/
|
/* Mini-LED mode **************************************************************/
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t mini_led_mode_show(struct device *dev,
|
static ssize_t mini_led_mode_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -2468,6 +2523,8 @@ static ssize_t mini_led_mode_show(struct device *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "%d\n", value);
|
return sysfs_emit(buf, "%d\n", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2538,10 +2595,13 @@ static ssize_t available_mini_led_mode_show(struct device *dev,
|
||||||
return sysfs_emit(buf, "0 1 2\n");
|
return sysfs_emit(buf, "0 1 2\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asus_wmi_show_deprecated();
|
||||||
|
|
||||||
return sysfs_emit(buf, "0\n");
|
return sysfs_emit(buf, "0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR_RO(available_mini_led_mode);
|
static DEVICE_ATTR_RO(available_mini_led_mode);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Quirks *********************************************************************/
|
/* Quirks *********************************************************************/
|
||||||
|
|
||||||
|
|
@ -3829,6 +3889,7 @@ static int throttle_thermal_policy_set_default(struct asus_wmi *asus)
|
||||||
return throttle_thermal_policy_write(asus);
|
return throttle_thermal_policy_write(asus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
static ssize_t throttle_thermal_policy_show(struct device *dev,
|
static ssize_t throttle_thermal_policy_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
|
@ -3872,6 +3933,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
|
||||||
* Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent
|
* Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent
|
||||||
*/
|
*/
|
||||||
static DEVICE_ATTR_RW(throttle_thermal_policy);
|
static DEVICE_ATTR_RW(throttle_thermal_policy);
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
/* Platform profile ***********************************************************/
|
/* Platform profile ***********************************************************/
|
||||||
static int asus_wmi_platform_profile_get(struct device *dev,
|
static int asus_wmi_platform_profile_get(struct device *dev,
|
||||||
|
|
@ -4473,15 +4535,15 @@ static struct attribute *platform_attributes[] = {
|
||||||
&dev_attr_camera.attr,
|
&dev_attr_camera.attr,
|
||||||
&dev_attr_cardr.attr,
|
&dev_attr_cardr.attr,
|
||||||
&dev_attr_touchpad.attr,
|
&dev_attr_touchpad.attr,
|
||||||
|
&dev_attr_lid_resume.attr,
|
||||||
|
&dev_attr_als_enable.attr,
|
||||||
|
&dev_attr_fan_boost_mode.attr,
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
&dev_attr_charge_mode.attr,
|
&dev_attr_charge_mode.attr,
|
||||||
&dev_attr_egpu_enable.attr,
|
&dev_attr_egpu_enable.attr,
|
||||||
&dev_attr_egpu_connected.attr,
|
&dev_attr_egpu_connected.attr,
|
||||||
&dev_attr_dgpu_disable.attr,
|
&dev_attr_dgpu_disable.attr,
|
||||||
&dev_attr_gpu_mux_mode.attr,
|
&dev_attr_gpu_mux_mode.attr,
|
||||||
&dev_attr_lid_resume.attr,
|
|
||||||
&dev_attr_als_enable.attr,
|
|
||||||
&dev_attr_fan_boost_mode.attr,
|
|
||||||
&dev_attr_throttle_thermal_policy.attr,
|
|
||||||
&dev_attr_ppt_pl2_sppt.attr,
|
&dev_attr_ppt_pl2_sppt.attr,
|
||||||
&dev_attr_ppt_pl1_spl.attr,
|
&dev_attr_ppt_pl1_spl.attr,
|
||||||
&dev_attr_ppt_fppt.attr,
|
&dev_attr_ppt_fppt.attr,
|
||||||
|
|
@ -4494,6 +4556,8 @@ static struct attribute *platform_attributes[] = {
|
||||||
&dev_attr_panel_od.attr,
|
&dev_attr_panel_od.attr,
|
||||||
&dev_attr_mini_led_mode.attr,
|
&dev_attr_mini_led_mode.attr,
|
||||||
&dev_attr_available_mini_led_mode.attr,
|
&dev_attr_available_mini_led_mode.attr,
|
||||||
|
&dev_attr_throttle_thermal_policy.attr,
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -4515,7 +4579,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
|
||||||
devid = ASUS_WMI_DEVID_LID_RESUME;
|
devid = ASUS_WMI_DEVID_LID_RESUME;
|
||||||
else if (attr == &dev_attr_als_enable.attr)
|
else if (attr == &dev_attr_als_enable.attr)
|
||||||
devid = ASUS_WMI_DEVID_ALS_ENABLE;
|
devid = ASUS_WMI_DEVID_ALS_ENABLE;
|
||||||
else if (attr == &dev_attr_charge_mode.attr)
|
else if (attr == &dev_attr_fan_boost_mode.attr)
|
||||||
|
ok = asus->fan_boost_mode_available;
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
|
if (attr == &dev_attr_charge_mode.attr)
|
||||||
devid = ASUS_WMI_DEVID_CHARGE_MODE;
|
devid = ASUS_WMI_DEVID_CHARGE_MODE;
|
||||||
else if (attr == &dev_attr_egpu_enable.attr)
|
else if (attr == &dev_attr_egpu_enable.attr)
|
||||||
ok = asus->egpu_enable_available;
|
ok = asus->egpu_enable_available;
|
||||||
|
|
@ -4553,6 +4621,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
|
||||||
ok = asus->mini_led_dev_id != 0;
|
ok = asus->mini_led_dev_id != 0;
|
||||||
else if (attr == &dev_attr_available_mini_led_mode.attr)
|
else if (attr == &dev_attr_available_mini_led_mode.attr)
|
||||||
ok = asus->mini_led_dev_id != 0;
|
ok = asus->mini_led_dev_id != 0;
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
|
|
||||||
if (devid != -1) {
|
if (devid != -1) {
|
||||||
ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0);
|
ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0);
|
||||||
|
|
@ -4808,6 +4877,7 @@ static int asus_wmi_add(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ensure defaults for tunables */
|
/* ensure defaults for tunables */
|
||||||
|
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
|
||||||
asus->ppt_pl2_sppt = 5;
|
asus->ppt_pl2_sppt = 5;
|
||||||
asus->ppt_pl1_spl = 5;
|
asus->ppt_pl1_spl = 5;
|
||||||
asus->ppt_apu_sppt = 5;
|
asus->ppt_apu_sppt = 5;
|
||||||
|
|
@ -4830,17 +4900,18 @@ static int asus_wmi_add(struct platform_device *pdev)
|
||||||
asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX;
|
asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX;
|
||||||
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO))
|
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO))
|
||||||
asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX_VIVO;
|
asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX_VIVO;
|
||||||
|
#endif /* IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) */
|
||||||
if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE))
|
|
||||||
asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE;
|
|
||||||
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2))
|
|
||||||
asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE2;
|
|
||||||
|
|
||||||
if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY))
|
if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY))
|
||||||
asus->throttle_thermal_policy_dev = ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY;
|
asus->throttle_thermal_policy_dev = ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY;
|
||||||
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO))
|
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO))
|
||||||
asus->throttle_thermal_policy_dev = ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO;
|
asus->throttle_thermal_policy_dev = ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO;
|
||||||
|
|
||||||
|
if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE))
|
||||||
|
asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE;
|
||||||
|
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2))
|
||||||
|
asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE2;
|
||||||
|
|
||||||
err = fan_boost_mode_check_present(asus);
|
err = fan_boost_mode_check_present(asus);
|
||||||
if (err)
|
if (err)
|
||||||
goto fail_fan_boost_mode;
|
goto fail_fan_boost_mode;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user