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=165.173.182.112 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796212853; b=zSQgSWmqfmDqhruLrPgXlEIyXMQrLsMWmAaxBviyyB+FANdWFb3bIz0sKaaf1aVmk0rO 05dIPCYzgyQos66A9WNz+BIEf1oNfRTUDj8Pl949MUMADDQL3UcUD8LLquyc25yX86/na U8+Rr+qwV+fSPFAl0vAeK4zNKWLrkLBSpbVgtfxpFptBQwxcrl0wF9xgy6I9Z6xU/NgO+ s59F4JJ5RoLJCfDkCrr3DZFGkrDCt2tHxYm6Ck62fOdda08js5Bdq+AYaZnDCX2D+jWHP G8F6VLnOCI8cf8VkcZK24BoD+Zf4/qFAqG80iQ7CHBVO7KnMwOIFJpUtKnJONT/wTpA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796212853; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Subject:From:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date: MIME-Version:User-Agent:X-ZohoMailClient; bh=7bdktuM+k4yjSXl8l5TbKkij/s6MJcCzboDGR6KkGeA=; b=1aWPYPsn3N5BVGZvBRiFS8blPl53rwB37WcrrulqF9CRB/AN8bSvgmAUlVEbAdgZd5gm KLk8HD5omRvtD4TvSsbTA429jxfw475SLDG4rVmyvBXL/Q/sFTXDZLldUKTvDwznM/fcM 8D3JpB7tQ84DY4CCcyANMFvfkR8SUpSaBnGdW5uros9ym4NAoxOUxCupY2bJf0/FVQT5M ziIpl3JJoLGj9PxJGuq/APPRi3Sa/LjGQEAvPepWWhhkIyvYTdmMH0c4aC4PxBIDuNvDi 9NYllw4sp2+3o/wZ4tblGc0Pq7HifxZEYJgvbTe5crMn019TQUIA0HqnOSC8nSZ5SyQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass header.d=rong.moe header.i=@rong.moe header.a=rsa-sha256 header.s=zmail2048 header.b=R88w3yzu; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.112 Received: from sender5-pp-f112.zoho.com (sender5-pp-f112.zoho.com [165.173.182.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3A07606A31A; Wed, 2 Dec 2026 12:00:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3A07606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=rong.moe header.i=@rong.moe header.a=rsa-sha256 header.s=zmail2048 header.b=R88w3yzu ARC-Seal: i=1; a=rsa-sha256; t=1796212797; cv=none; d=zohomail.com; s=zohoarc; b=PxNygmon+O/bTsqCPWcv9jSP4sEKajc4wxgrlyLG9/1SffJVSxGQQpnmksCPeXndFWG0NZHmNXu2SSfg4MSrFz4YGC16EBH57pohxp3xTzNpt5HSOCdlDLSPFoch/EQ7Vw0Iaz/fJ6WkxJXfAp4rmpvT1rMNQJEjBBuyw/ShhO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796212797; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=7bdktuM+k4yjSXl8l5TbKkij/s6MJcCzboDGR6KkGeA=; b=QtMBc6KrHyEfh6xT48dJYxe7mfxp3hU/ZfJnmRrELneVW/fdlc3Q29OtYs9v/cBCC/XeesvMJCP+ZGFBi2bHtRTwSNvsDMx2heDyZO5cfhyPFFnbQI1rSqJFMtJbzv+KyimYSsbfd+qBqwhhlzvCXyYS3gyvhd7KcnlKrr1Yibo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=R88w3yzuLDxR1CDNh/kDz8cPDVIt1yiYZ2ssfDwUbe44maDOJ8SL1zRChfnO/+OxHtC2PFNbFOKjILyqjdGOrjZ48ly6cSIxhZq80V3XCurEoUEDZoqB0tuZIXVKGw7bHNuHe3WZwfP6yt1tP1NyXWypkk5d0FfVniTObtCxGY3pOlWrii92rZFQOJjzMqLiBDQoEMAfFX6YtTBGx8ort7Sbk9dihrMeXG6MdT+jqtQAruR3KaUOnJAu84GPDomaDGnBwqkCzOSrYsf9Xy3fwQZ7w80PkuWVvmBCNXdigAl+3A1zQ2+yDDz4qcHzdl4D52NTTpry6WCHqZeJpSdX1A==; c=relaxed/relaxed; s=zmail2048; d=rong.moe; v=1; bh=7bdktuM+k4yjSXl8l5TbKkij/s6MJcCzboDGR6KkGeA=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796212793933280.60079321379203; Wed, 2 Dec 2026 03:59:53 -0800 (PST) Message-ID: <455b66e3f1297bef62ad83de69bfb8496750abc3.camel@rong.moe> Subject: Re: [PATCH v5 5/6] platform/x86: thinkpad_acpi: Detect auto-mode capability via MLCG From: Rong Zhang To: Qiling Zhu , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: Mark Pearson , "Derek J. Clark" , Hans de Goede , Henrique de Moraes Holschuh , platform-driver-x86@vger.kernel.org, LKML , 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 In-Reply-To: References: <20261130131252.80436-1-kmatzkaczor244@gmail.com> <20261130131252.80436-6-kmatzkaczor244@gmail.com> <1992233b-7204-65c2-191b-ae3c47eda227@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 19:54:48 +0800 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 User-Agent: Evolution 3.62.1-4 X-ZohoMailClient: External Hi Qiling, On Wed, 2026-12-02 at 16:43 +0800, Qiling Zhu wrote: > Hi Ilpo, >=20 > On Tue, Dec 01, 2026 at 03:04:31PM +0200, Ilpo J=C3=A4rvinen wrote: > > On Mon, 30 Nov 2026, Qiling Zhu wrote: > >=20 > > > MLCG bit 20 indicates whether the EC supports the auto mode of the > > > keyboard backlight (0 =3D manual levels only, 1 =3D auto mode availab= le), as > > > defined by the firmware. > > >=20 > > > Record it in tp_features.kbdlight_auto, for use when registering the > > > auto-mode trigger in a subsequent change. > > >=20 > > > Link: https://lore.kernel.org/r/CABxCQKuEP5wMSstO0MK1MhaqXTKrPhUSN3V2= mrE_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(+) > > >=20 > > > diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/pl= atform/x86/lenovo/thinkpad_acpi.c > > > index 764b1efa6..c81f36775 100644 > > > --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c > > > +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c > > > @@ -363,6 +363,7 @@ static struct { > > > =09=09TP_HOTKEY_TABLET_USES_GMMS, > > > =09} hotkey_tablet; > > > =09u32 kbdlight:1; > > > +=09u32 kbdlight_auto:1; > > > =09u32 light:1; > > > =09u32 light_status:1; > > > =09u32 bright_acpimode:1; > > > @@ -5105,6 +5106,9 @@ static struct ibm_struct video_driver_data =3D = { > > > /* EC level that selects the auto mode for the keyboard backlight */ > > > #define TPACPI_KBD_LIGHT_AUTO_LEVEL 3 > > > =20 > > > +/* MLCG bit that indicates whether the EC supports the auto mode */ > > > +#define TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT 20 > > > + > > > /* > > > * Cached EC level, including TPACPI_KBD_LIGHT_AUTO_LEVEL. All stat= e > > > * tracking compares EC levels; the auto mode is translated to a > > > @@ -5189,6 +5193,9 @@ static bool kbdlight_is_supported(void) > > > =09} > > > =20 > > > =09vdbg_printk(TPACPI_DBG_INIT, "kbdlight MLCG returned 0x%x\n", sta= tus); > > > + > > > +=09tp_features.kbdlight_auto =3D !!(status & BIT(TPACPI_KBD_LIGHT_AU= TO_CAPABLE_BIT)); > >=20 > > Why the BIT() isn't in the define? >=20 > I kept it as a plain number to match TPACPI_KBD_LIGHT_AUTO_LEVEL right > above it, so that both constants read as integers, but I see the point > of having the define carry the mask. Happy to change it; the result > would be: >=20 > /* MLCG bit that indicates whether the EC supports the auto mode */ > #define TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT BIT(20) >=20 > ... >=20 > =09tp_features.kbdlight_auto =3D !!(status & TPACPI_KBD_LIGHT_AUTO_CAPA= BLE_BIT); >=20 > I left the name as it is, following DPRC_WWAN_ANTENNA_TYPE_A_BIT and > USCS_CAP_BIT elsewhere in the file, whose values are masks too. If you > would rather see a different name, that is easy to do. Yeah, I agree that defining a BIT() will be neater. >=20 > My plan is to wait another week or two for further comments and then > send the next version with everything together. If that timing does > not suit you, just say so and I will go with whatever timing works > best for you. If you've collected enough reviews you can respin the series slightly more frequently. It's also OK to wait another week given the timing in this cycle. Thanks, Rong >=20 > Regards, > Qiling