Re: [ibm-acpi-devel] Turned my ThinkPad into a BeepPad :-/

2015-02-17 Thread Henrique de Moraes Holschuh
On Tue, 17 Feb 2015, Henrique de Moraes Holschuh wrote:
> Then go into the bios/uefi and set the box up it all again, because *ALL*
> parameters will have been reset.  I'd advise to boot Windows with all Lenovo

Actually, there are a few data areas this doesn't clear.  The "vital product
data" area, where serial numbers and other such stuff lies, and some data
areas in the system FLASH that the firmware should not be writing to just to
make sound, anyway.

Let's hope you don't have to clear those, for now.

-- 
  "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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] Unhandled HKEY event

2015-02-17 Thread Henrique de Moraes Holschuh
On Fri, 30 Jan 2015, Xavier Naveira wrote:
> I'm getting the following message in my kernel log:
> 
> Jan 30 08:21:49 xntlaptop kernel: [38868.681518] thinkpad_acpi:
> unhandled HKEY event 0x6060
> Jan 30 08:21:49 xntlaptop kernel: [38868.681520] thinkpad_acpi: please
> report the conditions when this event happened to
> ibm-acpi-devel@lists.sourceforge.net
> Jan 30 08:21:58 xntlaptop kernel: [38877.305316] thinkpad_acpi:
> unknown possible thermal alarm or keyboard event received
> 
> This is when pressing the left-bottom key Fn + Esc to lock the
> Function keys in a Lenovo x240, the keys do what they are supposed to
> do though, and function keys do get locked. I'm just reporting this
> because I'm interested in knowing how the driver works and how to
> contribute to assign functions to the special keys etc.

Someone is working on a driver for that special keyboard mode switch, the
code is likely going to land on kernel 3.19 or 3.20.  I don't know how well
it works.

-- 
  "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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] Cannot change brightness on Thinkpad e145

2015-02-17 Thread Henrique de Moraes Holschuh
On Wed, 28 Jan 2015, Reverend Homer wrote:
> I am using Debian Jessie on my Lenovo e145 laptop with fglrx and 
> unfortunately I cannot change brightness. I've found this in my journalctl:

If fglrx cannot do it, there's not much we can do to help you in this ML.
The E145 does brightness control through the GPU, so it is up to the
x-server and the GPU driver (fglrx in your case).

Sometimes, the Lenovo BIOS can interact with the GPU through standard ACPI
(this is a function of another kernel driver, thinkpad-acpi is not in the
loop for standard ACPI brightness control), but not always.

There is no data for the E145 in thinkwiki.  If it happens to be a dual-GPU
model (i.e. ATI GPU + embedded intel chipset graphics), it is possible that
brightness control must be done through the embedded GPU, and not the ATI
GPU.

I suggest you ask around in the linux-thinkpad ML, someone there might have
an E145 and know what to do to control brightness in that model.

-- 
  "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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] Turned my ThinkPad into a BeepPad :-/

2015-02-17 Thread Henrique de Moraes Holschuh
On Tue, 20 Jan 2015, Jagged O'Neill wrote:
> One point I checked out is what happens if I "play" several sounds
> in parallel; because there is value 0 to stop a sound in progress,

Urk.  That "play sound" thing is handled entirely by the deep magic inside
the ThinkPad BIOS.

> I repeated the same experiment with issuing 16 first, trying to
> interrupt it with 9. I was quickly immensely distressed by the
> result, so that I can't even tell what happened in detail. However,
> what I know is that the continuous sound 16 didn't stop. I tried to
> interrupt it with 17, but it didn't stop. I tried to break it using
> 0, but it didn't stop.

Oh dear... either the BIOS went crazy, OR it drove the embedded controller
into insanty (which is worse).

> Just after powering on the box again, it almost immediately beeped
> again (about the same volume, but with a blatantly higher pitch),
> even before the screen (or probably the backlight) was switched on
> --- what the fun... I looked through the BIOS settings but there's
> nothing to disable sounds. I came to the idea to plug in a headphone,
> to quiet the builtin speakers, but that didn't work (at this stage;
> and meanwhile, even more neighbors entered the concert :-/ ).

Urk!

> In the hope that the thinkpad-acpi driver would figure that there's
> something wrong, I just booted into the OS (OpenSuse 13.1, details
> below), but the only (however, I was already lucky with that) effect
> was that the sound was finally routed to the headphones, and the
> speakers were silent. Since the ThinkPad beeps are _really_ loud,
> I could still hear them, though I usually don't hear any music
> through them unless the (type in-ear) headphones are plugged into
> the ears, even when the media-player or computer (not tested with
> the ThinkPad before) or whatever play at maximum volume.
> 
> Okay, the interim solution is to have plugged in a dummy plug into
> the headphone jack, but this doesn't work before the driver kicks
> in. My idea was to install some version of Windows in the hope it
> might have some means of "normalizing" the machine's behaviour,
> but since it's a recent model (details below), and I only have
> Win NT/XP licenses with media, and a Win7 license without medium,
> I doubt I could solve this problem quickly; and I don't want to
> spend much time while the box is beeping me into sickness
> and my neighbors into ultimate annoyance.
> 
> So I hope anyone here is able to tell me what went wrong; or at
> least how to solve this issue. I guess, since this feature

You hit one of those nasty 8-legged things that lurk in the deep crevices of
vendor firmware, unfortunately.  One we had never heard about, either.

There's a fix: clear the entire firmware state.  You need to erase and
invalidate the "CMOS" memory and *likely* also find a way to "braindead" the
EC.

You can try just clearing the CMOS first, but if the crap got loaded into EC
memory space, you need to reset that, and the only thing that does it is
managing to power it down (this is often called "braindeading" the
thinkpad).

The guys in linux-thinkpad or the thinkpad forum will know the exact
procedure to clear the entire CMOS and power down the EC on your thinkpad
model, but basically you will probably have to:

1. Remove all possible power supplies (this includes the internal CMOS
battery, which usually means you will need to open the thinkpad), and if
there's a jumper to clear the CMOS, use it as well.

2. Discharge all caps and starve the embedded controller so that it powers
down.  This one is easy, provided you removed all power supplies and
batteries: press the power button for at least 3 seconds, and repeat that
least 10 times, and to make sure it is dead, do a final very long press of
at least 14 seconds.

3. Reinstall all batteries and connect to AC power.  Turn it on.

Then go into the bios/uefi and set the box up it all again, because *ALL*
parameters will have been reset.  I'd advise to boot Windows with all Lenovo
drivers loaded if you still have that, as that might load better defaults in
the embedded controller.  Unless tp-smapi works in your box, in which case
you can use tp-smapi to set the battery controller' thresholds, and you
don't need windows.

-- 
  "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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi

Re: [ibm-acpi-devel] unhandled HKEY event

2015-02-17 Thread Henrique de Moraes Holschuh
On Tue, 20 Jan 2015, Zdenek Gerlicky wrote:
> I got this warning in syslog
> 
> [16452.966435] thinkpad_acpi: unknown possible thermal alarm or keyboard 
> event received
> [16452.966445] thinkpad_acpi: unhandled HKEY event 0x6060

You can ignore these, they're normal, there's nothing wrong with 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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] Keyboard, "stops working" does not take input

2015-02-17 Thread Henrique de Moraes Holschuh
On Tue, 17 Feb 2015, Carl Helmertz wrote:
> My thinkpad T440s is acting up sometimes in a fashion that I cannot
> reliably reproduce. The builtin keyboard stops taking input, as if it
> was unplugged. This happens just as I am typing something. The

Have something listening to the input device for the keyboard, to check
where things are going crazy.  Also, kernel version is relevant.

> Feb 17 12:06:39 moon kernel: thinkpad_acpi: unhandled HKEY event 0x6060

You can just ignore all of these.  They're irrelevant.

> This has happened about 3 or 4 times this year and all I've done is
> rebooting and everything turned out fine after boot.

Make sure you have the latest firmware.  And an up-to-date kernel.

I don't know how I can help you with this, though.

-- 
  "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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
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: unhandled hkey event

2015-02-17 Thread Darren Hart
On Sat, Jan 31, 2015 at 07:52:03PM +0100, Xavier Naveira wrote:
> Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
> an unhandled hkey event
> 
> Signed-off-by: Xavier Naveira 
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index c3d11fa..e61c43b 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -196,6 +196,7 @@ enum tpacpi_hkey_event_t {
>   /* Key-related user-interface events */
>   TP_HKEY_EV_KEY_NUMLOCK  = 0x6000, /* NumLock key pressed */
>   TP_HKEY_EV_KEY_FN   = 0x6005, /* Fn key pressed? E420 */
> + TP_HKEY_EV_KEY_FN_ESC   = 0x6060, /* Fn+Esc key pressed X240 */
>  
>   /* Thermal events */
>   TP_HKEY_EV_ALARM_BAT_HOT= 0x6011, /* battery too hot */
> @@ -3717,6 +3718,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
>   *send_acpi_ev = false;
>   *ignore_acpi_ev = true;
>   return true;
> + case TP_HKEY_EV_KEY_FN_ESC:
> + /* key press events, we just ignore them as long as the EC
> +  * is still reporting them in the normal keyboard stream */
> + *send_acpi_ev = false;
> + *ignore_acpi_ev = true;
> + return true;

No need to duplicate the logic here, just add TP_HKEY_EV_KEY_FN_ESC to the list
of fallthrough keys (right after TP_HKEY_EV_KEY_FN).

-- 
Darren Hart
Intel Open Source Technology Center

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
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 v2] thinkpad_acpi: unhandled hkey event

2015-02-17 Thread Darren Hart
On Tue, Feb 10, 2015 at 08:45:18AM +0100, Xavier Naveira wrote:
> Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
> an unhandled hkey event
> 
> Signed-off-by: Xavier Naveira 

Queued, thanks.

-- 
Darren Hart
Intel Open Source Technology Center

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


[ibm-acpi-devel] Cannot change brightness on Thinkpad e145

2015-02-17 Thread Reverend Homer
Hi,

I am using Debian Jessie on my Lenovo e145 laptop with fglrx and 
unfortunately I cannot change brightness. I've found this in my journalctl:

янв 28 01:22:11 claw kernel: thinkpad_acpi: ThinkPad ACPI Extras v0.25
янв 28 01:22:11 claw kernel: thinkpad_acpi: http://ibm-acpi.sf.net/
янв 28 01:22:11 claw kernel: thinkpad_acpi: ThinkPad BIOS HSET57WW (2.02 ), EC 
unknown
янв 28 01:22:11 claw kernel: thinkpad_acpi: Lenovo ThinkPad Edge E145, model 
20BC0001RT
янв 28 01:22:11 claw kernel: thinkpad_acpi: Unsupported brightness interface, 
please contact ibm-acpi-devel@lists.sourceforge.net
янв 28 01:22:11 claw kernel: thinkpad_acpi: radio switch found; radios are 
enabled
янв 28 01:22:11 claw kernel: thinkpad_acpi: possible tablet mode switch found; 
ThinkPad in laptop mode
янв 28 01:22:11 claw kernel: thinkpad_acpi: This ThinkPad has standard ACPI 
backlight brightness control, supported by the ACPI video
янв 28 01:22:11 claw kernel: thinkpad_acpi: Disabling thinkpad-acpi brightness 
events by default...
янв 28 01:22:11 claw kernel: thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: 
radio is unblocked
янв 28 01:22:11 claw kernel: thinkpad_acpi: Console audio control enabled, 
mode: monitor (read only)


Can somebody help me with this?

-- 
Regards,
R.H.


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


[ibm-acpi-devel] Keyboard, "stops working" does not take input

2015-02-17 Thread Carl Helmertz
Hi list,

My thinkpad T440s is acting up sometimes in a fashion that I cannot
reliably reproduce. The builtin keyboard stops taking input, as if it
was unplugged. This happens just as I am typing something. The
keyboard does however react to keypresses since I can get the LED on
the mute button (F1) and the function button light up (derailing:
although, the sound is not muted but that might be because of my
combination of Fedora and i3 that requires me to "bindsym
XF86AudioMute exec --no-startup-id amixer set Master toggle" in i3's
config).

I'm a noob when it comes to hardware so feel free to ask me for more
information and I will provide it. For now, this is some journalctl
output from around the time of my experience:

Feb 17 12:06:39 moon kernel: thinkpad_acpi: unhandled HKEY event 0x6060
Feb 17 12:06:39 moon kernel: thinkpad_acpi: please report the
conditions when this event happened to
ibm-acpi-devel@lists.sourceforge.net
Feb 17 12:06:39 moon kernel: thinkpad_acpi: unknown possible thermal
alarm or keyboard event received
Feb 17 12:06:39 moon kernel: thinkpad_acpi: unhandled HKEY event 0x6060
Feb 17 12:06:39 moon kernel: thinkpad_acpi: please report the
conditions when this event happened to
ibm-acpi-devel@lists.sourceforge.net
Feb 17 12:06:42 moon kernel: thinkpad_acpi: unknown possible thermal
alarm or keyboard event received
Feb 17 12:06:42 moon kernel: thinkpad_acpi: unhandled HKEY event 0x6060
Feb 17 12:06:42 moon kernel: thinkpad_acpi: please report the
conditions when this event happened to
ibm-acpi-devel@lists.sourceforge.net
Feb 17 12:06:45 moon kernel: thinkpad_acpi: unknown possible thermal
alarm or keyboard event received
Feb 17 12:06:45 moon kernel: thinkpad_acpi: unhandled HKEY event 0x6060
Feb 17 12:06:45 moon kernel: thinkpad_acpi: please report the
conditions when this event happened to
ibm-acpi-devel@lists.sourceforge.net

This has happened about 3 or 4 times this year and all I've done is
rebooting and everything turned out fine after boot.

Cheers,
Carl

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
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 v2] thinkpad_acpi: support new BIOS version string pattern

2015-02-17 Thread Darren Hart
On Wed, Feb 11, 2015 at 01:43:10PM +0800, Adam Lee wrote:
> Latest ThinkPad models use a new string pattern of BIOS version,
> thinkpad_acpi won't be loaded automatically without this fix.
> 
> Signed-off-by: Adam Lee 
> ---

When sending updated versions of a patch or series, please include a changelog
after the ---, see Documentation/SubmittingPatches.

>  drivers/platform/x86/thinkpad_acpi.c | 26 --
>  1 file changed, 20 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index c3d11fa..18b7594 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8883,17 +8883,31 @@ static bool __pure __init tpacpi_is_fw_digit(const 
> char c)
>   return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z');
>  }
>  
> -/* Most models: xxyTkkWW (#.##c); Ancient 570/600 and -SL lacks (#.##c) */
>  static bool __pure __init tpacpi_is_valid_fw_id(const char * const s,
>   const char t)
>  {
> - return s && strlen(s) >= 8 &&
> + /*
> +  * Most models: xxyTkkWW (#.##c)
> +  * Ancient 570/600 and -SL lacks (#.##c)
> +  */
> + if (s && strlen(s) >= 8 &&
> + tpacpi_is_fw_digit(s[0]) &&
> + tpacpi_is_fw_digit(s[1]) &&
> + s[2] == t &&
> + (s[3] == 'T' || s[3] == 'N') &&
> + tpacpi_is_fw_digit(s[4]) &&
> + tpacpi_is_fw_digit(s[5]))

I'm not wild about these big boolean statements, but I also don't see something
that is obviously better. Typically we want to see indentation with tabs and
alignment with the initial line's arguments with spaces... but here that just
looks ugly as the too seemingly similar blocks end up with different
indentations due to the if and return... anyway, subjective and all that. So I'm
leaving it mostly alone, but I dropped one set of tabs from the above lines and
queued it.

Thanks Adam.

> + return true;
> +
> + /* New models: xxxyTkkW (#.##c); T550 and some others */
> + return  s && strlen(s) >= 8 &&
>   tpacpi_is_fw_digit(s[0]) &&
>   tpacpi_is_fw_digit(s[1]) &&
> - s[2] == t &&
> - (s[3] == 'T' || s[3] == 'N') &&
> - tpacpi_is_fw_digit(s[4]) &&
> - tpacpi_is_fw_digit(s[5]);
> + tpacpi_is_fw_digit(s[2]) &&
> + s[3] == t &&
> + (s[4] == 'T' || s[4] == 'N') &&
> + tpacpi_is_fw_digit(s[5]) &&
> + tpacpi_is_fw_digit(s[6]);



>  }
>  
>  /* returns 0 - probe ok, or < 0 - probe error.
> -- 
> 2.1.4
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
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] x86: thinkpad_acpi.c: fix sparse warning

2015-02-17 Thread Darren Hart
On Thu, Feb 05, 2015 at 02:45:38PM +, Lad Prabhakar wrote:
> From: "Lad, Prabhakar" 
> 
> this patch fixes following sparse warning:

Please use the imperative, command form, in the future:

"Fix the following sparse warning:"

For the subject, just the module name is sufficient, no need to preface with
x86:. Always capitalize the first word after the filename:

thinkpad_acpi: Fix sparse warning

Corrected and applied, thanks!

-- 
Darren Hart
Intel Open Source Technology Center

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


[ibm-acpi-devel] [PATCH] x86: thinkpad_acpi.c: fix sparse warning

2015-02-17 Thread Lad Prabhakar
From: "Lad, Prabhakar" 

this patch fixes following sparse warning:

thinkpad_acpi.c:3459:11: warning: symbol 'adaptive_keyboard_modes' was not 
declared. Should it be static?

Signed-off-by: Lad, Prabhakar 
---
 Found this issue on linux-next (gcc  version 4.9.2,
 sparse version  0.4.5-rc1) and applies on top linux-next.

 drivers/platform/x86/thinkpad_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c 
b/drivers/platform/x86/thinkpad_acpi.c
index c3d11fa..0e9262b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3456,7 +3456,7 @@ enum ADAPTIVE_KEY_MODE {
LAYFLAT_MODE
 };
 
-const int adaptive_keyboard_modes[] = {
+static const int adaptive_keyboard_modes[] = {
HOME_MODE,
 /* WEB_BROWSER_MODE = 2,
WEB_CONFERENCE_MODE = 3, */
-- 
1.9.1


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


[ibm-acpi-devel] Unknown possible thermal alarm

2015-02-17 Thread Branimir Braykov
Hi,
I got this in dmesg when pressing Fn+F5 or Fn+F6 for managing my brightness.
I am on Lenovo Thinkpad S540.
Ubuntu 14.10
Linux xxx 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux


[ 2660.773900] thinkpad_acpi: unknown possible thermal alarm or keyboard
event received
[ 2660.773911] thinkpad_acpi: unhandled HKEY event 0x6050
[ 2660.773918] thinkpad_acpi: please report the conditions when this event
happened to ibm-acpi-devel@lists.sourceforge.net
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] thinkpad_acpi: mute button stop working on x240

2015-02-17 Thread Darren Hart
On 2/16/15, 11:03 PM, "Xavier Naveira"  wrote:

>On Mon, Feb 16, 2015 at 08:40:47AM -0800, Andrew Lutomirski wrote:
>> On Mon, Feb 16, 2015 at 7:35 AM, Xavier Naveira 
>>wrote:
>> > On Mon, Feb 16, 2015 at 07:24:43AM -0800, Andrew Lutomirski wrote:
>> >> On Feb 16, 2015 3:59 AM, "Xavier Naveira"  wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > Since the kernel 3.19 mute button stopped working for me, this
>>seems to
>> >> > be the commit:
>> >> >
>> >> >
>> >> 
>>http://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git/comm
>>itdiff/9a417ec0c9d1f7af5394333411fc4d98adb8761b
>> >> >
>> >> > Before that (3.18.7) the button worked as well as its led although
>>the
>> >> > state was reset to "unmuted" after suspend.
>> >> >
>> >> > I'm on a Lenovo thinkpad x240 running ubuntu 14.10 with kernel
>>compiled
>> >> > from kernel.org.
>> >> >
>> >> > I'll be glad to help debugging the problem.
>> >>
>> >> What desktop environment are you using?  I suspect that you are
>> >> misconfigured a bit, since I've had reports that this works on the
>>X240.  I
>> >> really ought to write a blog post about it.
>> >>
>> >> --Andy
>> >>
>> >> >
>> >> >
>> >> > Xavier
>> >
>> > Hi Andy,
>> >
>> > My desktop environent is i3 on top of a default installation of
>>xubuntu.
>> > The kernel is the only thing that changes and I can reproduce the
>> > problem every time.
>> 
>> Here's the basics of what's going on:
>> 
>> Prior to 3.19, the ThinkPad embedded controller would automatically
>> mute a ThinkPad-specific hardware switch and light an LED when you
>> pressed the mute button.  The kernel had partial support for this: on
>> more recent kernels, it would try to keep the LED in sync with the
>> *standard* (non-ThinkPad-specific) mute controls, and it exposed a
>> rather buggy separate ALSA mixer that could directly poke the ThinkPad
>> hardware control.  The upshot was that, depending on what your
>> userspace software was doing, the mute button would sometimes do
>> something vaguely like what you expected, and it would sometimes
>> behave erratically.
>> 
>> Starting with 3.19, the default behavior is to ask the embedded
>> controller to disable all the magic.  The kernel will keep the mute
>> LED in sync with the software control, the hardware switch is disabled
>> entirely, and the mute button is just a button.  In other words, a
>> ThinkPad on 3.19 or newer will work just like any other laptop, except
>> with a bonus mute LED.
>> 
>> If you were relying on the old behavior, your mute button might no
>> longer have any apparent effect.  Users of more full-featured desktop
>> environments (GNOME and KDE, I think) seem to be fine by default.
>> Otherwise, you might need to set up your desktop environment the same
>> way you would for a non-ThinkPad laptop.  To get you started, try
>> these commands from a shell:
>> 
>> To toggle the mute state:
>> $ amixer -q set Master toggle
>> 
>> To toggle the mic mute state:
>> $ amixer -q set Capture toggle
>> 
>> If these work, then you should be able to bind them to the appropriate
>> key presses using a desktop-specific configuration along the lines of:
>> 
>> bindsym XF86AudioMute exec amixer -q set Master toggle
>> 
>> As an alternative, you can get the old behavior back by setting
>> thinkpad_acpi.software_mute=0, but then you'll have the same problem
>> again if you ever migrate to a non-ThinkPad laptop or if Lenovo ever
>> decides to save a few cents on new models by getting rid of the extra
>> hardware mute control.
>
>Hi Andy,
>
>Thank you for a thorough explanation!
>
>Ok I see, so instead of trying to support every hardware configuration
>in Thinkpads you treat the mute button as just another key of the
>keyboard and let the software deal with it.
>
>It is a shame that manufacturers can't keep standards (de facto or
>actual) on top of not delivering proper Linux modules.
>
>My interest on how Linux kernel and drivers has grown lately and I
>figured that a good way of learning is trying to understand (and if
>possible improve) the thinkpad_acpi module.
>
>I was actually trying to make the mute button restore its old state
>after suspend but now I guess I've to look for another task :)
>
>There is plenty, the rfkill button isn't killing bluetooth or gsm but
>only wifi for example (that could even not be a problem with
>thinkpad_acpi though).
>
>Anyway, amixer command doesn't seem to work in my setup so I guess I'll
>spend some time digging a software solution to make the mute button work
>for me again.

Hi Xavier,

Please try Andy's proposed solutions above and let us know if they work
for you. We believe this change is in the long term interest of ThinkPad
users, but we also have a commitment to not breaking userspace.

-- 
Darren Hart
Intel Open Source Technology Center




--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Report

[ibm-acpi-devel] unhandled HKEY event

2015-02-17 Thread Zdenek Gerlicky
Hello,

I got this warning in syslog

[16452.966435] thinkpad_acpi: unknown possible thermal alarm or keyboard 
event received
[16452.966445] thinkpad_acpi: unhandled HKEY event 0x6060
[16452.966449] thinkpad_acpi: please report the conditions when this 
event happened to ibm-acpi-devel@lists.sourceforge.net

BR
Zdenek

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


[ibm-acpi-devel] Lenovo T410 sound capabilities

2015-02-17 Thread Alexey Egorov
>
> If the driver misdetects the capabilities for your ThinkPad model,
> please report this to ibm-acpi-devel@lists.sourceforge.net, so that we
> can update the driver.


Hello, dear thinkpad-acpi developers. According to this entry in
thinkpad-acpi README file, I shall inform you that on Lenovo T410 (2537CN2)
the driver reports acpi_capabilities as 0:

> ex@gentoopad [02:32:26] [~]
> -> % cat /sys/module/thinkpad_acpi/parameters/volume_capabilities
> 0
>

But I strongly believe that the laptop is capable of controlling mute, so
parameter should be 2.

The driver reports vesion as 0.25, operating system is Gentoo GNU/Linux,
kernel version is 3.14.31-gentoo.

Best regards, Alexey Egorov.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
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: unhandled hkey event

2015-02-17 Thread Darren Hart
On Mon, Feb 09, 2015 at 08:44:26PM +0100, Xavier Naveira wrote:
> On 2015-02-07 05:22, Darren Hart wrote:
> >On Sat, Jan 31, 2015 at 07:52:03PM +0100, Xavier Naveira wrote:
> >>Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
> >>an unhandled hkey event
> >>
> >>Signed-off-by: Xavier Naveira 
> >>---
> >>  drivers/platform/x86/thinkpad_acpi.c | 7 +++
> >>  1 file changed, 7 insertions(+)
> >>
> >>diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> >>b/drivers/platform/x86/thinkpad_acpi.c
> >>index c3d11fa..e61c43b 100644
> >>--- a/drivers/platform/x86/thinkpad_acpi.c
> >>+++ b/drivers/platform/x86/thinkpad_acpi.c
> >>@@ -196,6 +196,7 @@ enum tpacpi_hkey_event_t {
> >>/* Key-related user-interface events */
> >>TP_HKEY_EV_KEY_NUMLOCK  = 0x6000, /* NumLock key pressed */
> >>TP_HKEY_EV_KEY_FN   = 0x6005, /* Fn key pressed? E420 */
> >>+   TP_HKEY_EV_KEY_FN_ESC   = 0x6060, /* Fn+Esc key pressed X240 */
> >>
> >>/* Thermal events */
> >>TP_HKEY_EV_ALARM_BAT_HOT= 0x6011, /* battery too hot */
> >>@@ -3717,6 +3718,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
> >>*send_acpi_ev = false;
> >>*ignore_acpi_ev = true;
> >>return true;
> >>+   case TP_HKEY_EV_KEY_FN_ESC:
> >>+   /* key press events, we just ignore them as long as the EC
> >>+* is still reporting them in the normal keyboard stream */
> >>+   *send_acpi_ev = false;
> >>+   *ignore_acpi_ev = true;
> >>+   return true;
> >
> >No need to duplicate the logic here, just add TP_HKEY_EV_KEY_FN_ESC to the 
> >list
> >of fallthrough keys (right after TP_HKEY_EV_KEY_FN).
> >
> I don't see the list that you are referring to?

Just before where you add the new case, there is:

/* fallthrough */

case TP_HKEY_EV_KEY_NUMLOCK:
case TP_HKEY_EV_KEY_FN:
/* key press events, we just ignore them as long as the EC
 * is still reporting them in the normal keyboard stream */
*send_acpi_ev = false;
*ignore_acpi_ev = true;
return true;

You should just be able to do:

  case TP_HKEY_EV_KEY_FN:
+ case TP_HKEY_EV_KEY_FN_ESC:

Rather than duplicating the same logic below a new case block.

-- 
Darren Hart
Intel Open Source Technology Center

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
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: support new BIOS version string pattern

2015-02-17 Thread Darren Hart
On Wed, Feb 04, 2015 at 05:00:19PM +0800, Adam Lee wrote:
> Latest ThinkPad models use a new string pattern of BIOS version,
> thinkpad_acpi won't be loaded automatically without this fix.
> 

Hi Adam,

> Signed-off-by: Adam Lee 
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 25 +++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index c3d11fa..39a1017 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8883,17 +8883,38 @@ static bool __pure __init tpacpi_is_fw_digit(const 
> char c)
>   return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z');
>  }
>  
> -/* Most models: xxyTkkWW (#.##c); Ancient 570/600 and -SL lacks (#.##c) */
>  static bool __pure __init tpacpi_is_valid_fw_id(const char * const s,
>   const char t)
>  {
> - return s && strlen(s) >= 8 &&
> + bool is_most = 0;
> + bool is_new = 0;

The new variables aren't really necessary, you certainly do not need two of
them.

> +
> + /*
> +  * Most models: xxyTkkWW (#.##c)
> +  * Ancient 570/600 and -SL lacks (#.##c)
> +  */
> + is_most = s && strlen(s) >= 8 &&

Try:

if (s && strlen(s) >=8 &&
...
)
return true;


>   tpacpi_is_fw_digit(s[0]) &&
>   tpacpi_is_fw_digit(s[1]) &&
>   s[2] == t &&
>   (s[3] == 'T' || s[3] == 'N') &&
>   tpacpi_is_fw_digit(s[4]) &&
>   tpacpi_is_fw_digit(s[5]);
> +
> + if (is_most)
> + return is_most;
> +
> + /* New models: xxxyTkkW (#.##c); T550 and some others */

Is the second W intentionally left off in xxxyTkkW ? We don't test for it, so I
wasn't sure.

> + is_new = s && strlen(s) >= 8 &&
> + tpacpi_is_fw_digit(s[0]) &&
> + tpacpi_is_fw_digit(s[1]) &&
> + tpacpi_is_fw_digit(s[2]) &&

As far as I can tell, the only significant difference here (compared to above)
is an additional leading digit and the subsequent string indices?

Seems to me this could be done fairly easily in the same block with only a minor
adjustment at the beginning and the use of an incrementing index. Should be
cleaner than duplicating 90% of the block?

> + s[3] == t &&
> + (s[4] == 'T' || s[4] == 'N') &&
> + tpacpi_is_fw_digit(s[5]) &&
> + tpacpi_is_fw_digit(s[6]);
> +
> + return is_new;
>  }
>  
>  /* returns 0 - probe ok, or < 0 - probe error.
> -- 
> 2.1.4
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel