lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <eb2484f5356786578d820301b714335221524839.1712597199.git.soyer@irl.hu>
Date: Mon,  8 Apr 2024 19:35:12 +0200
From: Gergo Koteles <soyer@....hu>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
  Len Brown <lenb@...nel.org>, Ike Panhc <ike.pan@...onical.com>,
  Hans de Goede <hdegoede@...hat.com>,
  Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
  Henrique de Moraes Holschuh <hmh@....eng.br>,
  Daniel Lezcano <daniel.lezcano@...aro.org>,
  Barnabás Pőcze <pobrn@...tonmail.com>
Cc: linux-acpi@...r.kernel.org, ibm-acpi-devel@...ts.sourceforge.net,
  platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
  Gergo Koteles <soyer@....hu>
Subject: [PATCH v6 3/3] platform/x86: thinkpad_acpi: use platform_profile_cycle()

Some Thinkpads have a 'mode' button that switches between platform
profiles.

Use the new platform_module_cycle function instead of the existing
switch-based one.

Signed-off-by: Gergo Koteles <soyer@....hu>
---
 drivers/platform/x86/thinkpad_acpi.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 82429e59999d..771aaa7ae4cf 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -11190,23 +11190,8 @@ static void tpacpi_driver_event(const unsigned int hkey_event)
 		else
 			dytc_control_amt(!dytc_amt_active);
 	}
-	if (hkey_event == TP_HKEY_EV_PROFILE_TOGGLE) {
-		switch (dytc_current_profile) {
-		case PLATFORM_PROFILE_LOW_POWER:
-			dytc_profile_set(NULL, PLATFORM_PROFILE_BALANCED);
-			break;
-		case PLATFORM_PROFILE_BALANCED:
-			dytc_profile_set(NULL, PLATFORM_PROFILE_PERFORMANCE);
-			break;
-		case PLATFORM_PROFILE_PERFORMANCE:
-			dytc_profile_set(NULL, PLATFORM_PROFILE_LOW_POWER);
-			break;
-		default:
-			pr_warn("Profile HKEY unexpected profile %d", dytc_current_profile);
-		}
-		/* Notify user space the profile changed */
-		platform_profile_notify();
-	}
+	if (hkey_event == TP_HKEY_EV_PROFILE_TOGGLE)
+		platform_profile_cycle();
 }
 
 static void hotkey_driver_event(const unsigned int scancode)
-- 
2.44.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ