Message ID | 20241130140454.455-12-mario.limonciello@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) (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 5FEDF19E99E; Sat, 30 Nov 2024 14:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732975549; cv=fail; b=AW2xvJfKZhRatcKh+qIc+uE3VvSNUNZ0ILYD7Dmmz+u8dr14VpnLgRQGD+7UhYAF9k+uWyb54G98lZhNhVhU5qr8dwKQ31hiAUwq7tT0n7ss9e3pvs9VbpIw6/QD3YoWiamxQpdxO/qog8fywlXJUXTwirPger0Fu17fRPPES/4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732975549; c=relaxed/simple; bh=DVbufMv2cR+FoQSgLi9r41SU5f9qJwfd5FmEJpPVzaA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zf6JKoLynTHQzjrzsn+kmQ9R7Vz94sPiLaW9zDdJM+Nllr+VHyM1FbLp2ei4TINX4FvnvlUhQq49zh/4RyY9w0TYUEIHo/EtcUY1aQXPYiVkaAFqR0WBHr1Yx5dgeDkKlLyF30uitsC53qHi+hC97k9gYmEX/31SGk/QBW5gPMw= 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=c/LjrBqr; arc=fail smtp.client-ip=40.107.94.59 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="c/LjrBqr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eoWZdIWwcd+GjOOmr6LzWJzDROuietMKAzeQLWriE6LyX+UO/joXhoMFA6jlXdxtsEvPQECpLPYtfJMl2YkcCwsE0lbhER4nL9tJRLEYFB7G75MUjfwhcosriDtTO9XodlybOl09mHf+IVG1emzcTDjb/1vYB6H2ldE45Ug4dYGHfeIk2C331/KJGWh4Xd72ZWRLKH3drWgHpLHgYz9yQvT7n9jA4EtdwlhwBsd+U2I9ZeuO7L+XLOm9C3dg82ukURprbWufFWGZeFyAsbFD5S6mlI0kXBU5w8K9K2xlh+42GOOmb/jvU2ipcGR75r3rJG5LnYcKPjL0MQksoBnTkg== 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=mDXx9JQ2KLp0jPqHncOkllsoPJc+kZfrcqYY2hdE8+U=; b=FrRBKApQZurbpkXOJckhFb4kYdhGVCEV5kHuZWuMj8GvCOEfC2V9hOYjeo5T5M2Is8vNBDusrlwLDa/WhnWZYvI2yZSBPFG04FwvqB9N9sVTxJiVmY+W6d2qPlXoBXoFnbVBB5Lfu/x5zKEM6OtaEz+VtGaEDeI8nHBnW54vh2ddJhKdaObNMYqWa7BFsVbqiDvv+Oxn07hA9SStR3UqqO2cmS9NbusFk8yUMCDQDr55SxpfziaAwiA9aPWT097pRt4Zai6bJkl+/HiyZ8LT4ujB+DLiF7iDUZ02Q/kqs0aPt75PzgbHfC0X4KJ1VrBqpd66oflqkbfCJxHhcqT6mg== 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=mDXx9JQ2KLp0jPqHncOkllsoPJc+kZfrcqYY2hdE8+U=; b=c/LjrBqrxuicRnMh+WTVJ7MB/2w4CGzbJuhP17Pq03yKlnPWzZPmYBA7buft+y9602KA+zquV6mtbr6jKWNkIQjIudO0A6I0hS3G98I8/fuckaqx96Uon4IBJ6bI1xS/trt9YBOjYkrgqZ8iJqb4CXR2crGohY+mpq8j9H7sJRs= Received: from PH7PR10CA0011.namprd10.prod.outlook.com (2603:10b6:510:23d::12) by MN2PR12MB4061.namprd12.prod.outlook.com (2603:10b6:208:19a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Sat, 30 Nov 2024 14:05:43 +0000 Received: from CY4PEPF0000EDD6.namprd03.prod.outlook.com (2603:10b6:510:23d:cafe::10) by PH7PR10CA0011.outlook.office365.com (2603:10b6:510:23d::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.15 via Frontend Transport; Sat, 30 Nov 2024 14:05:42 +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 CY4PEPF0000EDD6.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Sat, 30 Nov 2024 14:05:42 +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; Sat, 30 Nov 2024 08:05:39 -0600 From: Mario Limonciello <mario.limonciello@amd.com> To: Hans de Goede <hdegoede@redhat.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> CC: "Rafael J . Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>, Maximilian Luz <luzmaximilian@gmail.com>, Lee Chun-Yi <jlee@suse.com>, "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>, Corentin Chary <corentin.chary@gmail.com>, "Luke D . Jones" <luke@ljones.dev>, Ike Panhc <ike.pan@canonical.com>, Henrique de Moraes Holschuh <hmh@hmh.eng.br>, "Alexis Belmonte" <alexbelm48@gmail.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Ai Chao <aichao@kylinos.cn>, Gergo Koteles <soyer@irl.hu>, open list <linux-kernel@vger.kernel.org>, "open list:ACPI" <linux-acpi@vger.kernel.org>, "open list:MICROSOFT SURFACE PLATFORM PROFILE DRIVER" <platform-driver-x86@vger.kernel.org>, "open list:THINKPAD ACPI EXTRAS DRIVER" <ibm-acpi-devel@lists.sourceforge.net>, Mark Pearson <mpearson-lenovo@squebb.ca>, Matthew Schwartz <matthew.schwartz@linux.dev>, Mario Limonciello <mario.limonciello@amd.com>, Armin Wolf <W_Armin@gmx.de> Subject: [PATCH v8 11/22] ACPI: platform_profile: Add name attribute to class interface Date: Sat, 30 Nov 2024 08:04:43 -0600 Message-ID: <20241130140454.455-12-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241130140454.455-1-mario.limonciello@amd.com> References: <20241130140454.455-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: <linux-acpi.vger.kernel.org> List-Subscribe: <mailto:linux-acpi+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-acpi+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: CY4PEPF0000EDD6:EE_|MN2PR12MB4061:EE_ X-MS-Office365-Filtering-Correlation-Id: 8deb3eea-ba52-4f15-6419-08dd1148140e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Y3xQVNzvcBwtC0KafeJlguXS5uuEjXu?= =?utf-8?q?LQ3zeY1W6SN4N+/JNJhkBbdt/7iJV4sm09Kw6+6uEBaT6rBZgX9yjuxGBdSL8xckv?= =?utf-8?q?/XhG4TKHxhNx8n/9+wIj8N82sFKLSQQPdvSKuJGoW+/pf0+OlnuNkoEdBjfSfN8mM?= =?utf-8?q?smeYGJDNcnGXT9An90xHAXE4bgcsguCDvSpXv4pkidLybGAUzISrtnMuj0sz7YooC?= =?utf-8?q?CFyQLsdh5VeNQYcI7mtPq0TNShPRAKyyV8DdO5neVrbot1FwRzyOUSVguVDE4wogH?= =?utf-8?q?xbvmGUnzYhLq6VtfNvRwY8beINpjfOi76f6HUnTt3OcCFwWwjkUW3h6xz4FhB0umO?= =?utf-8?q?KM1l2o9yDkYBOnHo8fTxyWCvKRExPXn7so2neShwOV21Hspc9M25sgUkcJItVhlea?= =?utf-8?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KQYX+OOCK249flcbtFzsngabezyfI9oCE9/f7igam2VhxHQ9YTVG2NfCN?= =?utf-8?q?vOhTexrGKU7I62AbkNz26q22wbTWnysTnK9Wiqm9DRLbL03IQEdDGwQWSOBXeix3j?= =?utf-8?q?Wbv08x7+n16?= 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)(36860700013)(7416014)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2024 14:05:42.6564 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8deb3eea-ba52-4f15-6419-08dd1148140e 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: CY4PEPF0000EDD6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4061 |
Series |
Add support for binding ACPI platform profile to multiple drivers
|
expand
|
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c index 36f7b568deba5..eec842bd00643 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -25,8 +25,31 @@ static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST); static DEFINE_IDA(platform_profile_ida); +/** + * name_show - Show the name of the profile handler + * @dev: The device + * @attr: The attribute + * @buf: The buffer to write to + * + * Return: The number of bytes written + */ +static ssize_t name_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct platform_profile_handler *handler = dev_get_drvdata(dev); + + return sysfs_emit(buf, "%s\n", handler->name); +} +static DEVICE_ATTR_RO(name); + +static struct attribute *profile_attrs[] = { + &dev_attr_name.attr, + NULL +}; +ATTRIBUTE_GROUPS(profile); + static const struct class platform_profile_class = { .name = "platform-profile", + .dev_groups = profile_groups, }; static ssize_t platform_profile_choices_show(struct device *dev,