From patchwork Thu Nov 7 06:02:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13865846 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2080.outbound.protection.outlook.com [40.107.236.80]) (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 D937E192D8F; Thu, 7 Nov 2024 06:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730959414; cv=fail; b=iN6xYYw6jhmwmTc8gylRlV0z5TKCsntMVIE7+wi90ebxVfukiIUCyuAQ5e3bnBFE3xkEjTqtE0xThK+EUPrBkspm/w99q4FyT3tiVzc29l67jqJNw2LeIF5M/C78DI3+ONndCWPQJ6JL16Ki5CYzbkhPsY24W0xpnbczkcDLbWI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730959414; c=relaxed/simple; bh=tgk8RY+Xh2BX2mN66fKFdmqhl/F4m7qqrrEeV1tpv8Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Goh1SFBilukoTWHrAfUUVLlwB/NMS2FU9tnmKMsHjjJ+iuZ4I0XJSTgzlFWlKZ6GGYlr3pE/6jVxt2FyJWKjP7dVX5PbZSL8eW1GCBv+lczzv9iUWyvp3eypxk8wrFNLhOrUb3O6rsIR58EEcVrnLDBs6Jv875hkDMdTSYrl07k= 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=eO0i+Qqg; arc=fail smtp.client-ip=40.107.236.80 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="eO0i+Qqg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aGgFRa/yO62l1j11ZvtSA977fsurE+67qPAG7zGCpx3PKAQQPu2vH9MDhUz5dMB7wfdQh6bw3x1VJOpmVIpvLGHPdGBVJkEm6EbGIzZTGE+x+vJ+axQTNypECEculAwQSJ08AVBltzR+2xcUJ7OnVwIT55zZrYf3l5SCL1yolymIMNGsCsIVVYUMIwzUloCXKyE8t8J6CUw1egWMRq3U4Ca4i8zAqZB8Bsw2/7gUsVvFFagCiflzJ6GYDzX3BCdUn8KP7DmdMM+A/CvvlEcQJWqKJv2ygKFykzPu1d3sNFVCt/Uwoz/acZ4A8rRYvl1KpcHHL+SgM3ZYRRxtWApsWA== 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=YZpVGhxUqKsw5ae2nfZGIdmBElV9ZiVBff5oYJnU5X4=; b=O3woC8eNmTq252fDx7SMeeIKSuSY/XHlsacNWspbxkRAzpY5AIZ+LtKkV80k01z8Wtn4kmN4ikvv9XmBkhFy9ajIxPWGpMCWb660kBe3BNKfvJnSaulUs8cFBgT3yXf3U+3NoRbWjFeRMrHcvRIT4d0363014Zg17iBV6yKdTOYn48mRfkzqeRdlY3EEvAgqRSrsA9Hsni6oRas0JLJ9wdX6/ElObZEEZDCSIBmoflOvjMZ/Z7vZpHV3HpPJFMG1lqRyU4zmwL7U8n69Xzn8LtUG/0fB6MsT1CopSDrV3CE1XxidyJh+nB4bojjImSHsSYHTKr+20N5uKMMYd9POIA== 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=YZpVGhxUqKsw5ae2nfZGIdmBElV9ZiVBff5oYJnU5X4=; b=eO0i+Qqgx7MjeI6KkslYeImdvhfqRORanMfBfuvsGEnGDr5xiWPMmiVEp0IHq9++clcEooZUH/DH2qBqOOE35/2im2j1CCgXx9I2JwxObpWHgxImxRevNbJ+MPjrNKzGClbM87LH7LWFB1luGBDeTWpRfukKRUbHwh0AX6f1jUk= Received: from CH0PR03CA0292.namprd03.prod.outlook.com (2603:10b6:610:e6::27) by LV2PR12MB5776.namprd12.prod.outlook.com (2603:10b6:408:178::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29; Thu, 7 Nov 2024 06:03:27 +0000 Received: from CH2PEPF00000147.namprd02.prod.outlook.com (2603:10b6:610:e6:cafe::d3) by CH0PR03CA0292.outlook.office365.com (2603:10b6:610:e6::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 06:03:27 +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 CH2PEPF00000147.mail.protection.outlook.com (10.167.244.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 06:03:27 +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; Thu, 7 Nov 2024 00:03:25 -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 v5 01/20] ACPI: platform-profile: Add a name member to handlers Date: Thu, 7 Nov 2024 00:02:35 -0600 Message-ID: <20241107060254.17615-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107060254.17615-1-mario.limonciello@amd.com> References: <20241107060254.17615-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000147:EE_|LV2PR12MB5776:EE_ X-MS-Office365-Filtering-Correlation-Id: a431c8ed-32b5-4e98-7495-08dcfef1e5c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|7416014|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xZSs9HK/KQuwcCdGyqw/286f+5Ioxhh?= =?utf-8?q?qgJ4PeRaAqJvWXa4TmkwCS+SO/TOolXCdaJwavoaycmxjVZ5QwT5n/kso5qssMjuw?= =?utf-8?q?uVOH2wmVix4qXfANP/J4x5Zk9GNQeH9MtszMeNsMvAGDUtpKSPyhuK75icmisY5jz?= =?utf-8?q?nOptduObSAIGO6tNsd5gSmtVtUHJfvFnpAEvexbnxlt7xFeHwkhGnwtGJHnPdqZqn?= =?utf-8?q?9otF4Kjjh7L99hfqOV7X30Ws2t745gBrytpw9tDTDJd/cwe3S/raUy+QYTe6xXdIq?= =?utf-8?q?LN0QQrI2klNx2GYcBo4vqPPUclaooLdMTnQvH3G+QeRfkdt0eKMPeYDzFxh17f+cf?= =?utf-8?q?KlGkbBcfVsIGBIOPeO9inPGHAmw+cGedn/sE33XtDONvYO6oprbAgfa0ORp7ABCCG?= =?utf-8?q?M+mcmTk57bGeLEGlwteg/gNRKOsiKAW7X6x01pqVNpi++edH9fmP5hPX0Bb9iAOaX?= =?utf-8?q?TYBoYNTjzbzy5PHfghAwIGRpLS7MKPe/EtD7FU5x1ReNF4ZOOJkTQg1ssEWWfi3NS?= =?utf-8?q?V7ABsKHkSDrF3xe7Qlfruq8tDJejp2VNn2F/05UzvFiGnRFWXqnv9BbSyQf5Dy1DD?= =?utf-8?q?firbut3JtoLhukqKDANzue7K1rCwTxT3Lg+3820DVR5aUBFFJohusxgmIklgc/lh5?= =?utf-8?q?sUM45G+u6kTymVPXbfsDOyfsw9c3Vvm+yA7Tglx+mfyPqxthVxUB0POcYDv8vSj99?= =?utf-8?q?4WtsDZ8d4hDPKiohoztlpo9855xiUD4wXCtrLPtnfHjD8TGqGXGoAYGSMta6sTLHE?= =?utf-8?q?AckxX6tV94udASO1DIauGqU2JMPixSU/+9GBY33u828ZjUZCOI5QJs0AFAyhe0wWt?= =?utf-8?q?RkqO+tbULefkvGmN5D6pqDOsWn+pvJAKPcwl2DVcumGubHRMnaiV+fzOLr6KK2hNR?= =?utf-8?q?36C56PElhFt435rdtd7sMeefpeorzT8AOi4RBQrq0yHpWcV0aOflOqJAn3XrVzh/M?= =?utf-8?q?jc/UMcByCX/IqANaDCYYhA/uNwZ9dfXRcNVlQ2BKMzxUUwNmjxwivdMcac9owU4mH?= =?utf-8?q?LHfMFPNRMn90ZLc3zvzR/VCtPjsrENsMfIk3kDBeXV1DjUGBH8rjR7FmKFnbFGuSR?= =?utf-8?q?JQgZefc8zPdch9ZxdU+RUH0Gn5+JHSwOsXMWH/ti8u7xoM1k1WgMmVMJGjUsA8q+Z?= =?utf-8?q?yv6FfPXqaHfpv1NpAwOh+pDJSGXol3EjqQlD4lb2lFQZ8wtdc4ksrDyMB53KElka4?= =?utf-8?q?JOAhe2gOa48THj51BjYlDpmQrLdkI/JWTSlqyQTxhGPJw9SMVsMy6Zv9M+2+aVFuH?= =?utf-8?q?l8Go43P/5Hctex58x0VjrdvI1T2EoMpxN3ku/5mS6fxKnafoCVRu/Htlrz2nIhT6Y?= =?utf-8?q?2L1sxPzhQn+z8tuZVBrSSXV+DYYdeP9dbg=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)(1800799024)(82310400026)(7416014)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 06:03:27.4417 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a431c8ed-32b5-4e98-7495-08dcfef1e5c4 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: CH2PEPF00000147.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5776 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(+) 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);