From patchwork Mon Dec 2 05:50:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 847008 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2062.outbound.protection.outlook.com [40.107.223.62]) (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 CB94A23741; Mon, 2 Dec 2024 05:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733118695; cv=fail; b=tl75YXXg+OVlKs/PR2aYZzSVp9WLYUDm7mciipng94j50UfgPwqmSduuK2Bl83Y7goaMzEx89pfCoSf4wTbV4o458NmCFtNc5f+dfhVxfSrGalSZPedesNO1p+19ws9fNmqTCKB/Dg8ar22qQsmw1wVB4YIZqTAETdhPJ6J6P7Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733118695; c=relaxed/simple; bh=2GfJ/SjUIoNaiwHOnGXTGKoy8oQY1NZVgcne1nh591o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AK3F/zZafiSq7gs4J0oJRVFNI3fiH3vC6vzUA7v0igTxWADkGPeDpyMieukq6+xfJlBhQmzQc+m5dZhXXT9+NBRamV190YdEYJwQHxCLQSj2xSV+BZCDNYk0ubT+Hq/R64RHDxCHtX8dtMQQQ6Gss8z7YvFowoko0kP3AaGU+RY= 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=3iU0iHt8; arc=fail smtp.client-ip=40.107.223.62 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="3iU0iHt8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sdOm/KiNAGNDaK7QSyb0OeQJVdnMpT8n+FY1pat1KicpYXYNa4qq+qFZHDXU/a3CpfpPDp8PG6bGrN3yBXpyK1A9JX6lkXF3caKPGpRxGDUMp2X7z1K+/TtPVzaO+dQ+A1MFCDqkgq52E9JRhp/0y4Y+dAQa2T2Y+qX3Vf4RfQ7NvTwNA5wyxHMcU89lhV91TbGsq+1gcosdpJkmCIHJ5hnSGgstaufikeXvDpvDdJecZWjbijZmUJj173JVHrcdhnDHEcuRF6aHyGjEf1+A8PHQT1Vioct6+qc/5Nb0wKzoV4BJ9W/U+Pkd3KDbUj5d6Fwzr8S3ANFAfpDDNbnqKA== 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=DoQnBgUUl7eonCm8N3+8uE69DCAavYY1OE4Xsjy+5YI=; b=Lj6BYfryWZHAN4hin1mzJpcrBACDVce5jrI/V46SR81+CAgK4SQ+ev/4LtwrnzEvEKuKocHoAGG4AnTjEMMfMNEnOiT0eTJh6XpLtw+C0gpvdIkDspPJksqPxNSglrXjQh9njiifl2EFEiO2X+GIr/SjLY09QpneJEvzzFlz5dcx+fUqxgStBQ+07Em8NBpAYm3Xg1P92+goTC4BTMnF13x3sAR28xnoxDRVE6ZcvqkEUryCDhoKAwTBg6YYRb1pNV8HvIYKEcWxyrtIrfDv6xlMPhQ+wMiR4JFLvry4+83EsXg251gOEC/KZwjOysQQYdTNKv1G7bfoQ9NjPXQuBg== 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=DoQnBgUUl7eonCm8N3+8uE69DCAavYY1OE4Xsjy+5YI=; b=3iU0iHt8D8HZC1Lz3T8NG5rPLjl255r9FM1M84dD4tJLT7z9fRNWqdp/eCoWQC7Lcwd0XXRrWH7feXhjqNiAktSGarsaI5PsLSnabxVhWIYmTOBehEr2VZx6fwhjpAGBsZMIabz9+Om9bW5/q6zrabd6Cz1rF3UPF099RAai7wM= Received: from CH2PR16CA0006.namprd16.prod.outlook.com (2603:10b6:610:50::16) by IA1PR12MB9468.namprd12.prod.outlook.com (2603:10b6:208:596::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.18; Mon, 2 Dec 2024 05:51:30 +0000 Received: from CH1PEPF0000AD78.namprd04.prod.outlook.com (2603:10b6:610:50:cafe::1e) by CH2PR16CA0006.outlook.office365.com (2603:10b6:610:50::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.17 via Frontend Transport; Mon, 2 Dec 2024 05:51:29 +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 CH1PEPF0000AD78.mail.protection.outlook.com (10.167.244.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Mon, 2 Dec 2024 05:51:29 +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; Sun, 1 Dec 2024 23:50:59 -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 v9 01/22] ACPI: platform-profile: Add a name member to handlers Date: Sun, 1 Dec 2024 23:50:10 -0600 Message-ID: <20241202055031.8038-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241202055031.8038-1-mario.limonciello@amd.com> References: <20241202055031.8038-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: CH1PEPF0000AD78:EE_|IA1PR12MB9468:EE_ X-MS-Office365-Filtering-Correlation-Id: 377c3ce1-a50b-49f4-59ba-08dd12955e5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|36860700013|82310400026|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?q?0nVF17KSOsT6W+gmDzarff1Ua4LpB6C?= =?utf-8?q?8XcxqcdC4RatSLQ0oB9cI8zdC6HBAB1D8BTWA8fzKr55pf1oP4TWaakdabY5eaIrk?= =?utf-8?q?2jWpVp480XbgW6oRswNYHdVH0Co73ohSZ93WWFY/3H96SHYeg4HIFxSRr8W57xTmn?= =?utf-8?q?dwl/yy/8DL0bsFHdvJSZ5dybj4mbJAgFK2zMgd7tO7trjjgpknCicWOemUuLrrGRb?= =?utf-8?q?77vB4r6WhU+OEIpakJe/FZG9IeWUUY8gvJDAz7EFRLoknSoiq1cv1N+RNKNYUyBC2?= =?utf-8?q?cFBqqf3SJ/28nCXIuEhT3GF+bpE5HZrf7opCMU0SWP4FTtM+GSnHcMbp3JPNRN0ls?= =?utf-8?q?BaKHHq/Q8KOYDJyiVtKu5NosZ9BobQucx64upuNMRIfwq1t6sOj7wK1yfYbIizh7y?= =?utf-8?q?BnKT9EWdP4swEJKwAKzO97qPGa+Tc2ijXeVa3XBgpq5xG0dtoABDZQXLp2RJap3Yr?= =?utf-8?q?eu6WIt2KZ7AVpmhK9s3hbyNzMgizL2/T+3vHyiUZHrxFZi0LdOIEFcbgq3hNgIp7t?= =?utf-8?q?Y4EFaGai/7+LcpLjaxG+km0uaxnzH5GQfsbHUFPRfCUqzhEVI8NlSRId1x3jA5CJs?= =?utf-8?q?ltZ0FcB80n09lfWey3Ja/p/YYTJhVzR3sd5TZS9KVxJOG0NvhpFITLwWjEiFYiNrO?= =?utf-8?q?REUf2nYUoWag+9NDaNRZ5zT6z+v320bnvXR3c/NLOzWqshUeCBv5VBtJ6Zwncmq/7?= =?utf-8?q?Cc7V0Gj4e4HQgTrNGxHlwykZ3vOPHxk1iX9iQqBhlfvzU1hmWuWV3oujRTq6vVJ9H?= =?utf-8?q?E1fQdGL7HvzazGjDnty5/pWmA04WiOqZL71YjlPIc3FSUP9hHMsfpj7LI59/0B9XS?= =?utf-8?q?TBfVV5siHfp2C8xvSPDbYKDJEm332v4h4j6Nyn3sWBJlkITsX1IQMNyacoYJo2FZQ?= =?utf-8?q?cKI3Y3Fuza9qFQSaXr0b0Wp9FrC8KwDZvwgXDsHl0i2u6TYtqLrPLSwwShlwp1J8u?= =?utf-8?q?OBbS3KlQRZDHHsjrcTZs6FcJmuNJtTnHZCDmNmWYPT2agbSdpyEIM2ARG0k0UZqmI?= =?utf-8?q?2gCDp3AB3AUj6pLV0JuOAsAgnjBp6+lO13Nh3SFPKcDsHwv8d6jYWPbh8GibMBD8R?= =?utf-8?q?V0KkLRBYOeDmxuRi5X9daV3rOBIaUlbLiiY0Pt1V9GhtHIt/yUPdELtgGnzk5PWR1?= =?utf-8?q?sCV2AIOso1jXMqhQ38axlA4zCkHVsRFE6F6XhpELUFFWGW1JYEVnzgIgkTnvIavmP?= =?utf-8?q?sKTDSjJTk2tTrr8X9EnBDOr3FIgFGTdy3IBf3dFtY8v/bCC1i7Wt+7lkCNC+4YTri?= =?utf-8?q?gfE5kKidGYpS2FY5SJYaKmu8KoCqVo1zHkREUjGTv/ruRx+hhkjUQEPYLext1PXUW?= =?utf-8?q?1c1AE2bpCC6YMEMMFsCzDQXZboatDsapKEFxuInRA/jYty2tXAodUqaK3VevPlXGV?= =?utf-8?q?VLxKV5r2meA?= 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)(36860700013)(82310400026)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2024 05:51:29.8234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 377c3ce1-a50b-49f4-59ba-08dd12955e5c 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: CH1PEPF0000AD78.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB9468 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 --- 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 08db878f1d7d4..9d3e3f9458186 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 ba8b6d028f9fe..a08dc936276b9 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3876,6 +3876,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 77465ed9b449b..f88d898447511 100644 --- a/drivers/platform/x86/dell/alienware-wmi.c +++ b/drivers/platform/x86/dell/alienware-wmi.c @@ -1156,6 +1156,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 5d2c1f0d1e9fb..cbdc965eeb248 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 6371a9f765c13..0e03c41e028d4 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10571,6 +10571,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);