Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Pali Rohár
On Wednesday 13 January 2016 20:10:30 Pavel Machek wrote:
> On Wed 2016-01-13 20:07:36, Pavel Machek wrote:
> > On Wed 2016-01-13 09:54:55, Pali Rohár wrote:
> > > On Tuesday 12 January 2016 22:58:04 Pavel Machek wrote:
> > > > Hi!
> > > > 
> 
> > > > Next question is.. apparently there are some keyboards that have
> > > > per-key RGB backlight... but maybe we can just call that "weird
> > > > enough" and ignore...
> > > 
> > > First we need to defines stable kernel ABI for keyboard backlight. And I
> > > suggest to use existing convention used by upower/console-kit and other
> > > userspace apps...
> > 
> > Hmm... I'm not sure that can be done. What were the masks used by
> > upower again? Will upower write to all 6 leds if we present them?
> 
> Got it...
> 
> It has function up_kbd_backlight_find() which do:
> 
> /* find a led device that is a keyboard device */
>   while ((filename = g_dir_read_name (dir)) != NULL) {
>   if (g_strstr_len (filename, -1, 
> "kbd_backlight") != NULL) {
>   dir_path = g_build_filename 
> ("/sys/class/leds",
>   filename,
>   
> NULL);
>   break;
>   
> That suggests that it stops at the first matching device. Adding new
> "virtual" led controlling 6 physical leds would be ugly. So... new
> interface should be done.
> 
>   Pavel

Yes, it would be ugly, but lp5523 is already ugly... it can accept
numeric value, trigger and also program in bytecode either via sysfs or
via request_firmware... Another virtual led control should not be
problem for this :-)

-- 
Pali Rohár
pali.ro...@gmail.com

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Johannes Stezenbach
On Mon, Jan 11, 2016 at 09:03:01PM +0100, Pali Rohár wrote:
> On Monday 11 January 2016 20:28:00 Henrique de Moraes Holschuh wrote
> > The two features are not the same (and are handled differently by the
> > firmware, for whatever reason), although they do serve the same
> > purpose. I don't think a thinkpad will ever have both features at
> > the same time, so I have no idea why they changed the firmware
> > interface.
...
> And more important, I was told that ThinkPad x230 comes in variant with 
> both ThinkLight (that LED upper the display) and keyboard backlight 
> (under they keyboard).

I can confirm this, my x230 has both.  FWIW, BIOS hotkey
Fn+Space cycles through off, dim backlight, full backlight
and full thinklight. /sys/class/leds/tpacpi::thinklight/brightness
can be read (showing either 0 or 255) but writes are ignored.
Dito for /proc/acpi/ibm/light.

Johannes

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Johannes Stezenbach
On Tue, Jan 12, 2016 at 02:07:10PM -0200, Henrique de Moraes Holschuh wrote:
> On Mon, Jan 11, 2016, at 19:12, Johannes Stezenbach wrote:
> > 
> > I can confirm this, my x230 has both.  FWIW, BIOS hotkey
> > Fn+Space cycles through off, dim backlight, full backlight
> > and full thinklight. /sys/class/leds/tpacpi::thinklight/brightness
> > can be read (showing either 0 or 255) but writes are ignored.
> > Dito for /proc/acpi/ibm/light.
> 
> We likely need to integrate better (future work) the new backlight
> control with the thinklight control and the firmware interface in the
> x230.
> 
> Is the ACPI AML for fn+space readable enough, or is it trapping directly
> into SMM?  Because if it interacts with the traditional higher-level
> ACPI AML we already use to talk to the thinklight (and now to the
> backlight), it should be relatively easy to fix the driver to better
> support the x230.

I have no clue about ACPI, do you have some hints
how to get the info you want?  I found this:

  sudo acpidump > acpidata.dat
  acpixtract -sSSDT acpidata.dat
  acpixtract -sDSDT acpidata.dat
  iasl -d DSDT.dat SSDT*.dat

  ..and then look at the .dsl files that contain the AML assembler. 

But what to look out for?

PS: failed to mention my x230 kernel was still 4.2.x in case it matters

Thanks,
Johannes

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Pali Rohár
On Monday 04 January 2016 21:12:31 Pavel Machek wrote:
> Hi1
> 
> > This patch adds support for controlling keyboard backlight via
> > standard linux led class interface (::kbd_backlight). It uses ACPI
> > HKEY device with MLCG and MLCS methods.
> > 
> > Signed-off-by: Pali Rohár 
> > Tested-by: Fabio D'Urso 
> 
> On my thinkpad, keyboard light is controlled by
> 
> /sys/class/leds/tpacpi\:\:thinklight/brightness
> 
> (that's a bad name).

Hi!

That is light in upper case of bezel/display, right? Thinklight is 
probably official marketing name for that by IBM/Lenovo.

My patch adds support for keyboard backlight (light under the keyboard).

> On n900, it is .../leds/kb0..kb6. Now we'd have kbd_backlight. I
> guess we should standartize on one name for this light, so that
> userspace has the chance to handle it automatically...

Looks like userspace already uses /sys/class/leds/*::kbd_backlight for 
keyboard backlight (light under the keyboard). At least other drivers 
uses this name and my KDE desktop recognized "dell::kbd_backlight" (from 
dell-laptop.ko) and "tpacpi::kbd_backlight" too.

So really for keyboard backlight use *::kbd_backlight it is already 
handled by existing userspace applications.

> Also, neccessity of workqueues for LED setting is slowly being
> removed from the kernel, see LED mailing list for details.

My patch uses kbd_backlight LED in same as as other LEDs in thinkpad 
acpi driver.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Johannes Stezenbach
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 & 0x8000))
{
If ((Arg0 & 0x0001))
{
\_SB.PCI0.LPC.EC.HKEY.MHKQ (0x6001)
}
ElseIf (\_SB.PCI0.LPC.EC.HKEY.MHKK (0x0002))
{
\_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

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Pali Rohár
On Tuesday 12 January 2016 22:58:04 Pavel Machek wrote:
> Hi!
> 
> On Mon 2016-01-11 21:03:01, Pali Rohár wrote:
> > On Monday 11 January 2016 20:28:00 Henrique de Moraes Holschuh wrote
> > > The two features are not the same (and are handled differently by the
> > > firmware, for whatever reason), although they do serve the same
> > > purpose. I don't think a thinkpad will ever have both features at
> > > the same time, so I have no idea why they changed the firmware
> > > interface.
> > 
> > Maybe we should decide if ::kbd_backlight LED suffix could be used also 
> > for other LED devices and not only for those which are physically under 
> > the keyboard.
> 
> Another problem is that N900 has _6_ backlight LEDs. Named
> lp5523::kb1..6. ... Which does means desktop software will probably
> not pick them up :-(. 
> 
> I guess we could have "/sys/class/kbd_light/brightness" that would
> control all of them with one write.

Probably... But there is problem that lp5523 is not ordinary on/off
light, it can be programmed to execute own "light" application.

> Next question is.. apparently there are some keyboards that have
> per-key RGB backlight... but maybe we can just call that "weird
> enough" and ignore...

First we need to defines stable kernel ABI for keyboard backlight. And I
suggest to use existing convention used by upower/console-kit and other
userspace apps...

-- 
Pali Rohár
pali.ro...@gmail.com

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-02-04 Thread Pali Rohár
On Wednesday 30 December 2015 23:28:48 Pali Rohár wrote:
> On Monday 28 December 2015 15:48:14 Pali Rohár wrote:
> > > Also, is it working properly across suspend+resume?
> > 
> > When doing resume from suspend or hibernate BIOS turning keyboard
> > backlight automatically off.
> 
> Fixed in v2.
> 

Now I see that BIOS try to be too intelligent and automatically turn of
keyboard backlight when LID is closed. When LID is open again then
keyboard backlight stay turned off. Sysfs show correct state (brightness
is zero).

Should thinkpad acpi driver do something? Or let BIOS do that job?

-- 
Pali Rohár
pali.ro...@gmail.com

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-13 Thread Pavel Machek
On Wed 2016-01-13 09:54:55, Pali Rohár wrote:
> On Tuesday 12 January 2016 22:58:04 Pavel Machek wrote:
> > Hi!
> > 
> > On Mon 2016-01-11 21:03:01, Pali Rohár wrote:
> > > On Monday 11 January 2016 20:28:00 Henrique de Moraes Holschuh wrote
> > > > The two features are not the same (and are handled differently by the
> > > > firmware, for whatever reason), although they do serve the same
> > > > purpose. I don't think a thinkpad will ever have both features at
> > > > the same time, so I have no idea why they changed the firmware
> > > > interface.
> > > 
> > > Maybe we should decide if ::kbd_backlight LED suffix could be used also 
> > > for other LED devices and not only for those which are physically under 
> > > the keyboard.
> > 
> > Another problem is that N900 has _6_ backlight LEDs. Named
> > lp5523::kb1..6. ... Which does means desktop software will probably
> > not pick them up :-(. 
> > 
> > I guess we could have "/sys/class/kbd_light/brightness" that would
> > control all of them with one write.
> 
> Probably... But there is problem that lp5523 is not ordinary on/off
> light, it can be programmed to execute own "light" application.

Yeah, but that's not a problem, right. lp5523 can still set brightness
by hand.

> > Next question is.. apparently there are some keyboards that have
> > per-key RGB backlight... but maybe we can just call that "weird
> > enough" and ignore...
> 
> First we need to defines stable kernel ABI for keyboard backlight. And I
> suggest to use existing convention used by upower/console-kit and other
> userspace apps...

Hmm... I'm not sure that can be done. What were the masks used by
upower again? Will upower write to all 6 leds if we present them?

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-13 Thread Pavel Machek
On Wed 2016-01-13 20:07:36, Pavel Machek wrote:
> On Wed 2016-01-13 09:54:55, Pali Rohár wrote:
> > On Tuesday 12 January 2016 22:58:04 Pavel Machek wrote:
> > > Hi!
> > > 

> > > Next question is.. apparently there are some keyboards that have
> > > per-key RGB backlight... but maybe we can just call that "weird
> > > enough" and ignore...
> > 
> > First we need to defines stable kernel ABI for keyboard backlight. And I
> > suggest to use existing convention used by upower/console-kit and other
> > userspace apps...
> 
> Hmm... I'm not sure that can be done. What were the masks used by
> upower again? Will upower write to all 6 leds if we present them?

Got it...

It has function up_kbd_backlight_find() which do:

/* find a led device that is a keyboard device */
while ((filename = g_dir_read_name (dir)) != NULL) {
if (g_strstr_len (filename, -1, 
"kbd_backlight") != NULL) {
dir_path = g_build_filename 
("/sys/class/leds",
filename,

NULL);
break;

That suggests that it stops at the first matching device. Adding new
"virtual" led controlling 6 physical leds would be ugly. So... new
interface should be done.

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Kevin Locke
On 01/12/2016 10:20 AM, Henrique de Moraes Holschuh wrote:
> On Tue, Jan 12, 2016, at 16:11, Kevin Locke wrote:
>> I looked through the DSDT and SSDT AML on the T430 (which also has both
>> a keyboard backlight and ThinkLight) and couldn't deduce which method
>> was being invoked for Fn+Space or an analog to MLCG/MLCS for the
>> ThinkLight.  However, that may be due to my inexperience interpreting
>> AML.  I'll keep looking/learning.
>
> It calls directly into the SMBIOS :-(

Bummer!  Thank you for taking the time to figure that out.

Kevin

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Henrique de Moraes Holschuh
On Tue, Jan 12, 2016, at 14:59, Darren Hart wrote:
> Gah, these two threads landed next to each other in my Inbox and I didn't
> pick
> up the split. Apologies.
> 
> This is queued in testing (again).

Thanks!

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Pavel Machek
Hi!

On Mon 2016-01-11 21:03:01, Pali Rohár wrote:
> On Monday 11 January 2016 20:28:00 Henrique de Moraes Holschuh wrote
> > The two features are not the same (and are handled differently by the
> > firmware, for whatever reason), although they do serve the same
> > purpose. I don't think a thinkpad will ever have both features at
> > the same time, so I have no idea why they changed the firmware
> > interface.
> 
> Maybe we should decide if ::kbd_backlight LED suffix could be used also 
> for other LED devices and not only for those which are physically under 
> the keyboard.

Another problem is that N900 has _6_ backlight LEDs. Named
lp5523::kb1..6. ... Which does means desktop software will probably
not pick them up :-(. 

I guess we could have "/sys/class/kbd_light/brightness" that would
control all of them with one write.

Next question is.. apparently there are some keyboards that have
per-key RGB backlight... but maybe we can just call that "weird
enough" and ignore...

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Henrique de Moraes Holschuh
On Mon, Jan 11, 2016, at 18:03, Pali Rohár wrote:
> On Monday 11 January 2016 20:28:00 Henrique de Moraes Holschuh wrote
> > The two features are not the same (and are handled differently by the
> > firmware, for whatever reason), although they do serve the same
> > purpose. I don't think a thinkpad will ever have both features at
> > the same time, so I have no idea why they changed the firmware
> > interface.
> 
> Maybe we should decide if ::kbd_backlight LED suffix could be used also 
> for other LED devices and not only for those which are physically under 
> the keyboard.

Maybe, but that doesn't matter for thinkpad-acpi: the "thinklight" LED
name is kernel-userspace ABI so frozen by years and years of use that it
is not even funny.  It cannot be changed.

> At least I understand "keyboard backlight" as light which is under the 
> keyboard...

So do I...

> And more important, I was told that ThinkPad x230 comes in variant with 
> both ThinkLight (that LED upper the display) and keyboard backlight 
> (under they keyboard).

Ok, so there is yet another damn good reason to keep both separate.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Darren Hart
On Mon, Jan 11, 2016 at 05:28:00PM -0200, Henrique de Moraes Holschuh wrote:
 > 
> > Henrique, so are you taking back your Ack from 10 minutes prior?
> 
> Hmm? No, the ACK stands.
> 
> Pavel was talking about another feature altogether, apparently: older
> thinkpads did not have "keyboard backlight" (as in light from below the
> keys).  They had a "ThinkLight", which is an overhead light that shines
> down on the keyboard.
> 
> The two features are not the same (and are handled differently by the
> firmware, for whatever reason), although they do serve the same purpose.
>  I don't think a thinkpad will ever have both features at the same time,
> so I have no idea why they changed the firmware interface.
> 
> The patch adds support to the "keyboard backlight" feature, which was
> previously NOT supported.
> 
> > I've dropped this patch. Please let me know if I should pick it back up.
> 
> Please pick it back up.
> 

Gah, these two threads landed next to each other in my Inbox and I didn't pick
up the split. Apologies.

This is queued in testing (again).

-- 
Darren Hart
Intel Open Source Technology Center

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Yves-Alexis Perez
On mar., 2016-01-12 at 14:07 -0200, Henrique de Moraes Holschuh wrote:
> We likely need to integrate better (future work) the new backlight
> control with the thinklight control and the firmware interface in the
> x230.

Ok so I've just checked my work X230, and I was just wrong: no ThinkLight on
it, although I really had the impression there /was/ a dual generation.

Regards,
-- 
Yves-Alexis



signature.asc
Description: This is a digitally signed message part
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-12 Thread Henrique de Moraes Holschuh
On Mon, Jan 11, 2016, at 19:12, Johannes Stezenbach wrote:
> On Mon, Jan 11, 2016 at 09:03:01PM +0100, Pali Rohár wrote:
> > On Monday 11 January 2016 20:28:00 Henrique de Moraes Holschuh wrote
> > > The two features are not the same (and are handled differently by the
> > > firmware, for whatever reason), although they do serve the same
> > > purpose. I don't think a thinkpad will ever have both features at
> > > the same time, so I have no idea why they changed the firmware
> > > interface.
> ...
> > And more important, I was told that ThinkPad x230 comes in variant with 
> > both ThinkLight (that LED upper the display) and keyboard backlight 
> > (under they keyboard).
> 
> I can confirm this, my x230 has both.  FWIW, BIOS hotkey
> Fn+Space cycles through off, dim backlight, full backlight
> and full thinklight. /sys/class/leds/tpacpi::thinklight/brightness
> can be read (showing either 0 or 255) but writes are ignored.
> Dito for /proc/acpi/ibm/light.

We likely need to integrate better (future work) the new backlight
control with the thinklight control and the firmware interface in the
x230.

Is the ACPI AML for fn+space readable enough, or is it trapping directly
into SMM?  Because if it interacts with the traditional higher-level
ACPI AML we already use to talk to the thinklight (and now to the
backlight), it should be relatively easy to fix the driver to better
support the x230.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-11 Thread Darren Hart
On Sat, Jan 09, 2016 at 03:46:41PM -0200, Henrique de Moraes Holschuh wrote:
> On Sat, Jan 9, 2016, at 15:39, Henrique de Moraes Holschuh wrote:
> > On Mon, Jan 4, 2016, at 18:12, Pavel Machek wrote:
> > > > This patch adds support for controlling keyboard backlight via standard
> > > > linux led class interface (::kbd_backlight). It uses ACPI HKEY device 
> > > > with
> > > > MLCG and MLCS methods.
> > > > 
> > > > Signed-off-by: Pali Rohár 
> > > > Tested-by: Fabio D'Urso 
> > > 
> > > On my thinkpad, keyboard light is controlled by
> > > 
> > > /sys/class/leds/tpacpi\:\:thinklight/brightness
> > > 
> > > (that's a bad name).
> > 
> > That's because the driver was not updated to support your laptop, AND I
> > don't recall if someone mapped the full behavior of the ACPI thinklight
> > interface in your thinkpad :-(
> 
> Argh.  If by "keyboard light" you mean the LED above the *screen* that
> shines down on the whole keyboard, please disregard my previous reply...
> 
> As for the naming, the idea of a LED up there shining in the keyboard
> is:
>  1. patented by IBM
>  2. named "ThinkLight" by IBM, one of the "Think Technologies" in the
>  "ThinkPad" (add TM after everything :p)  and every
>  old-timer thinkpad user knew it by that name.
>  4. called "thinklight" by the driver since before the LED sysfs class
>  even existed :p
> 
> ibm-acpi, since then renamed thinkpad-acpi *predates* most generic
> interfaces.  Heck, it predates sysfs.
> 
> So, this is ABI set in stone.  If there is a way to add an "alias" of
> kbd_backlight that won't drive userspace crazy, we might do that though.
>  But it looks quite risky to me...

Henrique, so are you taking back your Ack from 10 minutes prior?

I've dropped this patch. Please let me know if I should pick it back up.

-- 
Darren Hart
Intel Open Source Technology Center

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-11 Thread Henrique de Moraes Holschuh
On Mon, Jan 11, 2016, at 17:04, Darren Hart wrote:
> On Sat, Jan 09, 2016 at 03:46:41PM -0200, Henrique de Moraes Holschuh
> wrote:
> > On Sat, Jan 9, 2016, at 15:39, Henrique de Moraes Holschuh wrote:
> > > On Mon, Jan 4, 2016, at 18:12, Pavel Machek wrote:
> > > > > This patch adds support for controlling keyboard backlight via 
> > > > > standard
> > > > > linux led class interface (::kbd_backlight). It uses ACPI HKEY device 
> > > > > with
> > > > > MLCG and MLCS methods.
> > > > > 
> > > > > Signed-off-by: Pali Rohár 
> > > > > Tested-by: Fabio D'Urso 
> > > > 
> > > > On my thinkpad, keyboard light is controlled by
> > > > 
> > > > /sys/class/leds/tpacpi\:\:thinklight/brightness
> > > > 
> > > > (that's a bad name).
> > > 
> > > That's because the driver was not updated to support your laptop, AND I
> > > don't recall if someone mapped the full behavior of the ACPI thinklight
> > > interface in your thinkpad :-(
> > 
> > Argh.  If by "keyboard light" you mean the LED above the *screen* that
> > shines down on the whole keyboard, please disregard my previous reply...
> > 
> > As for the naming, the idea of a LED up there shining in the keyboard
> > is:
> >  1. patented by IBM
> >  2. named "ThinkLight" by IBM, one of the "Think Technologies" in the
> >  "ThinkPad" (add TM after everything :p)  and every
> >  old-timer thinkpad user knew it by that name.
> >  4. called "thinklight" by the driver since before the LED sysfs class
> >  even existed :p
> > 
> > ibm-acpi, since then renamed thinkpad-acpi *predates* most generic
> > interfaces.  Heck, it predates sysfs.
> > 
> > So, this is ABI set in stone.  If there is a way to add an "alias" of
> > kbd_backlight that won't drive userspace crazy, we might do that though.
> >  But it looks quite risky to me...
> 
> Henrique, so are you taking back your Ack from 10 minutes prior?

Hmm? No, the ACK stands.

Pavel was talking about another feature altogether, apparently: older
thinkpads did not have "keyboard backlight" (as in light from below the
keys).  They had a "ThinkLight", which is an overhead light that shines
down on the keyboard.

The two features are not the same (and are handled differently by the
firmware, for whatever reason), although they do serve the same purpose.
 I don't think a thinkpad will ever have both features at the same time,
so I have no idea why they changed the firmware interface.

The patch adds support to the "keyboard backlight" feature, which was
previously NOT supported.

> I've dropped this patch. Please let me know if I should pick it back up.

Please pick it back up.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-09 Thread Henrique de Moraes Holschuh
On Mon, Jan 4, 2016, at 18:12, Pavel Machek wrote:
> > This patch adds support for controlling keyboard backlight via standard
> > linux led class interface (::kbd_backlight). It uses ACPI HKEY device with
> > MLCG and MLCS methods.
> > 
> > Signed-off-by: Pali Rohár 
> > Tested-by: Fabio D'Urso 
> 
> On my thinkpad, keyboard light is controlled by
> 
> /sys/class/leds/tpacpi\:\:thinklight/brightness
> 
> (that's a bad name).

That's because the driver was not updated to support your laptop, AND I
don't recall if someone mapped the full behavior of the ACPI thinklight
interface in your thinkpad :-(

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH] thinkpad_acpi: Add support for keyboard backlight

2016-01-04 Thread Pavel Machek
Hi1

> This patch adds support for controlling keyboard backlight via standard
> linux led class interface (::kbd_backlight). It uses ACPI HKEY device with
> MLCG and MLCS methods.
> 
> Signed-off-by: Pali Rohár 
> Tested-by: Fabio D'Urso 

On my thinkpad, keyboard light is controlled by

/sys/class/leds/tpacpi\:\:thinklight/brightness

(that's a bad name).

On n900, it is .../leds/kb0..kb6. Now we'd have kbd_backlight. I guess
we should standartize on one name for this light, so that userspace
has the chance to handle it automatically...

Also, neccessity of workqueues for LED setting is slowly being removed
from the kernel, see LED mailing list for details.

Thanks,
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

--
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel