From: Hridesh MG <hridesh699@gmail.com>
To: "Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Armin Wolf" <W_Armin@gmx.de>
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>,
Hridesh MG <hridesh699@gmail.com>
Subject: [PATCH v3 2/5] platform/x86: acer-wmi: use new helper function for setting overclocks
Date: Wed, 08 Jan 2025 14:15:24 +0530 [thread overview]
Message-ID: <20250108-platform_profile-v3-2-ec3658d9be9c@gmail.com> (raw)
In-Reply-To: <20250108-platform_profile-v3-0-ec3658d9be9c@gmail.com>
Migrate the OC handling in acer_toggle_turbo() to the new helper
function for issuing the SetGamingMiscSetting WMI call.
Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
drivers/platform/x86/acer-wmi.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 97eabb0ec42781a27e6a00ce0df4c8a815c1b817..f662e3740408f70e1e921a90fe75ce441fd239d0 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -119,7 +119,14 @@ enum acer_wmi_predator_v4_sensor_id {
ACER_WMID_SENSOR_GPU_TEMPERATURE = 0x0A,
};
+enum acer_wmi_predator_v4_oc {
+ ACER_WMID_OC_NORMAL = 0x0000,
+ ACER_WMID_OC_TURBO = 0x0002,
+};
+
enum acer_wmi_gaming_misc_setting {
+ ACER_WMID_MISC_SETTING_OC_1 = 0x0005,
+ ACER_WMID_MISC_SETTING_OC_2 = 0x0007,
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE = 0x000B,
};
@@ -1530,9 +1537,6 @@ static acpi_status WMID_gaming_set_u64(u64 value, u32 cap)
case ACER_CAP_TURBO_FAN:
method_id = ACER_WMID_SET_GAMING_FAN_BEHAVIOR;
break;
- case ACER_CAP_TURBO_OC:
- method_id = ACER_WMID_SET_GAMING_MISC_SETTING_METHODID;
- break;
default:
return AE_BAD_PARAMETER;
}
@@ -1891,8 +1895,12 @@ static int acer_toggle_turbo(void)
WMID_gaming_set_fan_mode(0x1);
/* Set OC to normal */
- WMID_gaming_set_u64(0x5, ACER_CAP_TURBO_OC);
- WMID_gaming_set_u64(0x7, ACER_CAP_TURBO_OC);
+ if (has_cap(ACER_CAP_TURBO_OC)) {
+ WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_1,
+ ACER_WMID_OC_NORMAL);
+ WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_2,
+ ACER_WMID_OC_NORMAL);
+ }
} else {
/* Turn on turbo led */
WMID_gaming_set_u64(0x10001, ACER_CAP_TURBO_LED);
@@ -1901,8 +1909,12 @@ static int acer_toggle_turbo(void)
WMID_gaming_set_fan_mode(0x2);
/* Set OC to turbo mode */
- WMID_gaming_set_u64(0x205, ACER_CAP_TURBO_OC);
- WMID_gaming_set_u64(0x207, ACER_CAP_TURBO_OC);
+ if (has_cap(ACER_CAP_TURBO_OC)) {
+ WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_1,
+ ACER_WMID_OC_TURBO);
+ WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_2,
+ ACER_WMID_OC_TURBO);
+ }
}
return turbo_led_state;
}
--
2.47.1
next prev parent reply other threads:[~2025-01-08 8:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 8:45 [PATCH v3 0/5] platform/x86 acer-wmi: Improve platform profile handling Hridesh MG
2025-01-08 8:45 ` [PATCH v3 1/5] platform/x86: acer-wmi: use WMI calls for " Hridesh MG
2025-01-08 13:33 ` Kurt Borja
2025-01-08 8:45 ` Hridesh MG [this message]
2025-01-08 13:34 ` [PATCH v3 2/5] platform/x86: acer-wmi: use new helper function for setting overclocks Kurt Borja
2025-01-08 8:45 ` [PATCH v3 3/5] platform/x86: acer-wmi: simplify platform profile cycling Hridesh MG
2025-01-08 13:45 ` Kurt Borja
2025-01-08 8:45 ` [PATCH v3 4/5] platform/x86: acer-wmi: use an ACPI bitmap to set the platform profile choices Hridesh MG
2025-01-08 13:51 ` Kurt Borja
2025-01-09 11:10 ` Hridesh MG
2025-01-09 15:34 ` Kurt Borja
2025-01-08 8:45 ` [PATCH v3 5/5] platform/x86: acer-wmi: add support for Acer Nitro AN515-58 Hridesh MG
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250108-platform_profile-v3-2-ec3658d9be9c@gmail.com \
--to=hridesh699@gmail.com \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox