From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796201040; b=JxrT7nUslLb5+ruQLLvDJtCUkzP9AYubIZrmGF0F8sEvgbAiZ9dqXawZeCXVaDhIfUl/ 0EKr5wQ1jlUMgxQ9rmWMRcmMsd4k4XexmHJV0PXIWQs1E3katXxVfbLsvXi1YYMslOV5y gvYc61BlVJAcL3OYL5WM4wMKfIoD+xX+5BIIeaOYBSxgEn7AsHETWhlbqhMud8ygOl5cC qg2TVwXkpwwT3fpRs4ZdeOT9Qw1IQGfw3FoH9Xv41O+2yl6LpYJt68XqtbRQOU0IWLPJI Dd6srJcoGBHPF4n1jhM0jnSsyDSqgHo5m1/KybJhoSabunE8heVjYHXpnXsiULxr5nw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796201040; 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=t3+qH+x9SYNKr9NxhJefZMvEu7FLwq0NSdqscBdmC3ISFszC4vfnzK9XHLU6lVdu8FiO yLYbpItt3YsoDPePm0//hzljOKKQ5OzPR4m73nzvLrme/DH9t1ZqgA+hz5vV6Dl+YJK2p WHvclsjEzNx5eH1HaT7HAHCa94QQPCDPSjxIMSAZQq6wioStwhWJy+HxSOM3qxmCCyr3h VhC4mIhNjZyDBTKguw2HmazWzltOMnO3JWvlmxZ8lWAKtmDRTfknz6t+Ill8IU1DwB2xz emlZ9XMZUWMovhWWvALzQ07uHzIvAZBsD7uq8HpokYNKEf+SxXpPyGFjuIPgX2vwjPA== 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.4 Received: from mail-dy2-f4.google.com (mail-dy2-f4.google.com [74.125.229.4]) (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 48195606A323 for ; Wed, 2 Dec 2026 08:43:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48195606A323 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-f4.google.com with SMTP id 5a478bee46e88-387362aa672so45762eec.0 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=slZBC5OYzvLP/FCW/W/7kYzRYSm8kbLOAfCSjolHqcm0OMwZenedl+PIMZPkmEXfqI 9vThcQW0540G6nBgYtFg718+QeZsjo3QwWq9IukPyVSwii8I0HIfNiUOXnbBN8kZaMZh lfZu8zvhOA2JHEq78ULD9wAyT4eDD4cYhSUF2p8OeJZKsabEQFqokQ8DF4drb7U0ChFB McjqiXaPAydlJSVvWwHmb8yfx6OvOR1e7F2QFCh6BeSJc6jmpyh60y33G8HIwN4W8sJX /f5Jq06yVYDk6xfBbDfwuFPevuENWfXSIGqTjUEqhFy7IVHaceg803Qqk0LIz84ggb7w swRg== X-Forwarded-Encrypted: i=1; AL+hErHVjlo9i2vaMkM007xMOenlz+zjFqB4DTjI2XOjMaJLXWcjIeuA+5SA8NPWREwCeFJnVwQ08YoGD6GL@vger.kernel.org X-Gm-Message-State: APuU4Z8oou+RrVX89512n3tTOta8KBw4QGe2ZzTEh6LNi7Zebe3dlumY YMAjl7ATVVQunsMPrTLeD+RfM7uWaKgVyaIic2rwXmZDs6w0LEW3Becw X-Gm-Gg: AZFdTZfR4+HHEJD3jRdG542jqnbqTQqIC/S6/LNJO1vTyyF1+ceW1mOdwylZLErsnuL 4eoWavfm79/ObNm8CqJhU/7qjDjyQqGuGu/z6xxltmw/w0LoIEO4s+QRBC+kvlfRlbo9flQMOc2 r6xIt7fifZqSUVFUKdrNOZSu02ofQ/Z/FAY90jW5Lb9v4Sddla+JQAHInRhF1H/hV1+o15k8Fqy WA7LdUjnmJ+MvmLSZr9LNxMcXq/DkwFZKASkBppuj6If6FWW/2bRghxagjBxBu79r7vV45AbAYh 2P/Jb60L6q7KMAJJepllYgZ5RxgazKAZoKk/0gOveM0LkhBda5HuIrr63Q49cW3rPcrpG1EwsFL QnOz+n7XWOwHBEAPxvVdKPFxQ74W/JP8NjPfpY0SBl3gDFDWHOYKWGj9o70V1oSXJ4WOy5CINHz CNhwsYfYyf5eUIQm4Oas3seybhdDBhE3MdMYMf3Llq9KxQLT4rrM+tBZJQdlbS6EmoNOYkEkiPn AfZdyPlEocKC2QrRDUX+juwNJjdDG2Nm3uNu5k87h/7PRbpSqKB7hjbb8K4PiN7G6LKvXh3JNkt wmksFo4L4iub6lzgCNZE5o66ulw= 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-leds@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