From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753527AbcALWHk (ORCPT ); Tue, 12 Jan 2016 17:07:40 -0500 Received: from mail.sig21.net ([80.244.240.74]:37066 "EHLO mail.sig21.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbcALWHh (ORCPT ); Tue, 12 Jan 2016 17:07:37 -0500 Date: Tue, 12 Jan 2016 23:07:15 +0100 From: Johannes Stezenbach To: Henrique de Moraes Holschuh Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Darren Hart , Pavel Machek , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Fabio D'Urso" Subject: Re: [PATCH] thinkpad_acpi: Add support for keyboard backlight Message-ID: <20160112220715.GA13350@sig21.net> References: <1450982818-11694-1-git-send-email-pali.rohar@gmail.com> <20160111190411.GE10643@malice.jf.intel.com> <1452540480.2848000.489039714.26068C20@webmail.messagingengine.com> <201601112103.01145@pali> <20160111211228.GA4171@sig21.net> <1452614830.376787.489968026.5FAEDB86@webmail.messagingengine.com> <20160112163514.GA24900@sig21.net> <1452621367.403228.490087522.151796A7@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452621367.403228.490087522.151796A7@webmail.messagingengine.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-21-Score: -2.9 (--) X-Spam-21-Report: No, score=-2.9 required=8.0 tests=ALL_TRUSTED=-1,BAYES_00=-1.9,URIBL_BLOCKED=0.001 autolearn=ham Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2016 at 03:56:07PM -0200, Henrique de Moraes Holschuh wrote: > On Tue, Jan 12, 2016, at 14:35, Johannes Stezenbach wrote: > > But what to look out for? > > Well, you should familiarize yourself with ACPI AML a bit. Then, look > for the ACPI methods that thinkpad-acpi (and the patch to add backlight > support) calls, and try to work out how they work in your thinkpad. > > Typical thinkpad firmware behavior is to sometimes have a lower level > implementation, a higher level ACPI API that the O.S. is supposed to > call (and which will call into the lower level implementation, or to the > work itself). > > We want to stick to the higher level API, as it is more stable. Use of > lower-level APIs or direct EC access must be whitelist-restricted. So if I interpret this correctly it calls SMI BIOS on x230, too: Method (MLCG, 1, NotSerialized) { Local0 = \KBLS (0x00, 0x00) Return (Local0) } Method (MLCS, 1, NotSerialized) { Local0 = \KBLS (0x01, Arg0) If (!(Local0 & 0x80000000)) { If ((Arg0 & 0x00010000)) { \_SB.PCI0.LPC.EC.HKEY.MHKQ (0x6001) } ElseIf (\_SB.PCI0.LPC.EC.HKEY.MHKK (0x00020000)) { \_SB.PCI0.LPC.EC.HKEY.MHKQ (0x1012) } } Return (Local0) } Method (KBLS, 2, NotSerialized) { Return (SMI (0x14, 0x09, Arg0, Arg1, 0x00)) } FWIW, full dump is here: https://linuxtv.org/~js/ahSheaw0eezahqu1aethohLae4MeiPhe/ Johannes