From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.48.2 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796256189; b=jqN52I/Z/RotHzBgObmrnAsavpmNY89c71/RD4z6XOUNrQKwnfuP+mEj0bQq2nUcuRQr d013nhGNcBhXMR0yCCUBv8p3EIKd8S8R+cbViPp3J4OEkXQESedkiTlJ3dNGi6DWcdEbY Rm4fRlx0EdYBY1uBL5CA4mI3tgyvVHTxAxgts/c+Z8yNI5tWijzx19RgmZ+xUi2OfObv3 CmfkL1V/KdHTdFKGmQG3Q4CJI2CZrq16OTQ9RgEUoYKAXf8Eyw4utQVtlRssrN7XkTpq3 f4CuSGDC5cJA4qYH7NMb+VjsKN0+25Sa0Jboe1TjnQl4ARgn24XxvEMw35qC0EgDphQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796256189; h=DMARC-Filter:DKIM-Signature:Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References: Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=MNWgVq4pXRzMraUu+oRr22inacD89MUPcvPm6oLjsAQ=; b=uFtVHpFTlx+RYsivQ81Ayg9GRAQccwXfVJNah+XW7G2iNheHOsKPA8aCRI9tq2t2Nt5C h7CImQE3IlTKr64tcRg+V2KHjmI+GMk0cU+9ZcrUGe0Ltxs0g2+TWJXk6uocf1IYBr8MW HBzM4OmKePLwWqCgo6fC85jtxAjYfvKa6axDcbdPVMR0GHcrMcDSftkxIb8uKBUBuoNH8 aLCrcftEk1Z1cLcJTW4m3kqgPmzXrSNt+sQgrRFTeO4z/g5kaeuZgSdKhz7zueU24aXQp 7fx29vIdyCrozDoSYJ2R7V7yRHNm2KQH2I9zqmXtyBBNqQEG7JYWUFs2eduDw6XRlDA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=rqULeNSR; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.48.2 Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azon11012002.outbound.protection.outlook.com [52.101.48.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19285606A32D; Thu, 3 Dec 2026 00:03:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 19285606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=rqULeNSR ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RR6psc8zsEUSeWQvuultkgwTcOXQIddiCCou/3QazJ3SlFcA27ACjF49EyiWXcAxzqO9lzot4wEBvXq4FvYxy1grhsFCSgrTtFzbrAbri7sphl5XcQasRqEyKDElHRKB8yNaaualYMbbZkrp08Tiryl5S2UM1uV1UXeykuMJy8eddObU/jHziKDEuUhXT8ydt8Wer63FLpfmoDqGurbMIfoGBOnLbLgGiDfh/venLvDbliLH8Zd3KAcRxr2dFBVym48ZhauhPQZDoCx390EB3C0VMctiEb+vvYJKcGTRbvYFfdoiCk1nr912Lh5BszlfebP9df6teV4qfxnZYmpbxA== 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=MNWgVq4pXRzMraUu+oRr22inacD89MUPcvPm6oLjsAQ=; b=vyEZVpexYohZbzMB1t5Ph1T4rQ4onFjNLWiColFED5MpbFCR4KHQh8NXuujOduXvNazCN6zzqrzspK9qALFQUm2LFzvpG9l5oUSxdEvy3G1VXJUN3p3I79723YfHigor/hkrvX09mXAgxwHt8aATq0tbokvxu9Jzmy10j2W5FCXuZSdvBUFT8BDMk85IW+Pav9QqXym6i6eEYHR6N3YGwmNBARZgvJzM+2tm1XQ/X1WeH0VPq7Rjmre1LRp6Dob2HielrjnZCwZBIzFSioKSFVPJKJVQKlimzg1CAAOxU0Kxxb2kWfl9wT9+2bhubAMlI78epwrJGkDcIX46VWkCUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MNWgVq4pXRzMraUu+oRr22inacD89MUPcvPm6oLjsAQ=; b=rqULeNSRDQclg7tbimumMKLV+W4SfDmk09H0zKR176/jRqkrRDtWbGtnwiRenkLGJcNRXhM2q5HTRRvnOSzGqo7xoEDx6Zt0pwvOWL7fw5nC6tRYGiPU5APHCOpkTNOmwm5xCA956p0MlK7HQQ0aEtU4j8PY/xrvbCwhuPQ5OMeom8162IuoMH89g5bJL8L72JVY+ul7R8bEcwN+PVBxtbCHfUG4cI/J6eHIILZwma2/HGrW9S09jpDTCNb+sYuFxiW9N2qH46lrV82kG7HKgCtLWtKgLU+0KoqbIXJ9Vl1mHTq5ET95xUxufTDkDnZDjZDrUhGkm9e0tiNdy4xeRA== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CH0PR12MB5089.namprd12.prod.outlook.com (2603:10b6:610:bc::8) by PH0PR12MB8821.namprd12.prod.outlook.com (2603:10b6:510:28d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Thu, 3 Dec 2026 00:03:00 +0000 Received: from CH0PR12MB5089.namprd12.prod.outlook.com ([fe80::cb31:7ebf:51e3:d9f6]) by CH0PR12MB5089.namprd12.prod.outlook.com ([fe80::cb31:7ebf:51e3:d9f6%4]) with mapi id 15.21.0688.010; Thu, 3 Dec 2026 00:03:00 +0000 From: David Cemin To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, W_Armin@gmx.de Cc: mpearson-lenovo@squebb.ca, derekjohn.clark@gmail.com, xy-jackie@139.com, i@rong.moe, marco_giunta@outlook.it, ciro.pedrini@gmail.com, ldemarchi@nvidia.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/4] platform: lenovo: move the architecture independent WMI drivers out of x86 Date: Wed, 2 Dec 2026 16:02:48 -0800 Message-ID: <20261203000251.1006053-2-dcemin@nvidia.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261203000251.1006053-1-dcemin@nvidia.com> References: <20261130043245.758932-1-dcemin@nvidia.com> <20261203000251.1006053-1-dcemin@nvidia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0119.namprd13.prod.outlook.com (2603:10b6:a03:2c5::34) To CH0PR12MB5089.namprd12.prod.outlook.com (2603:10b6:610:bc::8) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR12MB5089:EE_|PH0PR12MB8821:EE_ X-MS-Office365-Filtering-Correlation-Id: eed89771-357f-4023-68b6-08df50d0cb5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|23010399003|1800799024|10067099003|56012099006|261021121427099003|261021123027099003|261022105027099003|261022075727099003|261009223027099003|261102123227099003|261021135927099003|261028144727099003|261026140227099003|261026121527099003|18002099003|22082099003|4143699003|11063799006|6133799003; X-Microsoft-Antispam-Message-Info: 7oWounK6ij+ImWRBDDLdGgDbLPxBaLTwAy7KHAP9HZTJUy2nlVs/hkSp3PlQZbngUCL82SjrVh3ajHiJLBND8TXItF4iOsmYkVMmmsOqiHs0Law7sLW02yGWhOvX8ORqLNSnhvuHc95bj+Wj3n8rZOBpauB6VVT7r1jZV8/IHosfpK1STmUzVEgaZMusg/lR86wlkHCJnfcCp+ic4hAT/3clANOF+wDWqJbUd6tBWldhK3pEEeAGpCTWMuMtomk67chEbRVlNDoXdpUwXSY4aA2sDL0gRQ1463uO5jKdw44cfoa2PjZ6V8XH31CT8EjeF9BMQoeYwsn7CJv/oo4a2vDfezksp1usLQkD7HAfpJrqZdNTu3SG33/2P0licy+y/CQR1fwJizYx+R0VnfqNFC4kle3RbaSELRGdKHsxa4OYtkHzGqmcF7qh1r7FiZiOjypdwEwQ5ICX2qzHd2PlXNs25MK5h+YEjUrjFCG9qMJuPQ/ke8Dlgsg4AeDrSvnxGgk1rDhvGude+MJRbmDNtXhcpyjt1WcEerPbqQtwVhsFrZvHAHNfPti8DwUkEU9PKk0FzfeUYLusuzj1dqC9EJpICJ+pjAgKX+tr6tslFPhEfA8/Xvey0pajI7X6uZTYmObtCTacuuusMdIIPTIltVudasnVtoanar74ezS+Ewo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR12MB5089.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(23010399003)(1800799024)(10067099003)(56012099006)(261021121427099003)(261021123027099003)(261022105027099003)(261022075727099003)(261009223027099003)(261102123227099003)(261021135927099003)(261028144727099003)(261026140227099003)(261026121527099003)(18002099003)(22082099003)(4143699003)(11063799006)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ncV68ViSJ8tlsRqE0frescDoBOhdaxuRP1CXUjDEWhnK3VeuSMNOlnAZsuHt?= =?us-ascii?Q?e1peYM2GW8J5hAIKbykwq/sTLuqvVDy+8JumKvzoQY9FqXygTUZDrJK62S/c?= =?us-ascii?Q?sFevNAp4Zjfq2oU2KweFI+ZRMHJQrsORpiaiVCV93NmVvlq8ciZFqdebvAKx?= =?us-ascii?Q?l/LlPqYM/Sv/J+1Qz/yDEoAxdLSp1/UoViQc5OD3JcPxPLerIV6EgfgAf+XU?= =?us-ascii?Q?wnxy7mEbQXfnHMucw3PPTsYfL+e15AqtX+5ZIaevdvRVTjbod+13I5DJurlv?= =?us-ascii?Q?UsqyiHUJPtg2TgOIpWQMYKrjhPpPvt6imDbCr4MxDmTZ1oaBjDfh7VQNcMXL?= =?us-ascii?Q?SO680N4XYiuyqd07/LmUQhamI81vzJVyFfQPMEy7500jBZUmzDOrRgc8T5TO?= =?us-ascii?Q?C9QL4BQNs6TIZIAZ41AE68YKbwPylMdJ5o64PtAH71bGt9kJqs6okqc2xRID?= =?us-ascii?Q?3baaqBO+T7XHMk+/ARlpbWzW80cEvNUrGIBm5/w+3Y2ifXl2LTgjXz77o1mY?= =?us-ascii?Q?57MbG04IcyXfRoJBz7iPR8Kf8i3bVfNhujrD9cjerlaxpuXmPvhlkkiLp3Zf?= =?us-ascii?Q?jX7vp7tzXrwrrHSml+OvykFFIFPj+MenMJwYROkEt6ptTtGx2dApgOU4QOoz?= =?us-ascii?Q?tgW/U3dV0zJskBzpc1LftMijayVdeC7venSjokWpixsDqBZqOvqCjR2Xmn2H?= =?us-ascii?Q?4axBImKX1DUSRHGWmu2NZtgyoAGRGsS/o9vXjOvuN66vcmFkR2+O0YU2ZPUv?= =?us-ascii?Q?xp6GCgHVAyfeHXV/wEUKzsu6oicZs5/EJwsUbjc9e5kEabzBgDs3rZ66uOyK?= =?us-ascii?Q?FYq1myNYN4TdEJKN5xDNwXWXrIyPz3Qucqov22cTW2r2Gl7z2eSqQJXzvIUM?= =?us-ascii?Q?igr4ytMUjlnkF6+iD2xzULc+EosVldqcr3LO6hljfSxQBb7Q7xf9EhW41b/2?= =?us-ascii?Q?ryRlUGFMvgz/zh9ZiJ+roIQcLLVNpnUnLqxq88KdeoYinsA5fcv6un383+P3?= =?us-ascii?Q?3wk6fo8XP6C1aD+8c9DRyuFy5k598oe1euBkWigUgshTynGqCrWo9Mhh2vkE?= =?us-ascii?Q?55BCYfvXmSqRJqaLxaIs2rCslw411WsYSK9qL26W678aktqGqtgF16WBSNPM?= =?us-ascii?Q?mjF7mGXq0lDvHM7V4FbsfKx0cyS36k+U8wC/X/Mv37DE6lWfzYKYBUwFBLsr?= =?us-ascii?Q?MFx7YTA32Is4qBmIdErdia3ZvKo3/r94M3v6DMC2oazQo93hcWUl2zighNwt?= =?us-ascii?Q?oaECqIj0NW8c66Qcgx4ZURl9OIPHpqlT/4wXv0GqGLSyaJLcWfqFUZAQWWvO?= =?us-ascii?Q?3YQDdclU/r5hnwJjXKj2xNxkFvVJ2Avs6tEdFjgaX+99kHSun71tutjBwcg1?= =?us-ascii?Q?3OXAdkAui5cWLjgpbExCB1YHdQJ9QUqT9k89oFBxbbk6c93/Fqys8FMShl1m?= =?us-ascii?Q?bVQPPCATuZnNBPY3hkbcf/v9Nid9sHpm0rMhUiOBFBklw1N7S1QQVn+Sjt7k?= =?us-ascii?Q?hCdqDwdenQjsZGx5BqeLBLav2azPRW8JPpV390YuLOYG4DiFnvBUKhbeSnrA?= =?us-ascii?Q?QeZpnByw9++6nEC9I1ALDbOasGyP072+ClQo4Gj6D6TRD719uyUVoDOPGtip?= =?us-ascii?Q?+sXij6DZXYOWjT+0H80XB/21MdMYIbaPhdnoSc27V+QVwrjqDsnxzlJTmi9S?= =?us-ascii?Q?/EBPc74FbfRi6iq64UmLKkUIHuRxZtVVNzCqJxzBvh2y4lJqj7ktn2iQ5oCz?= =?us-ascii?Q?qHCCGC4OuQ=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: eed89771-357f-4023-68b6-08df50d0cb5d X-MS-Exchange-CrossTenant-AuthSource: CH0PR12MB5089.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 00:03:00.6333 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d43rq9vdt4TA88wamVE2nDg8JDhbrdO0DNhW+GWlNSBw+nRnKYKqRrhjesBMg0uslJGGWoULUIBXoZEBdltpHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8821 The Lenovo WMI drivers (events, helpers, capability data, GameZone, Other Mode, hotkey utilities and camera button) contain no x86 specific code: they talk to firmware through the ACPI-WMI core only. They live under drivers/platform/x86 because that is where Lenovo drivers were collected, and X86_PLATFORM_DEVICES keeps them off every other architecture. Lenovo now ships ACPI based arm64 laptops whose firmware exposes the same WMI GUIDs (the Fn key events, the mic mute LED method, GameZone and Other Mode). Give these drivers an architecture independent home, drivers/platform/lenovo, following the layout of drivers/platform/surface which exists for the same reason, so they can be built wherever the WMI core is available. ideapad-laptop, thinkpad_acpi, think-lmi, yogabook and the Yoga Tablet drivers stay under x86: they depend on i8042, port I/O or x86 only ACPI devices. lenovo-ymc stays under x86 because it depends on ideapad-laptop, but it uses the events and helpers modules. Make it depend on LENOVO_PLATFORMS, so that its selects of LENOVO_WMI_EVENTS and LENOVO_WMI_HELPERS cannot bypass the new menu, and include the two headers from their new location. Apart from that this is pure code motion: the files, their Kconfig entries and the module naming scheme are unchanged. MAINTAINERS entries are updated for the new paths. Signed-off-by: David Cemin Reviewed-by: Mark Pearson Reviewed-by: Jackie Dong Reviewed-by: Rong Zhang --- MAINTAINERS | 3 +- drivers/platform/Kconfig | 2 + drivers/platform/Makefile | 1 + drivers/platform/lenovo/Kconfig | 87 +++++++++++++++++++ drivers/platform/lenovo/Makefile | 22 +++++ .../platform/{x86 => }/lenovo/wmi-camera.c | 0 .../platform/{x86 => }/lenovo/wmi-capdata.c | 0 .../platform/{x86 => }/lenovo/wmi-capdata.h | 0 .../platform/{x86 => }/lenovo/wmi-events.c | 0 .../platform/{x86 => }/lenovo/wmi-events.h | 0 .../platform/{x86 => }/lenovo/wmi-gamezone.c | 0 .../platform/{x86 => }/lenovo/wmi-helpers.c | 0 .../platform/{x86 => }/lenovo/wmi-helpers.h | 0 .../{x86 => }/lenovo/wmi-hotkey-utilities.c | 0 drivers/platform/{x86 => }/lenovo/wmi-other.c | 0 drivers/platform/x86/lenovo/Kconfig | 68 +-------------- drivers/platform/x86/lenovo/Makefile | 7 -- drivers/platform/x86/lenovo/ymc.c | 4 +- 18 files changed, 117 insertions(+), 77 deletions(-) create mode 100644 drivers/platform/lenovo/Kconfig create mode 100644 drivers/platform/lenovo/Makefile rename drivers/platform/{x86 => }/lenovo/wmi-camera.c (100%) rename drivers/platform/{x86 => }/lenovo/wmi-capdata.c (100%) rename drivers/platform/{x86 => }/lenovo/wmi-capdata.h (100%) rename drivers/platform/{x86 => }/lenovo/wmi-events.c (100%) rename drivers/platform/{x86 => }/lenovo/wmi-events.h (100%) rename drivers/platform/{x86 => }/lenovo/wmi-gamezone.c (100%) rename drivers/platform/{x86 => }/lenovo/wmi-helpers.c (100%) rename drivers/platform/{x86 => }/lenovo/wmi-helpers.h (100%) rename drivers/platform/{x86 => }/lenovo/wmi-hotkey-utilities.c (100%) rename drivers/platform/{x86 => }/lenovo/wmi-other.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index ba7650cb86b0..b8356204a0ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15170,13 +15170,14 @@ L: platform-driver-x86@vger.kernel.org S: Maintained F: Documentation/wmi/devices/lenovo-wmi-gamezone.rst F: Documentation/wmi/devices/lenovo-wmi-other.rst +F: drivers/platform/lenovo/ F: drivers/platform/x86/lenovo/* LENOVO WMI HOTKEY UTILITIES DRIVER M: Jackie Dong L: platform-driver-x86@vger.kernel.org S: Maintained -F: drivers/platform/x86/lenovo/wmi-hotkey-utilities.c +F: drivers/platform/lenovo/wmi-hotkey-utilities.c LENOVO HID drivers M: Derek J. Clark diff --git a/drivers/platform/Kconfig b/drivers/platform/Kconfig index aa004b0e4406..6db1757baa52 100644 --- a/drivers/platform/Kconfig +++ b/drivers/platform/Kconfig @@ -15,6 +15,8 @@ source "drivers/platform/olpc/Kconfig" source "drivers/platform/surface/Kconfig" +source "drivers/platform/lenovo/Kconfig" + source "drivers/platform/x86/Kconfig" source "drivers/platform/arm64/Kconfig" diff --git a/drivers/platform/Makefile b/drivers/platform/Makefile index 34e694e6da14..52d05b2301b7 100644 --- a/drivers/platform/Makefile +++ b/drivers/platform/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_GOLDFISH) += goldfish/ obj-$(CONFIG_CHROME_PLATFORMS) += chrome/ obj-$(CONFIG_CZNIC_PLATFORMS) += cznic/ obj-$(CONFIG_SURFACE_PLATFORMS) += surface/ +obj-$(CONFIG_LENOVO_PLATFORMS) += lenovo/ obj-$(CONFIG_ARM64_PLATFORM_DEVICES) += arm64/ obj-$(CONFIG_BCM2835_VCHIQ) += raspberrypi/ obj-$(CONFIG_ACPI_WMI) += wmi/ diff --git a/drivers/platform/lenovo/Kconfig b/drivers/platform/lenovo/Kconfig new file mode 100644 index 000000000000..8222322ca671 --- /dev/null +++ b/drivers/platform/lenovo/Kconfig @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Lenovo Platform-Specific Drivers +# + +menuconfig LENOVO_PLATFORMS + bool "Lenovo Platform-Specific Device Drivers" + depends on ARM64 || X86 || COMPILE_TEST + default y if ARM64 || X86 + help + Say Y here to get to see options for platform-specific device drivers + for Lenovo devices that do not depend on the CPU architecture, such + as the ACPI-WMI based drivers used on both x86 and arm64 laptops. + This option alone does not add any kernel code. + + If you say N, all options in this submenu will be skipped and disabled. + +if LENOVO_PLATFORMS + +config LENOVO_WMI_HELPERS + tristate + depends on ACPI_WMI + +config LENOVO_WMI_EVENTS + tristate + depends on ACPI_WMI + +config LENOVO_WMI_CAPDATA + tristate + depends on ACPI_WMI + depends on LENOVO_WMI_HELPERS + +config LENOVO_WMI_HOTKEY_UTILITIES + tristate "Lenovo Hotkey Utility WMI extras driver" + depends on ACPI_WMI + select NEW_LEDS + select LEDS_CLASS + imply IDEAPAD_LAPTOP + help + This driver provides WMI support for Lenovo customized hotkeys function, + such as LED control for audio/mic mute event for Ideapad, YOGA, XiaoXin, + Gaming, ThinkBook and so on. + +config LENOVO_WMI_CAMERA + tristate "Lenovo WMI Camera Button driver" + depends on ACPI_WMI + depends on INPUT + help + This driver provides support for Lenovo camera button. The Camera + button is a GPIO device. This driver receives ACPI notifications when + the camera button is switched on/off. + + To compile this driver as a module, choose M here: the module + will be called lenovo-wmi-camera. + +config LENOVO_WMI_GAMEZONE + tristate "Lenovo GameZone WMI Driver" + depends on ACPI_WMI + depends on DMI + select ACPI_PLATFORM_PROFILE + select LENOVO_WMI_EVENTS + select LENOVO_WMI_HELPERS + help + Say Y here if you have a WMI aware Lenovo Legion device and would like to use the + platform-profile firmware interface to manage power usage. + + To compile this driver as a module, choose M here: the module will + be called lenovo-wmi-gamezone. + +config LENOVO_WMI_TUNING + tristate "Lenovo Other Mode WMI Driver" + depends on ACPI_WMI + depends on ACPI_BATTERY + select HWMON + select FW_ATTR_CLASS + select LENOVO_WMI_CAPDATA + select LENOVO_WMI_EVENTS + select LENOVO_WMI_HELPERS + help + Say Y here if you have a WMI aware Lenovo Legion device and would like to use the + firmware_attributes API to control various tunable settings typically exposed by + Lenovo software in Windows. + + To compile this driver as a module, choose M here: the module will + be called lenovo-wmi-other. + +endif # LENOVO_PLATFORMS diff --git a/drivers/platform/lenovo/Makefile b/drivers/platform/lenovo/Makefile new file mode 100644 index 000000000000..1cac115dd735 --- /dev/null +++ b/drivers/platform/lenovo/Makefile @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for linux/drivers/platform/lenovo +# Lenovo Platform Specific Drivers (architecture independent) +# + +lenovo-target-$(CONFIG_LENOVO_WMI_HELPERS) += wmi-helpers.o +lenovo-target-$(CONFIG_LENOVO_WMI_EVENTS) += wmi-events.o +lenovo-target-$(CONFIG_LENOVO_WMI_CAPDATA) += wmi-capdata.o +lenovo-target-$(CONFIG_LENOVO_WMI_HOTKEY_UTILITIES) += wmi-hotkey-utilities.o +lenovo-target-$(CONFIG_LENOVO_WMI_CAMERA) += wmi-camera.o +lenovo-target-$(CONFIG_LENOVO_WMI_GAMEZONE) += wmi-gamezone.o +lenovo-target-$(CONFIG_LENOVO_WMI_TUNING) += wmi-other.o + +# Add 'lenovo' prefix to each module listed in lenovo-target-* +define LENOVO_OBJ_TARGET +lenovo-$(1)-y := $(1).o +obj-$(2) += lenovo-$(1).o +endef + +$(foreach target, $(basename $(lenovo-target-y)), $(eval $(call LENOVO_OBJ_TARGET,$(target),y))) +$(foreach target, $(basename $(lenovo-target-m)), $(eval $(call LENOVO_OBJ_TARGET,$(target),m))) diff --git a/drivers/platform/x86/lenovo/wmi-camera.c b/drivers/platform/lenovo/wmi-camera.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-camera.c rename to drivers/platform/lenovo/wmi-camera.c diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/lenovo/wmi-capdata.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-capdata.c rename to drivers/platform/lenovo/wmi-capdata.c diff --git a/drivers/platform/x86/lenovo/wmi-capdata.h b/drivers/platform/lenovo/wmi-capdata.h similarity index 100% rename from drivers/platform/x86/lenovo/wmi-capdata.h rename to drivers/platform/lenovo/wmi-capdata.h diff --git a/drivers/platform/x86/lenovo/wmi-events.c b/drivers/platform/lenovo/wmi-events.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-events.c rename to drivers/platform/lenovo/wmi-events.c diff --git a/drivers/platform/x86/lenovo/wmi-events.h b/drivers/platform/lenovo/wmi-events.h similarity index 100% rename from drivers/platform/x86/lenovo/wmi-events.h rename to drivers/platform/lenovo/wmi-events.h diff --git a/drivers/platform/x86/lenovo/wmi-gamezone.c b/drivers/platform/lenovo/wmi-gamezone.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-gamezone.c rename to drivers/platform/lenovo/wmi-gamezone.c diff --git a/drivers/platform/x86/lenovo/wmi-helpers.c b/drivers/platform/lenovo/wmi-helpers.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-helpers.c rename to drivers/platform/lenovo/wmi-helpers.c diff --git a/drivers/platform/x86/lenovo/wmi-helpers.h b/drivers/platform/lenovo/wmi-helpers.h similarity index 100% rename from drivers/platform/x86/lenovo/wmi-helpers.h rename to drivers/platform/lenovo/wmi-helpers.h diff --git a/drivers/platform/x86/lenovo/wmi-hotkey-utilities.c b/drivers/platform/lenovo/wmi-hotkey-utilities.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-hotkey-utilities.c rename to drivers/platform/lenovo/wmi-hotkey-utilities.c diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/lenovo/wmi-other.c similarity index 100% rename from drivers/platform/x86/lenovo/wmi-other.c rename to drivers/platform/lenovo/wmi-other.c diff --git a/drivers/platform/x86/lenovo/Kconfig b/drivers/platform/x86/lenovo/Kconfig index 8054383d49a3..140f8acf7cc0 100644 --- a/drivers/platform/x86/lenovo/Kconfig +++ b/drivers/platform/x86/lenovo/Kconfig @@ -21,29 +21,6 @@ config IDEAPAD_LAPTOP This is a driver for Lenovo IdeaPad netbooks contains drivers for rfkill switch, hotkey, fan control and backlight control. -config LENOVO_WMI_HOTKEY_UTILITIES - tristate "Lenovo Hotkey Utility WMI extras driver" - depends on ACPI_WMI - select NEW_LEDS - select LEDS_CLASS - imply IDEAPAD_LAPTOP - help - This driver provides WMI support for Lenovo customized hotkeys function, - such as LED control for audio/mic mute event for Ideapad, YOGA, XiaoXin, - Gaming, ThinkBook and so on. - -config LENOVO_WMI_CAMERA - tristate "Lenovo WMI Camera Button driver" - depends on ACPI_WMI - depends on INPUT - help - This driver provides support for Lenovo camera button. The Camera - button is a GPIO device. This driver receives ACPI notifications when - the camera button is switched on/off. - - To compile this driver as a module, choose M here: the module - will be called lenovo-wmi-camera. - config LENOVO_YB9_KBDOCK tristate "Lenovo Yoga Book 9 keyboard dock detection" depends on ACPI_WMI @@ -63,6 +40,7 @@ config LENOVO_YMC depends on ACPI_WMI depends on INPUT depends on IDEAPAD_LAPTOP + depends on LENOVO_PLATFORMS select INPUT_SPARSEKMAP select LENOVO_WMI_EVENTS select LENOVO_WMI_HELPERS @@ -252,47 +230,3 @@ config YT2_1380 To compile this driver as a module, choose M here: the module will be called lenovo-yogabook. - -config LENOVO_WMI_CAPDATA - tristate - depends on ACPI_WMI - depends on LENOVO_WMI_HELPERS - -config LENOVO_WMI_EVENTS - tristate - depends on ACPI_WMI - -config LENOVO_WMI_HELPERS - tristate - depends on ACPI_WMI - -config LENOVO_WMI_GAMEZONE - tristate "Lenovo GameZone WMI Driver" - depends on ACPI_WMI - depends on DMI - select ACPI_PLATFORM_PROFILE - select LENOVO_WMI_EVENTS - select LENOVO_WMI_HELPERS - help - Say Y here if you have a WMI aware Lenovo Legion device and would like to use the - platform-profile firmware interface to manage power usage. - - To compile this driver as a module, choose M here: the module will - be called lenovo-wmi-gamezone. - -config LENOVO_WMI_TUNING - tristate "Lenovo Other Mode WMI Driver" - depends on ACPI_WMI - depends on ACPI_BATTERY - select HWMON - select FW_ATTR_CLASS - select LENOVO_WMI_CAPDATA - select LENOVO_WMI_EVENTS - select LENOVO_WMI_HELPERS - help - Say Y here if you have a WMI aware Lenovo Legion device and would like to use the - firmware_attributes API to control various tunable settings typically exposed by - Lenovo software in Windows. - - To compile this driver as a module, choose M here: the module will - be called lenovo-wmi-other. diff --git a/drivers/platform/x86/lenovo/Makefile b/drivers/platform/x86/lenovo/Makefile index 12816d8d5e24..758c36cedee8 100644 --- a/drivers/platform/x86/lenovo/Makefile +++ b/drivers/platform/x86/lenovo/Makefile @@ -7,17 +7,10 @@ obj-$(CONFIG_IDEAPAD_LAPTOP) += ideapad-laptop.o obj-$(CONFIG_THINKPAD_LMI) += think-lmi.o obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o -lenovo-target-$(CONFIG_LENOVO_WMI_HOTKEY_UTILITIES) += wmi-hotkey-utilities.o lenovo-target-$(CONFIG_LENOVO_YB9_KBDOCK) += yb9-kbdock.o lenovo-target-$(CONFIG_LENOVO_YMC) += ymc.o lenovo-target-$(CONFIG_YOGABOOK) += yogabook.o lenovo-target-$(CONFIG_YT2_1380) += yoga-tab2-pro-1380-fastcharger.o -lenovo-target-$(CONFIG_LENOVO_WMI_CAMERA) += wmi-camera.o -lenovo-target-$(CONFIG_LENOVO_WMI_CAPDATA) += wmi-capdata.o -lenovo-target-$(CONFIG_LENOVO_WMI_EVENTS) += wmi-events.o -lenovo-target-$(CONFIG_LENOVO_WMI_HELPERS) += wmi-helpers.o -lenovo-target-$(CONFIG_LENOVO_WMI_GAMEZONE) += wmi-gamezone.o -lenovo-target-$(CONFIG_LENOVO_WMI_TUNING) += wmi-other.o # Add 'lenovo' prefix to each module listed in lenovo-target-* define LENOVO_OBJ_TARGET diff --git a/drivers/platform/x86/lenovo/ymc.c b/drivers/platform/x86/lenovo/ymc.c index b2bb8ad9de0c..45d8c5956c51 100644 --- a/drivers/platform/x86/lenovo/ymc.c +++ b/drivers/platform/x86/lenovo/ymc.c @@ -20,8 +20,8 @@ #include #include #include "ideapad-laptop.h" -#include "wmi-events.h" -#include "wmi-helpers.h" +#include "../../lenovo/wmi-events.h" +#include "../../lenovo/wmi-helpers.h" #define LENOVO_YMC_QUERY_GUID "09B0EE6E-C3FD-4243-8DA1-7911FF80BB8C" -- 2.56.1