From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796217227; b=tUabZl1magDYlXYxYfeRc+66QsNwVlH3YFM0OXSuizXixESzvnYUlC815gqgol4hr0eI +pAEHh9zkAVoX3oiTegV2DKsTnVk4o9uewcn4yMz+xGWS9443y2VqBUztWFsoC+QB1aWR l2mm9sbMg9sF+wLC3boPCheWva39br0YulCNNh1Fucjr6+pgRc55GYgscdLQSSjNPxTG1 GsZyh72OieVkaA8Gc8MyUmGaSwXWN9h31pvwdAOgJ6UeHUyZOnwnr2oXlrRD/8pCcm1M+ z+p8t+I+KVwhto4wPYRLuNCtXGHA1VF32Wcar8yMnTu1BY6aif3hCBaL9s4SrxY/TOQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796217227; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:Date:To:cc: Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type: Content-ID; bh=z4z5Hd3mLIQ3/pi4Xm4s8fBftP6T7OgqaVboY9foDvo=; b=jvfwehh+2/OUjy7bdA4S8VwuZgS6lrqT+DQQedEnxzwvIjx+j1/+ml+q0tuNg9e/KNFB EZlwVyPpm1eD/aUaiZgQ+VL8CrPo0mqglbLzNJfrU3whOEVgccK9kuiSVd85KtewwsLRl w4jzoqED/5qop1ggUwPU/gdRiq5YFHy2I30Z8C1wI/2UDYDHC01MwMw4t9tH3xO42drdK WAq/TDax0gXZkq+ZET/o8TNX8tToIBTNEDXZdxAaPuTLl3Ion2KcEEB4LREg/tN1nVbr1 mG4Z2YlHSpgjYCUZMdR5kUDVHFcOQD3MTpkvi1I1yXchrNwxmrncJ9F6WZ8LxcxkOng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SceuVne9; arc=none smtp.remote-ip=198.175.65.18 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 680F9606A31A; Wed, 2 Dec 2026 13:13:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 680F9606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SceuVne9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796217227; x=1827753227; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=z4z5Hd3mLIQ3/pi4Xm4s8fBftP6T7OgqaVboY9foDvo=; b=SceuVne9rWDP89GasYQeSpj+faef2LDzJ0xxOj9hzVOuAQb9Gt/tD83p +gf7Hxc9E9r/olFlMo1WtUOCCZNpBp+0MbitmOK97TmfHAoVqATyCz6T2 QP5Na6ITz09mBmuRE/vm5VKkIez/9Hb2+uIv/h611aVdthtM4cXkyPXML I9yYSKrGRFF2WrY1K0jVjYxWcrmbT4jlhn/m8gu+uSJB71nVP2WYVZmR3 kV2flmNjMc1oqWG28d+baN+QWNnnTrgCnF0K+lb4jMJIWr33YJTgnXvw8 l4xEOOf3JkrNuSDOXUnorjkjPRktw6Ku9V0VAjExct6OOAvcygQZQ/Ka0 w==; X-CSE-ConnectionGUID: MpUp4nC4R7KFV+5YL9HESA== X-CSE-MsgGUID: VwinVyElQNS78A1DMw8vew== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5155368" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5155368" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 05:13:46 -0800 X-CSE-ConnectionGUID: SP3Wy5flSTi0brM9UUp0Bw== X-CSE-MsgGUID: WBpBn+OkRrOs9Qos+WUkJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="4984510" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.219]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 05:13:41 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Wed, 2 Dec 2026 15:13:37 +0200 (EET) To: Qiling Zhu 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 In-Reply-To: Message-ID: <5a82a4a4-eab5-3b68-04ce-f9bde0ce4a2d@linux.intel.com> 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: multipart/mixed; BOUNDARY="8323328-804410615-1796216713=:1052" Content-ID: <8e858ff9-6917-07c3-99ab-688460a3ec64@linux.intel.com> This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-804410615-1796216713=:1052 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: <71e52151-b46b-7fdf-af76-3123311607bf@linux.intel.com> On Wed, 2 Dec 2026, Qiling Zhu wrote: > On Tue, Dec 01, 2026 at 03:04:31PM +0200, Ilpo J=E4rvinen 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. I'm okay with keeping _BIT in the name because it seems to be used by=20 many case in this driver. That being said, "BIT", "MASK", or "ENABLE"=20 postfixes rarely add any value over just naming what it is about when it=20 comes to understanding the code. What they surely do is they make lines longer but some people seem to love= =20 long lines. In turn I'll then be picky about linesplits being done in proper places and indentation levels when one wants the pain of long lines= =20 for oneself, I think that's fair. :-) Some cases may need both BIT() and non-BIT() value, those cannot easily=20 use BIT() in the define but for other cases placing BIT() already into=20 the define is preferred way. > 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. We're now on -rc5 week, so please consider sending it before -rc7 is=20 tagged by Linus (one and half week from now) to give me some time to=20 (possibly) process it in this cycle. --=20 i. --8323328-804410615-1796216713=:1052--