From nobody Tue Dec 2 02:51:09 2025 Received: from mail.tuxedocomputers.com (mail.tuxedocomputers.com [157.90.84.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99E5F30F95C; Mon, 17 Nov 2025 13:25:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=157.90.84.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385947; cv=none; b=F+wh2P3wRCzw1fKYSEq7NygBXX2OUsWj4RVznpaEgNpab8RyfhrRicekS1hcpU7++i6HBJQQGau57ONRcMroV9qosj2tUA31PqYLAIw+Yg+/PhHfLs2S85lRbIkikX9ElnGm7FtYJZY8ir4mFhHOkG/pUB6gV6AA1rb3MbzDgSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385947; c=relaxed/simple; bh=hlH+KvaPy/VjPwiEu76WnqNwzWyPH7nBkUMXCJ3W/fM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tym17xF6+xMGN/oiic/PwYq2+qUogjZopV03PitcDFk1qmOyyJJcgaI/rL8DRSVkieBKcz2Co/iPYLN0kPK9zihtleeTqmdXBa5cQm3/Y2vUI5j5gVvS0FWqGQR9MIBtHs4zclOzonRRb165EOesvoEe+4qiixQJt5+kXfL4OGs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com; spf=pass smtp.mailfrom=tuxedocomputers.com; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b=E7W304++; arc=none smtp.client-ip=157.90.84.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b="E7W304++" Received: from wse-pc.fritz.box (pd9e597c7.dip0.t-ipconnect.de [217.229.151.199]) (Authenticated sender: wse@tuxedocomputers.com) by mail.tuxedocomputers.com (Postfix) with ESMTPA id 097782FC004D; Mon, 17 Nov 2025 14:25:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxedocomputers.com; s=default; t=1763385938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hXn+frxogInMKvOCjn1sSvGq7CtT3So54J/i0Q8mibQ=; b=E7W304++5ZOGeaU5/NZqafyZnyeejZZW4RbBa1B8hPk12Ytw9KT41sD9OHaLv9Sb4BufEo K7zdLRRN9Ouh7Kf2OGypJR5DoOtq0eRjShPPsOI/fU2891MYOI7RwMg1o3MYXmd2GH/LlX HibSjZpHYCK3lTUkU0iw8mgz+RVlkuA= Authentication-Results: mail.tuxedocomputers.com; auth=pass smtp.auth=wse@tuxedocomputers.com smtp.mailfrom=wse@tuxedocomputers.com From: Werner Sembach To: W_Armin@gmx.de, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Werner Sembach Subject: [PATCH 1/6] platform/x86/uniwill: Add TUXEDO devices Date: Mon, 17 Nov 2025 14:23:58 +0100 Message-ID: <20251117132530.32460-2-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117132530.32460-1-wse@tuxedocomputers.com> References: <20251117132530.32460-1-wse@tuxedocomputers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add all TUXEDO devices that can make use of this driver. Signed-off-by: Werner Sembach Reviewed-by: Armin Wolf --- drivers/platform/x86/uniwill/uniwill-acpi.c | 308 ++++++++++++++++++++ 1 file changed, 308 insertions(+) diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform= /x86/uniwill/uniwill-acpi.c index 014960d16211b..29bb3709bfcc8 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -1478,6 +1478,20 @@ static struct platform_driver uniwill_driver =3D { }; =20 static const struct dmi_system_id uniwill_dmi_table[] __initconst =3D { + { + .ident =3D "XMG FUSION 15", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "LAPQC71A"), + }, + }, + { + .ident =3D "XMG FUSION 15", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "LAPQC71B"), + }, + }, { .ident =3D "Intel NUC x15", .matches =3D { @@ -1503,6 +1517,300 @@ static const struct dmi_system_id uniwill_dmi_table= [] __initconst =3D { UNIWILL_FEATURE_BATTERY | UNIWILL_FEATURE_HWMON), }, + { + .ident =3D "TUXEDO InfinityBook Pro 14 Gen6 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTxX1"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14 Gen6 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14/16 Gen7 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book P= ro Gen 7", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Boo= k Pro Gen 8", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14 Gen8 Intel/Commodore Omnia-Book P= ro Gen 8", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 16 Gen8 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14/15 Gen9 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GXxHRXx"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14/15 Gen9 Intel/Commodore Omnia-Boo= k 15 Gen9", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GXxMRXx"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14/15 Gen10 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxHP4NAx"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 14/15 Gen10 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"), + }, + }, + { + .ident =3D "TUXEDO InfinityBook Pro 15 Gen10 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxAR4NAx"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15 Gen1 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501A1650TI"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15 Gen1 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501A2060"), + }, + }, + { + .ident =3D "TUXEDO Polaris 17 Gen1 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701A1650TI"), + }, + }, + { + .ident =3D "TUXEDO Polaris 17 Gen1 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701A2060"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15 Gen1 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501I1650TI"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15 Gen1 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501I2060"), + }, + }, + { + .ident =3D "TUXEDO Polaris 17 Gen1 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701I1650TI"), + }, + }, + { + .ident =3D "TUXEDO Polaris 17 Gen1 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701I2060"), + }, + }, + { + .ident =3D "TUXEDO Trinity 15 Intel Gen1", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "TRINITY1501I"), + }, + }, + { + .ident =3D "TUXEDO Trinity 17 Intel Gen1", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "TRINITY1701I"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15/17 Gen2 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15/17 Gen2 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 15 Gen4 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), + }, + }, + { + .ident =3D "TUXEDO Polaris 15/17 Gen5 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16 Gen5 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris Slim 15 Gen6 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), + }, + }, + { + .ident =3D "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 = Gen6", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16 Gen7 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16 Gen7 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), + }, + }, + { + .ident =3D "TUXEDO Stellaris 16 Gen7 Intel", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), + }, + }, + { + .ident =3D "TUXEDO Pulse 14 Gen1 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PULSE1401"), + }, + }, + { + .ident =3D "TUXEDO Pulse 15 Gen1 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PULSE1501"), + }, + }, + { + .ident =3D "TUXEDO Pulse 15 Gen2 AMD", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PF5LUXG"), + }, + }, { } }; MODULE_DEVICE_TABLE(dmi, uniwill_dmi_table); --=20 2.43.0 From nobody Tue Dec 2 02:51:09 2025 Received: from mail.tuxedocomputers.com (mail.tuxedocomputers.com [157.90.84.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 658C531B800; Mon, 17 Nov 2025 13:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=157.90.84.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385948; cv=none; b=HYOTGGWXvBltQFxyHMcqKIqu+sXPLIAWc7gXFjZadgj0wrc0fCjf8KjZwcRkERJ4i8m3SAC2yBsd46sq0zt17LWr8q/itlbWJzvXE/cJnrtcKE23jBTYMvbSCwfupJoEcM/WBRtYxYHh8poLsUbOYnqzrjhChXCMWlw0mJ+rygk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385948; c=relaxed/simple; bh=mRi0c3eb2KVaNB4Q2bWYRwwZMqDzT2vDSZO6+/DOU38=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZNvm9kh17OhMwFLPbLwv7wEazhIwOyOlsH+jjzB0lJfINesieKMqEFPb60QC3bYemizXs5hbcXIZVxyO+bNYRQ4kcz9s3iUqEIGj0VwfzdPcUmd3ivlO3ykCQ1Q4EoupMHoYt1cX/cftnC+CvJpqPAzwVhKjdDkfCRfeIPhJJCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com; spf=pass smtp.mailfrom=tuxedocomputers.com; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b=VGj6+7EZ; arc=none smtp.client-ip=157.90.84.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b="VGj6+7EZ" Received: from wse-pc.fritz.box (pd9e597c7.dip0.t-ipconnect.de [217.229.151.199]) (Authenticated sender: wse@tuxedocomputers.com) by mail.tuxedocomputers.com (Postfix) with ESMTPA id A46D02FC0050; Mon, 17 Nov 2025 14:25:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxedocomputers.com; s=default; t=1763385938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M3XmbCeF9L/64I/m2ReedbQ6L8IgDryt/5k2nqVG2oU=; b=VGj6+7EZEOahZEeWGDEFapvtcIw8N3KeEFoYn9Zxrdeztjg6GWBdYP0vpZ8FEd4ah+Y2+R GGqNUl4NLCNa6dffc4fg7iMg0jsmE1mUk5hdvXOSVfi8Z8Ge2j6WZg0jabeezcvxHOVqgi q2F42k0x1Y3LYB58KmVTwxUn9WeMijE= Authentication-Results: mail.tuxedocomputers.com; auth=pass smtp.auth=wse@tuxedocomputers.com smtp.mailfrom=wse@tuxedocomputers.com From: Werner Sembach To: W_Armin@gmx.de, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Werner Sembach Subject: [PATCH 2/6] platform/x86/uniwill: Handle more WMI events required for TUXEDO devices Date: Mon, 17 Nov 2025 14:23:59 +0100 Message-ID: <20251117132530.32460-3-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117132530.32460-1-wse@tuxedocomputers.com> References: <20251117132530.32460-1-wse@tuxedocomputers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Handle some more WMI events that are triggered on TUXEDO devices. Signed-off-by: Werner Sembach --- drivers/platform/x86/uniwill/uniwill-acpi.c | 19 ++++++++++++++++++- drivers/platform/x86/uniwill/uniwill-wmi.h | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform= /x86/uniwill/uniwill-acpi.c index 29bb3709bfcc8..0cb86a701b2e1 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -371,9 +371,11 @@ static const struct key_entry uniwill_keymap[] =3D { =20 /* Reported in manual mode when toggling the airplane mode status */ { KE_KEY, UNIWILL_OSD_RFKILL, { KEY_RFKILL }}, + { KE_IGNORE, UNIWILL_OSD_RADIOON, { KEY_UNKNOWN }}, + { KE_IGNORE, UNIWILL_OSD_RADIOOFF, { KEY_UNKNOWN }}, =20 /* Reported when user wants to cycle the platform profile */ - { KE_IGNORE, UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE, { KEY_UNKNOWN }}, + { KE_KEY, UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE, { KEY_F14 }}, =20 /* Reported when the user wants to adjust the brightness of the keyboard = */ { KE_KEY, UNIWILL_OSD_KBDILLUMDOWN, { KEY_KBDILLUMDOW= N }}, @@ -382,11 +384,19 @@ static const struct key_entry uniwill_keymap[] =3D { /* Reported when the user wants to toggle the microphone mute status */ { KE_KEY, UNIWILL_OSD_MIC_MUTE, { KEY_MICMUTE }}, =20 + /* Reported when the user wants to toggle the mute status */ + { KE_IGNORE, UNIWILL_OSD_MUTE, { KEY_MUTE }}, + /* Reported when the user locks/unlocks the Fn key */ { KE_IGNORE, UNIWILL_OSD_FN_LOCK, { KEY_FN_ESC }}, =20 /* Reported when the user wants to toggle the brightness of the keyboard = */ { KE_KEY, UNIWILL_OSD_KBDILLUMTOGGLE, { KEY_KBDILLUMTOG= GLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL0, { KEY_KBDILLUMTOG= GLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL1, { KEY_KBDILLUMTOG= GLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL2, { KEY_KBDILLUMTOG= GLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL3, { KEY_KBDILLUMTOG= GLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL4, { KEY_KBDILLUMTOG= GLE }}, =20 /* FIXME: find out the exact meaning of those events */ { KE_IGNORE, UNIWILL_OSD_BAT_CHARGE_FULL_24_H, { KEY_UNKNOWN }}, @@ -395,6 +405,9 @@ static const struct key_entry uniwill_keymap[] =3D { /* Reported when the user wants to toggle the benchmark mode status */ { KE_IGNORE, UNIWILL_OSD_BENCHMARK_MODE_TOGGLE, { KEY_UNKNOWN }}, =20 + /* Reported when the user wants to toggle the webcam */ + { KE_IGNORE, UNIWILL_OSD_WEBCAM_TOGGLE, { KEY_UNKNOWN }}, + { KE_END } }; =20 @@ -1247,6 +1260,10 @@ static int uniwill_notifier_call(struct notifier_blo= ck *nb, unsigned long action } mutex_unlock(&data->battery_lock); =20 + return NOTIFY_OK; + case UNIWILL_OSD_DC_ADAPTER_CHANGED: + // noop for the time being + return NOTIFY_OK; default: mutex_lock(&data->input_lock); diff --git a/drivers/platform/x86/uniwill/uniwill-wmi.h b/drivers/platform/= x86/uniwill/uniwill-wmi.h index 2bf69f2d80381..48783b2e9ffb9 100644 --- a/drivers/platform/x86/uniwill/uniwill-wmi.h +++ b/drivers/platform/x86/uniwill/uniwill-wmi.h @@ -113,6 +113,8 @@ =20 #define UNIWILL_OSD_BENCHMARK_MODE_TOGGLE 0xC0 =20 +#define UNIWILL_OSD_WEBCAM_TOGGLE 0xCF + #define UNIWILL_OSD_KBD_BACKLIGHT_CHANGED 0xF0 =20 struct device; --=20 2.43.0 From nobody Tue Dec 2 02:51:09 2025 Received: from mail.tuxedocomputers.com (mail.tuxedocomputers.com [157.90.84.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7475B32C333; Mon, 17 Nov 2025 13:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=157.90.84.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385948; cv=none; b=OXw5j7UgmHotMV11W+ffQbCt3UyLNMgvmsUs4KZ5Sjj6pzbIN2+U16T7z0tWgm1bisvWm9fq+ga/V5nIJQ4keEUFZExWWER7K2zvWLA7omGLyuvAuhdEOEEVkIKgG6EVp5IZKvIgTZcRM+o9eYIN2ln1rd8HUJ/EBWNxeel/FPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385948; c=relaxed/simple; bh=EX+FMJnlta2cX2nu/mMkQn/QmagNkH6hE8AMx2GEcpg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jn/bCsVpmcJwmZfNL5P2pq3N86oWZgFCQSZHgtNE1wsEnqOC3aY/u1hU/nUgukd6M7w/OlhWKitQXvnmLpFybYMorJYNiZNF+j8mKtUfh82kq0Q7H17C0aF3LksdM8C9MdA/829aLAz81iHjCkBB8inpdksMbGgq9FpgpHN8nFM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com; spf=pass smtp.mailfrom=tuxedocomputers.com; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b=DecLh4Us; arc=none smtp.client-ip=157.90.84.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b="DecLh4Us" Received: from wse-pc.fritz.box (pd9e597c7.dip0.t-ipconnect.de [217.229.151.199]) (Authenticated sender: wse@tuxedocomputers.com) by mail.tuxedocomputers.com (Postfix) with ESMTPA id 4EB132FC0052; Mon, 17 Nov 2025 14:25:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxedocomputers.com; s=default; t=1763385939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FyM8xaGa9jOCk3Zx1E9YVuruBYLwmd3NYzb+o2Oe+2s=; b=DecLh4UsKF9Ip3W9vkMg5X26Ue1C3rKy/R4+y71dKeZTAzZFMdmzsXQeo0rbKOWcnXp9vG HWQbQSnZPZi5ROzRmutZdeti0e3ylk9Ub87L9pRfXQGpHhOh9MPCB7TheUN2AMUkh+t8KS r4MNedCXPvPjAHnCN/id9ywFk1SA6mM= Authentication-Results: mail.tuxedocomputers.com; auth=pass smtp.auth=wse@tuxedocomputers.com smtp.mailfrom=wse@tuxedocomputers.com From: Werner Sembach To: W_Armin@gmx.de, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Werner Sembach Subject: [PATCH 3/6] platform/x86/uniwill: Implement cTGP setting Date: Mon, 17 Nov 2025 14:24:00 +0100 Message-ID: <20251117132530.32460-4-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117132530.32460-1-wse@tuxedocomputers.com> References: <20251117132530.32460-1-wse@tuxedocomputers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Uniwill offers user setable cTGP for their EC on devices using NVIDIA 3000 Series and newer GPUs. This patch implements this setting as a sysfs attribute. Signed-off-by: Werner Sembach --- drivers/platform/x86/uniwill/uniwill-acpi.c | 110 +++++++++++++++++++- 1 file changed, 107 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform= /x86/uniwill/uniwill-acpi.c index 0cb86a701b2e1..de3417d9d1ac0 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -122,11 +122,11 @@ #define CTGP_DB_DB_ENABLE BIT(1) #define CTGP_DB_CTGP_ENABLE BIT(2) =20 -#define EC_ADDR_CTGP_OFFSET 0x0744 +#define EC_ADDR_CTGP_DB_CTGP_OFFSET 0x0744 =20 -#define EC_ADDR_TPP_OFFSET 0x0745 +#define EC_ADDR_CTGP_DB_TPP_OFFSET 0x0745 =20 -#define EC_ADDR_MAX_TGP 0x0746 +#define EC_ADDR_CTGP_DB_DB_OFFSET 0x0746 =20 #define EC_ADDR_LIGHTBAR_AC_CTRL 0x0748 #define LIGHTBAR_APP_EXISTS BIT(0) @@ -317,6 +317,7 @@ #define UNIWILL_FEATURE_LIGHTBAR BIT(3) #define UNIWILL_FEATURE_BATTERY BIT(4) #define UNIWILL_FEATURE_HWMON BIT(5) +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL BIT(6) =20 struct uniwill_data { struct device *dev; @@ -498,6 +499,10 @@ static bool uniwill_writeable_reg(struct device *dev, = unsigned int reg) case EC_ADDR_LIGHTBAR_BAT_RED: case EC_ADDR_LIGHTBAR_BAT_GREEN: case EC_ADDR_LIGHTBAR_BAT_BLUE: + case EC_ADDR_CTGP_DB_CTRL: + case EC_ADDR_CTGP_DB_CTGP_OFFSET: + case EC_ADDR_CTGP_DB_TPP_OFFSET: + case EC_ADDR_CTGP_DB_DB_OFFSET: return true; default: return false; @@ -531,6 +536,10 @@ static bool uniwill_readable_reg(struct device *dev, u= nsigned int reg) case EC_ADDR_LIGHTBAR_BAT_RED: case EC_ADDR_LIGHTBAR_BAT_GREEN: case EC_ADDR_LIGHTBAR_BAT_BLUE: + case EC_ADDR_CTGP_DB_CTRL: + case EC_ADDR_CTGP_DB_CTGP_OFFSET: + case EC_ADDR_CTGP_DB_TPP_OFFSET: + case EC_ADDR_CTGP_DB_DB_OFFSET: return true; default: return false; @@ -786,6 +795,68 @@ static ssize_t breathing_in_suspend_show(struct device= *dev, struct device_attri =20 static DEVICE_ATTR_RW(breathing_in_suspend); =20 +static ssize_t ctgp_offset_store(struct device *dev, struct device_attribu= te *attr, + const char *buf, size_t count) +{ + struct uniwill_data *data =3D dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret =3D kstrtouint(buf, 0, &value); + if (ret < 0) + return ret; + + ret =3D regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, value); + if (ret < 0) + return ret; + + return count; +} + +static ssize_t ctgp_offset_show(struct device *dev, struct device_attribut= e *attr, + char *buf) +{ + struct uniwill_data *data =3D dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret =3D regmap_read(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, &value); + if (ret < 0) + return ret; + + return sysfs_emit(buf, "%u\n", value); +} + +DEVICE_ATTR_RW(ctgp_offset); + +static int uniwill_nvidia_ctgp_init(struct uniwill_data *data) +{ + int ret; + + if (!(supported_features & UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL)) + return 0; + + ret =3D regmap_update_bits(data->regmap, EC_ADDR_CTGP_DB_CTRL, + CTGP_DB_GENERAL_ENABLE | CTGP_DB_DB_ENABLE | CTGP_DB_CTGP_ENABLE, + CTGP_DB_GENERAL_ENABLE | CTGP_DB_DB_ENABLE | CTGP_DB_CTGP_ENABLE); + if (ret < 0) + return ret; + + ret =3D regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, 0); + if (ret < 0) + return ret; + + ret =3D regmap_write(data->regmap, EC_ADDR_CTGP_DB_TPP_OFFSET, 255); + if (ret < 0) + return ret; + + ret =3D regmap_write(data->regmap, EC_ADDR_CTGP_DB_DB_OFFSET, 25); + if (ret < 0) + return ret; + + return 0; +} + static struct attribute *uniwill_attrs[] =3D { /* Keyboard-related */ &dev_attr_fn_lock_toggle_enable.attr, @@ -794,6 +865,8 @@ static struct attribute *uniwill_attrs[] =3D { /* Lightbar-related */ &dev_attr_rainbow_animation.attr, &dev_attr_breathing_in_suspend.attr, + /* Power-management-related */ + &dev_attr_ctgp_offset.attr, NULL }; =20 @@ -820,6 +893,11 @@ static umode_t uniwill_attr_is_visible(struct kobject = *kobj, struct attribute *a return attr->mode; } =20 + if (attr =3D=3D &dev_attr_ctgp_offset.attr) { + if (supported_features & UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL) + return attr->mode; + } + return 0; } =20 @@ -1371,6 +1449,10 @@ static int uniwill_probe(struct platform_device *pde= v) if (ret < 0) return ret; =20 + ret =3D uniwill_nvidia_ctgp_init(data); + if (ret < 0) + return ret; + return uniwill_input_init(data); } =20 @@ -1547,6 +1629,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO InfinityBook Pro 14/16 Gen7 Intel", @@ -1554,6 +1637,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book P= ro Gen 7", @@ -1561,6 +1645,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Boo= k Pro Gen 8", @@ -1575,6 +1660,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO InfinityBook Pro 16 Gen8 Intel", @@ -1582,6 +1668,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO InfinityBook Pro 14/15 Gen9 AMD", @@ -1694,6 +1781,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Polaris 15/17 Gen2 Intel", @@ -1701,6 +1789,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD", @@ -1708,6 +1797,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel", @@ -1715,6 +1805,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD", @@ -1722,6 +1813,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 15 Gen4 Intel", @@ -1729,6 +1821,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Polaris 15/17 Gen5 AMD", @@ -1736,6 +1829,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16 Gen5 AMD", @@ -1743,6 +1837,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5", @@ -1750,6 +1845,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris Slim 15 Gen6 AMD", @@ -1757,6 +1853,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 = Gen6", @@ -1764,6 +1861,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6", @@ -1771,6 +1869,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6", @@ -1778,6 +1877,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6", @@ -1785,6 +1885,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16 Gen7 AMD", @@ -1792,6 +1893,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16 Gen7 Intel", @@ -1799,6 +1901,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Stellaris 16 Gen7 Intel", @@ -1806,6 +1909,7 @@ static const struct dmi_system_id uniwill_dmi_table[]= __initconst =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, + .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO Pulse 14 Gen1 AMD", --=20 2.43.0 From nobody Tue Dec 2 02:51:09 2025 Received: from mail.tuxedocomputers.com (mail.tuxedocomputers.com [157.90.84.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F12132E143; Mon, 17 Nov 2025 13:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=157.90.84.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385949; cv=none; b=KX/LeJ0exd9h1zr4XCgl7A4nQrBoQTvd9JxVMmCPCxYmUKXamFRKA+6rIlORJj7o/Fo4c6PQAKMYUCrpVfZCtVQUBECqsbnpwNwzg1te215qiRRbpKgzQT6tYbN1t4KG1n3wqCV/cMCAsp3r34MuWcrqZHNksu4SeJTC79/yYhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385949; c=relaxed/simple; bh=VA6IzrnzKaW1sOf6uo321n1ATMa6MQjIiEXYF2PPnrw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LJx6mFoMU4HJzWpEVzzcOc3lzf1PDIvCMAM9DuATWC7I7+DH2GWdvxx3Hw5HId4DsW9PbvJMD2D34if7TS7eqA2cTp/a+6lh19QIbJsABpRm1NYiQL/8b5/vBf0P78u2oQYDR/TgemI3hJJEtdZk8QsZZWhL1E5W11+21BT05wM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com; spf=pass smtp.mailfrom=tuxedocomputers.com; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b=MYPHBzRk; arc=none smtp.client-ip=157.90.84.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b="MYPHBzRk" Received: from wse-pc.fritz.box (pd9e597c7.dip0.t-ipconnect.de [217.229.151.199]) (Authenticated sender: wse@tuxedocomputers.com) by mail.tuxedocomputers.com (Postfix) with ESMTPA id 0B4742FC0057; Mon, 17 Nov 2025 14:25:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxedocomputers.com; s=default; t=1763385940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1HSBul6bsO7EQvaMnplxoCk2jP8+9brQvKw2QvqzG0I=; b=MYPHBzRkBHVME2VH3GU+E9kgRTZ9an9RNlaOv5xOMUPOHh5T9au5NSsLfx4jvY55nC2VZK tsuBYdbNtqbextVBsTzllTL6QJ0KT2mtURAc9fc44MfS2DGYzSkwab4y3ws2Kltpdbomhk jVVG12itglGFYWyBoR2NyC96OeGZ6dI= Authentication-Results: mail.tuxedocomputers.com; auth=pass smtp.auth=wse@tuxedocomputers.com smtp.mailfrom=wse@tuxedocomputers.com From: Werner Sembach To: W_Armin@gmx.de, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Werner Sembach Subject: [PATCH 4/6] platform/x86/uniwill: Make uniwill_dmi_table accessible in probe Date: Mon, 17 Nov 2025 14:24:01 +0100 Message-ID: <20251117132530.32460-5-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117132530.32460-1-wse@tuxedocomputers.com> References: <20251117132530.32460-1-wse@tuxedocomputers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move uniwill_dmi_table up and remove __intconst to make it also accessible in the probe function. Signed-off-by: Werner Sembach --- drivers/platform/x86/uniwill/uniwill-acpi.c | 344 ++++++++++---------- 1 file changed, 172 insertions(+), 172 deletions(-) diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform= /x86/uniwill/uniwill-acpi.c index de3417d9d1ac0..9412783698685 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -1405,178 +1405,7 @@ static int uniwill_ec_init(struct uniwill_data *dat= a) return devm_add_action_or_reset(data->dev, uniwill_disable_manual_control= , data); } =20 -static int uniwill_probe(struct platform_device *pdev) -{ - struct uniwill_data *data; - struct regmap *regmap; - acpi_handle handle; - int ret; - - handle =3D ACPI_HANDLE(&pdev->dev); - if (!handle) - return -ENODEV; - - data =3D devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); - if (!data) - return -ENOMEM; - - data->dev =3D &pdev->dev; - data->handle =3D handle; - platform_set_drvdata(pdev, data); - - regmap =3D devm_regmap_init(&pdev->dev, &uniwill_ec_bus, data, &uniwill_e= c_config); - if (IS_ERR(regmap)) - return PTR_ERR(regmap); - - data->regmap =3D regmap; - ret =3D devm_mutex_init(&pdev->dev, &data->super_key_lock); - if (ret < 0) - return ret; - - ret =3D uniwill_ec_init(data); - if (ret < 0) - return ret; - - ret =3D uniwill_battery_init(data); - if (ret < 0) - return ret; - - ret =3D uniwill_led_init(data); - if (ret < 0) - return ret; - - ret =3D uniwill_hwmon_init(data); - if (ret < 0) - return ret; - - ret =3D uniwill_nvidia_ctgp_init(data); - if (ret < 0) - return ret; - - return uniwill_input_init(data); -} - -static void uniwill_shutdown(struct platform_device *pdev) -{ - struct uniwill_data *data =3D platform_get_drvdata(pdev); - - regmap_clear_bits(data->regmap, EC_ADDR_AP_OEM, ENABLE_MANUAL_CTRL); -} - -static int uniwill_suspend_keyboard(struct uniwill_data *data) -{ - if (!(supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) - return 0; - - /* - * The EC_ADDR_SWITCH_STATUS is marked as volatile, so we have to restore= it - * ourselves. - */ - return regmap_read(data->regmap, EC_ADDR_SWITCH_STATUS, &data->last_switc= h_status); -} - -static int uniwill_suspend_battery(struct uniwill_data *data) -{ - if (!(supported_features & UNIWILL_FEATURE_BATTERY)) - return 0; - - /* - * Save the current charge limit in order to restore it during resume. - * We cannot use the regmap code for that since this register needs to - * be declared as volatile due to CHARGE_CTRL_REACHED. - */ - return regmap_read(data->regmap, EC_ADDR_CHARGE_CTRL, &data->last_charge_= ctrl); -} - -static int uniwill_suspend(struct device *dev) -{ - struct uniwill_data *data =3D dev_get_drvdata(dev); - int ret; - - ret =3D uniwill_suspend_keyboard(data); - if (ret < 0) - return ret; - - ret =3D uniwill_suspend_battery(data); - if (ret < 0) - return ret; - - regcache_cache_only(data->regmap, true); - regcache_mark_dirty(data->regmap); - - return 0; -} - -static int uniwill_resume_keyboard(struct uniwill_data *data) -{ - unsigned int value; - int ret; - - if (!(supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) - return 0; - - ret =3D regmap_read(data->regmap, EC_ADDR_SWITCH_STATUS, &value); - if (ret < 0) - return ret; - - if ((data->last_switch_status & SUPER_KEY_LOCK_STATUS) =3D=3D (value & SU= PER_KEY_LOCK_STATUS)) - return 0; - - return regmap_write_bits(data->regmap, EC_ADDR_TRIGGER, TRIGGER_SUPER_KEY= _LOCK, - TRIGGER_SUPER_KEY_LOCK); -} - -static int uniwill_resume_battery(struct uniwill_data *data) -{ - if (!(supported_features & UNIWILL_FEATURE_BATTERY)) - return 0; - - return regmap_update_bits(data->regmap, EC_ADDR_CHARGE_CTRL, CHARGE_CTRL_= MASK, - data->last_charge_ctrl); -} - -static int uniwill_resume(struct device *dev) -{ - struct uniwill_data *data =3D dev_get_drvdata(dev); - int ret; - - regcache_cache_only(data->regmap, false); - - ret =3D regcache_sync(data->regmap); - if (ret < 0) - return ret; - - ret =3D uniwill_resume_keyboard(data); - if (ret < 0) - return ret; - - return uniwill_resume_battery(data); -} - -static DEFINE_SIMPLE_DEV_PM_OPS(uniwill_pm_ops, uniwill_suspend, uniwill_r= esume); - -/* - * We only use the DMI table for auoloading because the ACPI device itself - * does not guarantee that the underlying EC implementation is supported. - */ -static const struct acpi_device_id uniwill_id_table[] =3D { - { "INOU0000" }, - { }, -}; - -static struct platform_driver uniwill_driver =3D { - .driver =3D { - .name =3D DRIVER_NAME, - .dev_groups =3D uniwill_groups, - .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .acpi_match_table =3D uniwill_id_table, - .pm =3D pm_sleep_ptr(&uniwill_pm_ops), - }, - .probe =3D uniwill_probe, - .shutdown =3D uniwill_shutdown, -}; - -static const struct dmi_system_id uniwill_dmi_table[] __initconst =3D { +static const struct dmi_system_id uniwill_dmi_table[] =3D { { .ident =3D "XMG FUSION 15", .matches =3D { @@ -1936,6 +1765,177 @@ static const struct dmi_system_id uniwill_dmi_table= [] __initconst =3D { }; MODULE_DEVICE_TABLE(dmi, uniwill_dmi_table); =20 +static int uniwill_probe(struct platform_device *pdev) +{ + struct uniwill_data *data; + struct regmap *regmap; + acpi_handle handle; + int ret; + + handle =3D ACPI_HANDLE(&pdev->dev); + if (!handle) + return -ENODEV; + + data =3D devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->dev =3D &pdev->dev; + data->handle =3D handle; + platform_set_drvdata(pdev, data); + + regmap =3D devm_regmap_init(&pdev->dev, &uniwill_ec_bus, data, &uniwill_e= c_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + data->regmap =3D regmap; + ret =3D devm_mutex_init(&pdev->dev, &data->super_key_lock); + if (ret < 0) + return ret; + + ret =3D uniwill_ec_init(data); + if (ret < 0) + return ret; + + ret =3D uniwill_battery_init(data); + if (ret < 0) + return ret; + + ret =3D uniwill_led_init(data); + if (ret < 0) + return ret; + + ret =3D uniwill_hwmon_init(data); + if (ret < 0) + return ret; + + ret =3D uniwill_nvidia_ctgp_init(data); + if (ret < 0) + return ret; + + return uniwill_input_init(data); +} + +static void uniwill_shutdown(struct platform_device *pdev) +{ + struct uniwill_data *data =3D platform_get_drvdata(pdev); + + regmap_clear_bits(data->regmap, EC_ADDR_AP_OEM, ENABLE_MANUAL_CTRL); +} + +static int uniwill_suspend_keyboard(struct uniwill_data *data) +{ + if (!(supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) + return 0; + + /* + * The EC_ADDR_SWITCH_STATUS is marked as volatile, so we have to restore= it + * ourselves. + */ + return regmap_read(data->regmap, EC_ADDR_SWITCH_STATUS, &data->last_switc= h_status); +} + +static int uniwill_suspend_battery(struct uniwill_data *data) +{ + if (!(supported_features & UNIWILL_FEATURE_BATTERY)) + return 0; + + /* + * Save the current charge limit in order to restore it during resume. + * We cannot use the regmap code for that since this register needs to + * be declared as volatile due to CHARGE_CTRL_REACHED. + */ + return regmap_read(data->regmap, EC_ADDR_CHARGE_CTRL, &data->last_charge_= ctrl); +} + +static int uniwill_suspend(struct device *dev) +{ + struct uniwill_data *data =3D dev_get_drvdata(dev); + int ret; + + ret =3D uniwill_suspend_keyboard(data); + if (ret < 0) + return ret; + + ret =3D uniwill_suspend_battery(data); + if (ret < 0) + return ret; + + regcache_cache_only(data->regmap, true); + regcache_mark_dirty(data->regmap); + + return 0; +} + +static int uniwill_resume_keyboard(struct uniwill_data *data) +{ + unsigned int value; + int ret; + + if (!(supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) + return 0; + + ret =3D regmap_read(data->regmap, EC_ADDR_SWITCH_STATUS, &value); + if (ret < 0) + return ret; + + if ((data->last_switch_status & SUPER_KEY_LOCK_STATUS) =3D=3D (value & SU= PER_KEY_LOCK_STATUS)) + return 0; + + return regmap_write_bits(data->regmap, EC_ADDR_TRIGGER, TRIGGER_SUPER_KEY= _LOCK, + TRIGGER_SUPER_KEY_LOCK); +} + +static int uniwill_resume_battery(struct uniwill_data *data) +{ + if (!(supported_features & UNIWILL_FEATURE_BATTERY)) + return 0; + + return regmap_update_bits(data->regmap, EC_ADDR_CHARGE_CTRL, CHARGE_CTRL_= MASK, + data->last_charge_ctrl); +} + +static int uniwill_resume(struct device *dev) +{ + struct uniwill_data *data =3D dev_get_drvdata(dev); + int ret; + + regcache_cache_only(data->regmap, false); + + ret =3D regcache_sync(data->regmap); + if (ret < 0) + return ret; + + ret =3D uniwill_resume_keyboard(data); + if (ret < 0) + return ret; + + return uniwill_resume_battery(data); +} + +static DEFINE_SIMPLE_DEV_PM_OPS(uniwill_pm_ops, uniwill_suspend, uniwill_r= esume); + +/* + * We only use the DMI table for auoloading because the ACPI device itself + * does not guarantee that the underlying EC implementation is supported. + */ +static const struct acpi_device_id uniwill_id_table[] =3D { + { "INOU0000" }, + { }, +}; + +static struct platform_driver uniwill_driver =3D { + .driver =3D { + .name =3D DRIVER_NAME, + .dev_groups =3D uniwill_groups, + .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, + .acpi_match_table =3D uniwill_id_table, + .pm =3D pm_sleep_ptr(&uniwill_pm_ops), + }, + .probe =3D uniwill_probe, + .shutdown =3D uniwill_shutdown, +}; + static int __init uniwill_init(void) { const struct dmi_system_id *id; --=20 2.43.0 From nobody Tue Dec 2 02:51:09 2025 Received: from mail.tuxedocomputers.com (mail.tuxedocomputers.com [157.90.84.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FAF93321D6; Mon, 17 Nov 2025 13:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=157.90.84.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385951; cv=none; b=fgF9NoCdYdsmqYTrC+ffO/2sZU0D175GoZTspSNLPg2tXRgpXkjHt1KFPEjrSFKTUGlnRZ/NhsxUnNq4l6lw5WEnS2cUxhKcJvYI2IZ5VKIFb0nhjSmvTxO7B43Pz+z6ZLcFJ4MCMG8Nq9LZjp8D6rSg1kJMVmurn0TlnE1GvG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385951; c=relaxed/simple; bh=YmWX2Gi0OsxOFG7i+Ud/QlWldcMk2r3M6aKvlwYhBgQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I2F7yGd7ihXN8i9WK32AwPKMmASDhzE9quIiAwXu72Ohsm7JF1WNUxqv7LJiv+HzNiQlYDROftcwqMCrAmMk9vwO3xhbfxM8PZCOPjLF4JL08Eo2KQe4ATFR5jKgE031+E0I0U+MBt5G15yzXHrI7k0fSPO3rg54jSIiat2rXuM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com; spf=pass smtp.mailfrom=tuxedocomputers.com; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b=rG557jip; arc=none smtp.client-ip=157.90.84.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b="rG557jip" Received: from wse-pc.fritz.box (pd9e597c7.dip0.t-ipconnect.de [217.229.151.199]) (Authenticated sender: wse@tuxedocomputers.com) by mail.tuxedocomputers.com (Postfix) with ESMTPA id 890712FC005B; Mon, 17 Nov 2025 14:25:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxedocomputers.com; s=default; t=1763385940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=09+C2bipGhUKbdKW2J8ftQ4CfjOLsjOqY6OZWYEQ4Qs=; b=rG557jip08b5j0jOFo9Jgnr7dk2MmdN/KAJ4GX65/xD3UpdceWvd7fafyDYo9vbQy+5by3 yMW4jZ5xMYx8ZFQ2RA4JuPj7oa74tsdwzlENOWXF5GOoWGp0ldBgaqSZ4QwbGvEbvUcheX zFRORwkohM0RL5vng+NpzO3Ox8+6c0U= Authentication-Results: mail.tuxedocomputers.com; auth=pass smtp.auth=wse@tuxedocomputers.com smtp.mailfrom=wse@tuxedocomputers.com From: Werner Sembach To: W_Armin@gmx.de, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Werner Sembach Subject: [PATCH 5/6] platform/x86/uniwill: Run callbacks of uniwill_dmi_table Date: Mon, 17 Nov 2025 14:24:02 +0100 Message-ID: <20251117132530.32460-6-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117132530.32460-1-wse@tuxedocomputers.com> References: <20251117132530.32460-1-wse@tuxedocomputers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The dmi_system_id uniwill_dmi_table[] has a callback field. This patch calls these callbacks with EC read/write access. It also moves the supported_features assignment further back into the code. This enables the callbacks to dynamically determine supported_features flags based on EC readouts. Signed-off-by: Werner Sembach --- drivers/platform/x86/uniwill/uniwill-acpi.c | 29 ++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform= /x86/uniwill/uniwill-acpi.c index 9412783698685..15a94c256f728 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -335,6 +335,7 @@ struct uniwill_data { struct mutex input_lock; /* Protects input sequence during notify */ struct input_dev *input_device; struct notifier_block nb; + struct dmi_system_id id; }; =20 struct uniwill_battery_entry { @@ -1767,6 +1768,7 @@ MODULE_DEVICE_TABLE(dmi, uniwill_dmi_table); =20 static int uniwill_probe(struct platform_device *pdev) { + const struct dmi_system_id *id; struct uniwill_data *data; struct regmap *regmap; acpi_handle handle; @@ -1788,6 +1790,19 @@ static int uniwill_probe(struct platform_device *pde= v) if (IS_ERR(regmap)) return PTR_ERR(regmap); =20 + if (force) { + /* Assume that the device supports all features */ + supported_features =3D UINT_MAX; + pr_warn("Loading on a potentially unsupported device\n"); + } else { + /* Match is guaranteed, otherwise init would have aborted */ + id =3D dmi_first_match(uniwill_dmi_table); + memcpy(&data->id, id, sizeof(data->id)); + if (data->id.callback) + data->id.callback(&data->id); + supported_features =3D (uintptr_t)data->id.driver_data; + } + data->regmap =3D regmap; ret =3D devm_mutex_init(&pdev->dev, &data->super_key_lock); if (ret < 0) @@ -1938,20 +1953,10 @@ static struct platform_driver uniwill_driver =3D { =20 static int __init uniwill_init(void) { - const struct dmi_system_id *id; int ret; =20 - id =3D dmi_first_match(uniwill_dmi_table); - if (!id) { - if (!force) - return -ENODEV; - - /* Assume that the device supports all features */ - supported_features =3D UINT_MAX; - pr_warn("Loading on a potentially unsupported device\n"); - } else { - supported_features =3D (uintptr_t)id->driver_data; - } + if (!dmi_first_match(uniwill_dmi_table) && !force) + return -ENODEV; =20 ret =3D platform_driver_register(&uniwill_driver); if (ret < 0) --=20 2.43.0 From nobody Tue Dec 2 02:51:09 2025 Received: from mail.tuxedocomputers.com (mail.tuxedocomputers.com [157.90.84.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC1293328F2; Mon, 17 Nov 2025 13:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=157.90.84.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385951; cv=none; b=rHybAgs4RDDOujByaslqmJhi8TwOzEsHx0P+dzU1mJcGw3o5MVq6qSQssVEj0QLn2CTERjZoEbB27ckqW8Ee8O3+Ry73u54bWzbQiz1tyqfwJSkhC69M9whL49lFvlNXp05mw86pjw65t4L+CbgZMd2WXrt6DO6wtWcQdq/dtik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763385951; c=relaxed/simple; bh=Bdt0IJ6GEEdDiqtpNpi4fK/5Aim/c3WyMcOKp4lt9Rc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ClGsu4MxKa62Dkt93YZ/EmzukTMDWgWpAY3F8bqgFUcWvjQIZVvt3e5oyE+XRP2cihArCTqdZXj9reBLtrGg/yVp2EPQdDQLlJQKkymr2M4izGCjsFz60YLkwz66IlosdTce2JX9wHFXOvAev3GQcKHBWaidFBvhhOHc6RpmOYQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com; spf=pass smtp.mailfrom=tuxedocomputers.com; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b=LeDMzBpP; arc=none smtp.client-ip=157.90.84.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxedocomputers.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tuxedocomputers.com header.i=@tuxedocomputers.com header.b="LeDMzBpP" Received: from wse-pc.fritz.box (pd9e597c7.dip0.t-ipconnect.de [217.229.151.199]) (Authenticated sender: wse@tuxedocomputers.com) by mail.tuxedocomputers.com (Postfix) with ESMTPA id 1949E2FC005D; Mon, 17 Nov 2025 14:25:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxedocomputers.com; s=default; t=1763385941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6LxhFjiKunbhiTXLOed3Qvlv9XVkd1JWfBr4qSjK2eg=; b=LeDMzBpPMui/bskTjZM38waAenArLqWn5KrLn2Ddg+f20lyg9QtjLJXCHCfqocklfs8KdF J5f7r8S5wdgBi2V75L2qhCtuw0Q4NSC6Ypt0ycSHKLMO0sG2soeIRdJt0eeZ0N01xOcMOL wgBeJ1Pp0OQA9UhFgD23cYX6/Qwu+aU= Authentication-Results: mail.tuxedocomputers.com; auth=pass smtp.auth=wse@tuxedocomputers.com smtp.mailfrom=wse@tuxedocomputers.com From: Werner Sembach To: W_Armin@gmx.de, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Werner Sembach Subject: [PATCH 6/6] platform/x86/uniwill: Set cTGP support based on EC for TUXEDO IBP Gen7 MK1 Date: Mon, 17 Nov 2025 14:24:03 +0100 Message-ID: <20251117132530.32460-7-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117132530.32460-1-wse@tuxedocomputers.com> References: <20251117132530.32460-1-wse@tuxedocomputers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The TUXEDO InfinityBook 14 Gen7 shares a boardname between the variant with and without an NVIDIA GPU. Dynamically read which variant is present from EC to determine cTGP support. Signed-off-by: Werner Sembach --- drivers/platform/x86/uniwill/uniwill-acpi.c | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform= /x86/uniwill/uniwill-acpi.c index 15a94c256f728..f6b24d2c28b89 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -88,6 +88,9 @@ =20 #define EC_ADDR_GPU_TEMP 0x044F =20 +#define EC_ADDR_SYSTEM_ID 0x0456 +#define HAS_GPU BIT(7) + #define EC_ADDR_MAIN_FAN_RPM_1 0x0464 =20 #define EC_ADDR_MAIN_FAN_RPM_2 0x0465 @@ -1406,6 +1409,23 @@ static int uniwill_ec_init(struct uniwill_data *data) return devm_add_action_or_reset(data->dev, uniwill_disable_manual_control= , data); } =20 +static int quirk_ibp_gen7_ctgp_supported(const struct dmi_system_id *d) +{ + struct uniwill_data *data =3D container_of(d, struct uniwill_data, id); + unsigned int value; + int ret; + + ret =3D regmap_read(data->regmap, EC_ADDR_SYSTEM_ID, &value); + if (ret < 0) + return ret; + if (value & HAS_GPU) { + data->id.driver_data =3D + (void *)((unsigned long)data->id.driver_data | + UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL); + } + return 0; +} + static const struct dmi_system_id uniwill_dmi_table[] =3D { { .ident =3D "XMG FUSION 15", @@ -1462,12 +1482,12 @@ static const struct dmi_system_id uniwill_dmi_table= [] =3D { .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { + .callback =3D quirk_ibp_gen7_ctgp_supported, .ident =3D "TUXEDO InfinityBook Pro 14/16 Gen7 Intel", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, - .driver_data =3D (void *)(UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL), }, { .ident =3D "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book P= ro Gen 7", --=20 2.43.0