From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.8 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796201039; b=vUoq0pUnm7PHJ1dFOx4scm8H0U38pwM7GsQCFUZTWuGvvs4p+h24MB8EKVFc6Hu5lcwv JV8Inzh/DOAiLXR/jzAdUZ6z0beUa4r2+WAttPrhUBmnKWpYFDroRaydEHtROrwl0BltY QQh119vjn9Lmm9hbf4qA0dQe1NcL+XEBAuw1ebeaKpNbJOAfxZaSnhI3QDgxE2On7bavB qexz/qBLENFwrSUptDKJ0MZFTddokD0/aWjqYnOD6zXZXXm8XTRdAjnqa6uc8fu/OH3rY wxSZYBFjeymAbEx2ZG59C5ILwuPeH61twQY+tRCyuHc1M1x6F4NHzAAhA9auBU3iSbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796201039; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=gafuUfRF1YuUsTK0NgUoEk/rbd5ys+msNgHZELamNro=; b=PuwxrJg9WB4EsEhvEl4AUVrKHkfV+aUSRlW2+v/bSoYf4ngJQIXtlWE6Kp7K4EIpavyv MZQdwt5xa9OTXlJDw12zB4/D59gASqRO82/cgl9smEPFqkceNpCaFJFB13alkRcK9aRBW w9XQo5OLTKhNP+1MH1dAUlNT+ak2ewRTfN/3+XIUikhDH8C1F50KX7oZX+OPekdtu8qBx 0Ies3V0dvzAzk+tBYg2eg5pWkyXmB3BK3wli1WTxCD+3L+KVr362Cc+KnyYhTWNaON+eP 6b1xEFpHC7cc7a+mquhVmjqHk2dwaznu9JVyNuqxv48Imnu5hwlkVT2MScV0UbEycGw== 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=Zqj2A5Oo; arc=none smtp.remote-ip=74.125.229.8 Received: from mail-dy2-f8.google.com (mail-dy2-f8.google.com [74.125.229.8]) (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 3F556606A322 for ; Wed, 2 Dec 2026 08:43:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3F556606A322 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=Zqj2A5Oo Received: by mail-dy2-f8.google.com with SMTP id 5a478bee46e88-36a6ce64b95so4395362eec.1 for ; Wed, 02 Dec 2026 00:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796201038; x=1796805838; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=gafuUfRF1YuUsTK0NgUoEk/rbd5ys+msNgHZELamNro=; b=Zqj2A5OoYmCcf8P3UAspljzgTskf6HHIx3yvU7bm1brqmfNjA6bALO8eIcZcbRAdMo mgcGnnRyUHf5/YKO6lBIypdGTb6iVyPW3y9Y9Q3Gwo+m9OGaROy7MTPLmwJ3u3l1IL34 PCGzgBfF1DTn6+KmlIvlvAJeKybPbgRLUkU7/b7apLcXRaLRzzL0N92ZVQrhCBv/ScwF 9ZVd026Ogtf8UdqH/vuNX/qRVU31AjwPbmIewx7N0OBz17rDjL+xiQluXs4v42Q7uwvq QM8osI8TAmy2px5zIvBCrpB7CjA+FJgk5pG/RQnz+yQ1Y4Lqi3KJvzZlphcigXWx1v1B njbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796201038; x=1796805838; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=gafuUfRF1YuUsTK0NgUoEk/rbd5ys+msNgHZELamNro=; b=U14uFqkiTOewx+mRPtE1Rc0D7HeRa5Ut9KUNjejNI04/uEL6+jnu83B5mGe+XZVJgm v8wurMkDPr1+z0yYbrt2Pxs2ej5nqppbvdh/fdIYXadjBp19zJvwY9aFfypJUvh9lE/E kcDaRO6vBENpJnBZSgfN0+NOylQO6/Vc0V2YOvkoxQAr6DyPQGyz2YZNJZj4j6tFGMAT Mf2EG8mruQGDXFUIZU8HXU9AzCIs4krnQr+NT4kF1Edtpeb9E7NSMaK7VNp3BgTZEgrv qLJmsmD1XNUlkFLggapAiTOYnDzpnH+of+z8KZ8FNKSu26pT1uVKMDB6XPT2sxPCv6xo pf4g== X-Forwarded-Encrypted: i=1; AL+hErEU7BCBy0+eKT7vfdBgQkTi9eoBnb/QUthe8DcVma6aGeUze0gvLk4KX0ZehBMEFAwN8/mPlvceSwB8pDY=@vger.kernel.org X-Gm-Message-State: APuU4Z/n5BK39AqzXoNPkxIznR8ZPRnxiMFUoQ9H016/ZZSZPCdUOag+ F0hY1CpVzbUBKYqbX5iHvF90mu8iUBXjrZ9R9r/tycPf+pgfxJ4/YZI8 X-Gm-Gg: AZFdTZcqqBIadBKY+VLWFOogs3FZH2M+NvpAtlgYZqMz5rBaHxwUtdyU2yKYl2J7RiZ bUNu7BRn5jyyFkVqVCM7kYds2fpHcdt8Yhsfo5tq6Ceia//umvFUo/V4n/BawQwgs/1eH2DeGO9 ZDCN2S/Iqd3HdaEzqcZ4OCFD+PHaehMDSov8PSGJNfdV/kui2IE067Gk4p7cCvyTHG76SzJ1I5Y b4mx2V/VQ0lWvCu8+SOHtKpiluWXuebRDjqsbxtdBEOWyxuvU/VLOGrmFmMmERPV5VioSAAetJy 7jozSjEhoH/N/qCze1mH3FTNUxMq9WdoVmWuYcQ32zppMiwsiLY7yFYvLfuzvgJjPZWy3nNpl4n h1+aeeNJopeUyzYxOVhKe0/X928xOyOq+fGlqTu7Ck2lxFMdh8Hb3rWWR4xYlcqppi5DFNXpPNr fHE3hlywlNU90RuxlQQQ7gPAz6Sqe5osnUMNZAaPizo6/2yYIvfsLAjNep+FnMvpYPiNUzYoo7a jakY+tpAn5QVdnEEvHXs2QxHsnyreganVUaJHHihZENRnxx2goH6YGBpFo0iG3Uv4QLuGxEv3Hx 1xiwp3wZCx+xC+EJ9DEunwiSRNQ= X-Received: by 2002:a05:7300:c00d:10b0:386:fb5e:f660 with SMTP id 5a478bee46e88-386fb5ef7e8mr14125307eec.40.1796201038261; Wed, 02 Dec 2026 00:43:58 -0800 (PST) Received: from ThinkPad ([192.220.23.71]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386aaae4960sm81177935eec.18.2026.12.02.00.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 00:43:57 -0800 (PST) Date: Wed, 2 Dec 2026 16:43:40 +0800 From: Qiling Zhu To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Mark Pearson , "Derek J. Clark" , Rong Zhang , 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 Subject: Re: [PATCH v5 5/6] platform/x86: thinkpad_acpi: Detect auto-mode capability via MLCG Message-ID: References: <20261130131252.80436-1-kmatzkaczor244@gmail.com> <20261130131252.80436-6-kmatzkaczor244@gmail.com> <1992233b-7204-65c2-191b-ae3c47eda227@linux.intel.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-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1992233b-7204-65c2-191b-ae3c47eda227@linux.intel.com> Hi Ilpo, On Tue, Dec 01, 2026 at 03:04:31PM +0200, Ilpo Järvinen wrote: > On Mon, 30 Nov 2026, Qiling Zhu wrote: > > > 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..c81f36775 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 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 & BIT(TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT)); > > Why the BIT() isn't in the define? 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: /* MLCG bit that indicates whether the EC supports the auto mode */ #define TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT BIT(20) ... tp_features.kbdlight_auto = !!(status & TPACPI_KBD_LIGHT_AUTO_CAPABLE_BIT); 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. 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. Regards, Qiling