From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.137 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796300055; b=pouq7MnzWzbG0XnI/mWCBtZYiFhEU+Vdg4fAfebqtfOZHg1eozzrx8RJOpcBiq3R4JtJ W0Pc4YikEUX4C3veM65T095PUaEcIMr12tbDpZlf2VujiB/9u1JQhDtMSG/zfoUJvRSON LfhHAvTUtxA4wH0XnOutO0gp1yElDaCM1zo9pidjh2ja7eMZSOnRqk//V+pU+OZnvpnE1 1L9IvX2Jya5ujSDfY4/Gf6n+AcUGaNmvsFGMgO4hPSbUNDt8f06OMzFU+2t/SPUmCOXDz oliHIJI4L9rHCfJaFXp5p1x+mhbzRG6/iYg+idYGDfMHIjGrem3yEUZAefYGM2L/aZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796300055; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=Xfd9Gr1joJd0xe37dIhalAr/HWlJM3IFC96zY2Afx0c=; b=mlXsQPeOiWfXRDMqeOKkCeZy7LMZvqZFmTnDnOoMbDcl/US51B/V9fgbD60p2d7fA8rm H+4+ZGi3kORxQkVspciEFCzHQvYVAXz2JSqWIcVDzfU8tlfUOrPMzRQ0aUQVwZ3sQQOeK T2Am4zVV5tI4C7Z5qHn5V1ncwQZ6aBVy8Fjins9+D4n79CLb9Wv046Rm29jOjaOMzldiE rLlgxvL4dLxfOBoIoLFkEustYTA0E3oro9NIApI68mH61L6IE0n0cqyaZmRCxxsB8CWPL STQ+lnOO8kZSzPo3o52CWc37IDItHgopwVrVTIOaHDWsEPM45fwnMZEmnfjP0eYsveQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=H7susgoQ; arc=none smtp.remote-ip=74.125.229.137 Received: from mail-dl2-f9.google.com (mail-dl2-f9.google.com [74.125.229.137]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7030F606BEB6 for ; Thu, 3 Dec 2026 12:14:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7030F606BEB6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=H7susgoQ Received: by mail-dl2-f9.google.com with SMTP id a92af1059eb24-1397ad3d891so2715258c88.0 for ; Thu, 03 Dec 2026 04:14:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796300047; x=1796904847; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Xfd9Gr1joJd0xe37dIhalAr/HWlJM3IFC96zY2Afx0c=; b=H7susgoQxxsoK+5r08RW8eT0cONaSD9zT3GjACwARD38rwF5eRV+l//tW9DSpx+Wxu 9PU7HavplADoBCToh6j0ZOnuFcmp3WJxhAQzWzZAhpD22cCnDkR/44d2oaECot5PTe0k f6aUCpdoPP8SSSDpvFi314VGk+fL1CH/oZE1l0NNHYyNTLrEqLm4dkCAluCb4sRTef11 cVIO8GPTZ+mr7ELSGl9NzCUsPllP9alWczmjlu2D8QWV4/hqM/0EYhY5OfTkKDSme1IW q6XJ1PMCIo0XpO4iabd9LyZ8f3/omZKgGHqEomey0bOu2m912F6w6Cit33L6twepxqzf hHaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796300047; x=1796904847; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Xfd9Gr1joJd0xe37dIhalAr/HWlJM3IFC96zY2Afx0c=; b=pkhjMUCuAOrQ+rR0ATLE4+4AYoSDN+LX6q52GH4TKgCsDR+lLwixIIgdM0c06XqIaL GWZp1k0aayl/27WDB+yxZHTlLmf2Y8BITp/6SZgBcdFi6frucewOZzgfV/F9JbHUyDrA FE844KK9JIRiX18ZgZm6T6yVuDAXZZDCLe8mPlQ0GLtvRgpH9TdHgzzeCxYpDJgRI4ZI HXRY159bP1PiywqDFWG/KnE6mdRYj4GM7+oJiJvpBBvMt4YYnTOwsyIpwtFCfVWhcNYa BJeI0M+lj1XbIATnd8aETKv071SO3ZdRcSzFCuJOhlAz6Rb3MJEyW48fXaPsGfZcSsYF wN+g== X-Forwarded-Encrypted: i=1; AL+hErHjEF263uG67VqTZ7JFq9le2q8GAO3rdgbTtrAmootoEpvegWo+OI2KB/UKZDEVuloSdnl291vpXLq3a6c=@vger.kernel.org X-Gm-Message-State: APuU4Z9Gzc/lZj8BA8B6FtOE7l5fGhmueGy+XwSk3ef7wrfixA5SRZCm wQLt6hnm4S1ErKMQ/5UW9A0Syqt7x9pp6XkPgRp4Bbz7QsHQpCR0cpW1 X-Gm-Gg: AZFdTZe+nUsJYWgcyVwr+YPLsh07ptWhzlncFy46P0qm811sldxqiro1Fvy6sZH+l2k H3PO0j4Jh1MnAV3qrzXhvqcDVqLHllpSXfX1wiQbX5wnK9246+zn+V86V6Acuv9eMAc91ILKg96 cY/mUki29ZmQqycqzfJRLzP+laOPeyMA/NQl77UD6XDl1shh2FqodZT64JXCtv5C6T5OvIGYTqq QqqmqhTefwV/FtCjNPPiPqMd/6muDnNHmiolnRDyH9EcwhhqxGxvjxxf06GgWEVHGJ9P8oFgRki AeiriQm3OhxS481YwodEU3rT1rhxhnc2nbEZsxELP5jI6kPDP5lTn29xQNAiEOUbqjn2+vYFrJ7 Xz63FvOtbjnEWfFmjR9INM1VITKsDRcngKAkShL3pdsZAoem92cYMZhjew14oKKSDD04tRddFlL uuNrwzI+eilKM6TAV+xWNs7nYct7KtWteIQnqQsgjvTXVgaC2/JL5Di1wTaZ/gMXCjvhgQtgOqH b0tAAeCipGQUS8tTrwnAV5ZpCsBEExihRFkabxuWOGFtvW9/Votv8Axj4+3FZMyMIW8GSXhp1si Ye98gRSoYA54j0GlA0OfBktVnDVqWA== X-Received: by 2002:a05:7022:3c07:b0:1b5:514:6a23 with SMTP id a92af1059eb24-1b55689e9b5mr35845528c88.13.1796300046484; Thu, 03 Dec 2026 04:14:06 -0800 (PST) Received: from ThinkPad ([192.220.23.71]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b556840494sm101600588c88.12.2026.12.03.04.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 04:14:06 -0800 (PST) From: Qiling Zhu To: Mark Pearson , "Derek J. Clark" , Rong Zhang , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Henrique de Moraes Holschuh Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Lee Jones , Pavel Machek , Griffin Kroah-Hartman , linux-leds@vger.kernel.org, vishnuocv@gmail.com, vsankar@lenovo.com, Andrea Rabbaglietti Subject: [PATCH v6 5/6] platform/x86: thinkpad_acpi: Detect auto-mode capability via MLCG Date: Thu, 3 Dec 2026 20:07:03 +0800 Message-ID: <20261203120704.41431-6-kmatzkaczor244@gmail.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261203120704.41431-1-kmatzkaczor244@gmail.com> References: <20261203120704.41431-1-kmatzkaczor244@gmail.com> 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 Content-Transfer-Encoding: 8bit MLCG bit 20 indicates whether the EC supports the auto mode of the keyboard backlight (0 = manual levels only, 1 = auto mode available), as defined by the firmware. Record it in tp_features.kbdlight_auto, for use when registering the auto-mode trigger in a subsequent change. Link: https://lore.kernel.org/r/CABxCQKuEP5wMSstO0MK1MhaqXTKrPhUSN3V2mrE_42j4cXsXZQ@mail.gmail.com Signed-off-by: Qiling Zhu Reviewed-by: Rong Zhang Reviewed-by: Mark Pearson --- drivers/platform/x86/lenovo/thinkpad_acpi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c index 764b1efa6..8f73f87e9 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -363,6 +363,7 @@ static struct { TP_HOTKEY_TABLET_USES_GMMS, } hotkey_tablet; u32 kbdlight:1; + u32 kbdlight_auto:1; u32 light:1; u32 light_status:1; u32 bright_acpimode:1; @@ -5105,6 +5106,9 @@ static struct ibm_struct video_driver_data = { /* EC level that selects the auto mode for the keyboard backlight */ #define TPACPI_KBD_LIGHT_AUTO_LEVEL 3 +/* MLCG bit that indicates whether the EC supports the auto mode */ +#define TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT BIT(20) + /* * Cached EC level, including TPACPI_KBD_LIGHT_AUTO_LEVEL. All state * tracking compares EC levels; the auto mode is translated to a @@ -5189,6 +5193,9 @@ static bool kbdlight_is_supported(void) } vdbg_printk(TPACPI_DBG_INIT, "kbdlight MLCG returned 0x%x\n", status); + + tp_features.kbdlight_auto = !!(status & TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT); + /* * Guessed test for keyboard backlight: * -- 2.56.1