From patchwork Sat Nov 9 04:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13869188 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2083.outbound.protection.outlook.com [40.107.102.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 442611E505; Sat, 9 Nov 2024 04:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731127344; cv=fail; b=pLlEx5jniFInUeajF9BlGeeTcgDgO+rj3HtTtMRfPMA7Lh4rHp1is/4Ag7iYFoQD/DJoqU/3CfuBb31+M8rpA1HWs3ucMjRF9dMDKiwJ1vAHojBATgzb0VWF1LgYTv+UuU+trYQ51KB8JnSk7/WhdBrmER2w2o6lfgWnVFpfmiE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731127344; c=relaxed/simple; bh=AYvJHrr1DuzvBxnCLI2rzsMN92SzriWbCF0hjGw1VGM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=feIkFxpaHPo7VEMa5/NjswQCa95oTQN7OdYUksYiEUvYmyzSTUQpl9cI6mxnpyuyXLvcSp/Q7G+tnKOZg5TYXzHkdeTdgjiNT3Qp0PPKiMgcmoXjX/Yyfhk+pYr0GWZz+qHvySOcrlymdqVT5g3A3MaRfatea/y1vBwIU9mbXIw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=E0XsaV8c; arc=fail smtp.client-ip=40.107.102.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="E0XsaV8c" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cVFdsPw5NWnRC5+AZLUY/rgzegqjypMVHdcxP5OX2157v6st3ngqBcHXWE3e4jmRko1PUNyAHqE80VvppqenEuP2ftoTo6k/RNVGhj9UGPKghD2gTAeBYXhiFxuko+OEsN8tUJ5FmZQ+zd+TnOw7PheXdyEPE5UAsG69dk+4dZl6Sg70NUN8OEGTyYFXgtSACeLISVMo72jUR6q9Gdb/fX35Rfi+2lJtQWK8pHCRJ9i35a0HXxPM5b7j2JV10VQh+0fAaCmiLWiLj9NrfrJjw200YpbkNVofoVXt2L9FSqEFQigdI9jMFdbOv2c8F2LDayJXTny8wflxoYgxe9OMmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wny8nbFzMuwNBi9IwJhOKNvnnz1x4iA/E1KTavC0zNo=; b=pd1IsmROQZmSdpEvsEECfLw7xjyfL64aA/IftHR1HI9suuVN7yn8hALcrZVe8FQW4Dse41bW8yQd1NLFMI2nIuu0cVJfWSsVk7BIDt685kZFyGoNgfIEqLEHKfZoyV7gHCgPItaAo867rIPB8LJ5SDfDb3Bs0Gol9EdCjgAg07W+Epsa0gMWH83sJdG9ehEa3kLESCWv4JYjHQhd2hCVE3WhUff9QBQt5WJQKFN8ws7VOqaz7AhUdY0HCuGIY2ADXMZjJmz575ulObXXxBNdxh+Kaa5XKoM6I05uJZkK7dzGWR/KyN+FheZyMilspq8wZzrIOdMi7B9p1jh0DkU6xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wny8nbFzMuwNBi9IwJhOKNvnnz1x4iA/E1KTavC0zNo=; b=E0XsaV8c8Qg3AL0fDSVHwxXIhZW5u3ISPMiE6k4vrOg08D/ZAGl2VrL7AXQA98xm247mj7Ijtx4v9IoMukK03guAoN33mfYKQ/v00LwHgNUlVaba2eBz68LUv3KlHcySbtK6yWXIub6HF12eoyqqPcPuePAuE5ZP3lruiHWTP6w= Received: from SN6PR04CA0085.namprd04.prod.outlook.com (2603:10b6:805:f2::26) by SA1PR12MB6773.namprd12.prod.outlook.com (2603:10b6:806:258::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Sat, 9 Nov 2024 04:42:19 +0000 Received: from SN1PEPF00026368.namprd02.prod.outlook.com (2603:10b6:805:f2:cafe::5d) by SN6PR04CA0085.outlook.office365.com (2603:10b6:805:f2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21 via Frontend Transport; Sat, 9 Nov 2024 04:42:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF00026368.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Sat, 9 Nov 2024 04:42:19 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 8 Nov 2024 22:42:17 -0600 From: Mario Limonciello To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= CC: "Rafael J . Wysocki" , Len Brown , Maximilian Luz , Lee Chun-Yi , "Shyam Sundar S K" , Corentin Chary , "Luke D . Jones" , Ike Panhc , Henrique de Moraes Holschuh , "Alexis Belmonte" , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Ai Chao , Gergo Koteles , open list , "open list:ACPI" , "open list:MICROSOFT SURFACE PLATFORM PROFILE DRIVER" , "open list:THINKPAD ACPI EXTRAS DRIVER" , Mark Pearson , Matthew Schwartz , Mario Limonciello , Armin Wolf Subject: [PATCH v6 01/22] ACPI: platform-profile: Add a name member to handlers Date: Fri, 8 Nov 2024 22:41:30 -0600 Message-ID: <20241109044151.29804-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241109044151.29804-1-mario.limonciello@amd.com> References: <20241109044151.29804-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026368:EE_|SA1PR12MB6773:EE_ X-MS-Office365-Filtering-Correlation-Id: c4a4f915-34dc-41a1-b7f0-08dd0078e510 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?q?6Re/2DK9ne2G+z3tNC8C0MC8xgfn0ua?= =?utf-8?q?XXwRyyJZsm7Z8dqQodMVf39MLQIA8fTEgGE9oDAttQmv8h048LdFleXINwVDAXCDS?= =?utf-8?q?JPapn8apibdiqFpIRrolw+qYhPXqtecxKBLIr3bUcMthRTsIwixvRIfPlxcMUEpYf?= =?utf-8?q?Jk8uUAvFGKB1YAo9J5DFx5EvN+Ul2Gr30mMyLuaI+X0Jmdbz0UZ94ktMcTPTsxaWW?= =?utf-8?q?damudBVnjN2mEhDnOPfZxFDpOVymtYINY1Gl/Ek+nPB3qn8V+SisnMd9/F5wH+ck4?= =?utf-8?q?XbpWu/21OSQ7/nGJ3DN3y7mOOVvsJkF4zALQ+ZL+FKWXea7Zr0/vkOElHKH231g1H?= =?utf-8?q?WPuz47j93UbIqr6HuN1M/V9pbHyvYUFwGAm1lkuE3RE8CUc1wczzNOyTSBeOVGtFa?= =?utf-8?q?jacnl2c9iCTsdfm96IUN5CqM3eQWs/V4iySEakoryajkv/at6AU1DX6ImNIY7r0oZ?= =?utf-8?q?KrOxtDSir5DwLG1eAkslDVA2IkHEMfskPBPnjeRBCtWY9r6MkODuBibKEYhUSZaKa?= =?utf-8?q?HmQb98VwN6zi2JF4lEH4p3q9YQNYpHUSp3664hZQe1nJj7xQdZgRP3laafCrR2hIS?= =?utf-8?q?X4o3I5aQWqaiMEITVXVBfE3tKPeYV3Sky5WyjilGzuPAuywzSCe1shL8vQAJ4fwOJ?= =?utf-8?q?9vaNB1+FY36Rrcbx6stsVH6GFuPWs7CrsGoPHBgKCtRZEDGncRzksPVtxJ+kpTmcB?= =?utf-8?q?dIzZ3HVEOiHH8ruMhb1895mQphA7BbeIQzKoL1tXrj7iRb5sWJvbiFg/6j3w9kCYW?= =?utf-8?q?+unNvIsDj9cJ+GPGd9wFsPBXqVGnFIsOmFVWSQKkXcTL71GrhelIL1M4fO6l03bxG?= =?utf-8?q?ORIqIUPp5glybB1T5xWb8+ldvpvaxCs43f4s397H3W0EXd2brwFzuuOXqSOqzbNMy?= =?utf-8?q?P1QzOlumOKgQQ4m9MGRyAHYGbwLM4u6PjvGyygxIiJdukzNmM1llPOhsSoZiOmC3y?= =?utf-8?q?avT5W9RUjG7kisq/G3J/LP1xkqxX0Sqhaj7Z625vYIjVR0NQWYnXtG3TE9WOLmT5Z?= =?utf-8?q?cQ4xU4XOZgUclhB8+CCI+V8zhfKSBVAnmF6nkOTHZu1h/wGWQH3Fs1msswrfxaiFY?= =?utf-8?q?1PXxtFSraDZvsCXNzYPwfAZApkV2E+QAWsJWM8H636RwKeFyOuCeZfHN/uEmV1iSY?= =?utf-8?q?9SmnMZEsVrGEVpV5Ra+Nl4FCe8VvR/ClZgHTjKxLAAcYBJSphUZbOKQq3KoEsM0np?= =?utf-8?q?uvUBnt+rjdW8j4QYLeQYoFeQBcWFCyJLQU5o6UFd88SdXFlr+gY7O/ebHHatcJ+2y?= =?utf-8?q?a2rWYYFdBlw3HOlhlZOuq/l/SEGUmNEllA4P4HYMo6mtnDRkHTlIBIVtTZONvQ115?= =?utf-8?q?VLKvi6NFaBnQf3O6W3GTfkseHpZgrfQJow=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2024 04:42:19.4694 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4a4f915-34dc-41a1-b7f0-08dd0078e510 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026368.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6773 In order to prepare for allowing multiple handlers, introduce a name field that can be used to distinguish between different handlers. Tested-by: Mark Pearson Tested-by: Matthew Schwartz Reviewed-by: Hans de Goede Reviewed-by: Mark Pearson Reviewed-by: Maximilian Luz Reviewed-by: Ilpo Järvinen Reviewed-by: Armin Wolf Signed-off-by: Mario Limonciello --- v5: * pick up tag --- drivers/platform/surface/surface_platform_profile.c | 1 + drivers/platform/x86/acer-wmi.c | 1 + drivers/platform/x86/amd/pmf/sps.c | 1 + drivers/platform/x86/asus-wmi.c | 1 + drivers/platform/x86/dell/alienware-wmi.c | 1 + drivers/platform/x86/dell/dell-pc.c | 1 + drivers/platform/x86/hp/hp-wmi.c | 1 + drivers/platform/x86/ideapad-laptop.c | 1 + drivers/platform/x86/inspur_platform_profile.c | 1 + drivers/platform/x86/thinkpad_acpi.c | 1 + include/linux/platform_profile.h | 1 + 11 files changed, 11 insertions(+) base-commit: d68cb6023356af3bd3193983ad4ec03954a0b3e2 diff --git a/drivers/platform/surface/surface_platform_profile.c b/drivers/platform/surface/surface_platform_profile.c index 3de864bc66108..61aa488a80eb5 100644 --- a/drivers/platform/surface/surface_platform_profile.c +++ b/drivers/platform/surface/surface_platform_profile.c @@ -211,6 +211,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev) tpd->sdev = sdev; + tpd->handler.name = "Surface Platform Profile"; tpd->handler.profile_get = ssam_platform_profile_get; tpd->handler.profile_set = ssam_platform_profile_set; diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index d09baa3d3d902..53fbc9b4d3df7 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1878,6 +1878,7 @@ static int acer_platform_profile_setup(void) if (quirks->predator_v4) { int err; + platform_profile_handler.name = "acer-wmi"; platform_profile_handler.profile_get = acer_predator_v4_platform_profile_get; platform_profile_handler.profile_set = diff --git a/drivers/platform/x86/amd/pmf/sps.c b/drivers/platform/x86/amd/pmf/sps.c index 92f7fb22277dc..e2d0cc92c4396 100644 --- a/drivers/platform/x86/amd/pmf/sps.c +++ b/drivers/platform/x86/amd/pmf/sps.c @@ -405,6 +405,7 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev) amd_pmf_set_sps_power_limits(dev); } + dev->pprof.name = "amd-pmf"; dev->pprof.profile_get = amd_pmf_profile_get; dev->pprof.profile_set = amd_pmf_profile_set; diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 2ccc23b259d3e..c7c104c65a85a 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3910,6 +3910,7 @@ static int platform_profile_setup(struct asus_wmi *asus) dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n"); + asus->platform_profile_handler.name = "asus-wmi"; asus->platform_profile_handler.profile_get = asus_wmi_platform_profile_get; asus->platform_profile_handler.profile_set = asus_wmi_platform_profile_set; diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c index a800c28bb4d51..ac0038afd98fa 100644 --- a/drivers/platform/x86/dell/alienware-wmi.c +++ b/drivers/platform/x86/dell/alienware-wmi.c @@ -1056,6 +1056,7 @@ static int create_thermal_profile(void) pp_handler.profile_get = thermal_profile_get; pp_handler.profile_set = thermal_profile_set; + pp_handler.name = "alienware-wmi"; return platform_profile_register(&pp_handler); } diff --git a/drivers/platform/x86/dell/dell-pc.c b/drivers/platform/x86/dell/dell-pc.c index 972385ca1990b..3cf79e55e3129 100644 --- a/drivers/platform/x86/dell/dell-pc.c +++ b/drivers/platform/x86/dell/dell-pc.c @@ -247,6 +247,7 @@ static int thermal_init(void) thermal_handler = kzalloc(sizeof(*thermal_handler), GFP_KERNEL); if (!thermal_handler) return -ENOMEM; + thermal_handler->name = "dell-pc"; thermal_handler->profile_get = thermal_platform_profile_get; thermal_handler->profile_set = thermal_platform_profile_set; diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c index 81ccc96ffe40a..26cac73caf2b9 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -1624,6 +1624,7 @@ static int thermal_profile_setup(void) set_bit(PLATFORM_PROFILE_COOL, platform_profile_handler.choices); } + platform_profile_handler.name = "hp-wmi"; set_bit(PLATFORM_PROFILE_BALANCED, platform_profile_handler.choices); set_bit(PLATFORM_PROFILE_PERFORMANCE, platform_profile_handler.choices); diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 9d8c3f064050e..1f94c14c3b832 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -1102,6 +1102,7 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv) mutex_init(&priv->dytc->mutex); + priv->dytc->pprof.name = "ideapad-laptop"; priv->dytc->priv = priv; priv->dytc->pprof.profile_get = dytc_profile_get; priv->dytc->pprof.profile_set = dytc_profile_set; diff --git a/drivers/platform/x86/inspur_platform_profile.c b/drivers/platform/x86/inspur_platform_profile.c index 8440defa67886..03da2c8cf6789 100644 --- a/drivers/platform/x86/inspur_platform_profile.c +++ b/drivers/platform/x86/inspur_platform_profile.c @@ -177,6 +177,7 @@ static int inspur_wmi_probe(struct wmi_device *wdev, const void *context) priv->wdev = wdev; dev_set_drvdata(&wdev->dev, priv); + priv->handler.name = "inspur-wmi"; priv->handler.profile_get = inspur_platform_profile_get; priv->handler.profile_set = inspur_platform_profile_set; diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 4c1b0553f8720..c8c316b8507a5 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10549,6 +10549,7 @@ static void dytc_profile_refresh(void) } static struct platform_profile_handler dytc_profile = { + .name = "thinkpad-acpi", .profile_get = dytc_profile_get, .profile_set = dytc_profile_set, }; diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h index f5492ed413f36..6fa988e417428 100644 --- a/include/linux/platform_profile.h +++ b/include/linux/platform_profile.h @@ -27,6 +27,7 @@ enum platform_profile_option { }; struct platform_profile_handler { + const char *name; unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)]; int (*profile_get)(struct platform_profile_handler *pprof, enum platform_profile_option *profile);