You are not logged in.

#1 2011-01-23 04:06:27

Filiprino
Member
Registered: 2011-01-23
Posts: 1

Kernel 2.6.37 and eeepc-wmi

Hi all.
I have read on the 2.6.37 changelog that new hotkeys have been added. These are the changes:

commit 7f80d734b3b5d23b9851cc03cc20733bca2c724e
      Author: Chris Bagwell <chris@cnpbagwell.com>
       Date:   Mon Oct 11 18:47:18 2010 -0500
       
           eeepc-wmi: Add cpufv sysfs interface
         
           eeepc-laptop provides a sysfs interface to read and control what it
           calls cpufv.  When WMI is enabled, the ACPI interface changes slightly
           and becames a write-only control with 3 valid values.
         
          Expose cpufv again to allow for user space utils that can extended battery
          life noticably and come a little closer to parity with eeepc-laptop.
         
          Write-only is OK for most user space apps because read status was
          mostly used to prevent unneeded mode changes.  Since this same check
          to ignore changes to same mode also exists in the DSDT then it was
          wasted ACPI call.
         
          acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's
          read support of cpufv for debugging things such as behaviour
          during resume.
         
          This patch was tested with EEE PC 1005PE by monitoring powertop output while
          writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of
          an 1201NL and comparing it to 1005PE's DSDT.
         
          Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
          Signed-off-by: Matthew Garrett <mjg@redhat.com>
       
      commit eda1748418beb1b9a75d0cea3304edf922c66134
      Author: Chris Bagwell <chris@cnpbagwell.com>
      Date:   Mon Oct 11 18:47:17 2010 -0500
       
          eeepc-wmi: add additional hotkeys
         
          Added 4 hotkeys using same keymap values as eeepc-latop.
          These are mousepad toggle, resolution change, screen off,
          and task manager.  These were tested on 1005PE and are the
          Fn-F3, F4, F7, and F9, respectively.
         
          Also, added a new hot key for power toggles (Fn-Space on 1005PE)
          and is meant to drive cpufv interface from userspace.
         
          Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
          Signed-off-by: Matthew Garrett <mjg@redhat.com>

They added cpufv and Fn+Space . I've been searching for a way to get cpufv working and have some kind of report at every change on Super Hybrid Engine's state. Cpufv now is write only except when you use the acpi_osi="!Windows 2009" parameter on the Linux booting options. I would like to not use that option, "just work" mentallity here tongue
Any ideas? The Fn+space hotkey is nice and handy and I think that eeepc-laptop does not have it, but without feedback on mode changes and without being able to read cpufv file I don't know in what mode I am when using eeepc-wmi.

Last edited by Filiprino (2011-01-23 16:57:07)

Offline

#2 2012-02-03 18:23:53

garaden
Member
Registered: 2011-09-05
Posts: 6

Re: Kernel 2.6.37 and eeepc-wmi

I've been looking into this as well. Here's a useful link: Writing a WMI driver - an introduction. It explains a bit about what eeepc-wmi is and how it works.

Basically, eeepc-laptop was a driver written to expose Eee PC's ACPI stuff (like hotkeys, SHE, etc.) to Linux. However, it relies on the BIOS detecting the operating system as "something other than Windows 7", and Linux has by default reported itself as Windows 7 to BIOSes since 2.6.32. So people add acpi_osi="!Windows 2009". This is necessary because current firmware updates to Eee PCs (or at least my 1005HA) expose some different ACPI devices if it detects Windows 7. Apparently this has something to do with a Microsoft management technology called WMI, but I don't know how, especially since WMI's been around for over a decade. I guess Windows 7 expects there to be WMI objects embedded in ACPI, but other versions of Windows don't? Well, apparently changing the ACPI devices exposed by the BIOS depending on the OS is regarded to be A Bad Thing (see ACPI BIOS Guideline for Linux), but unsurprisingly BIOSes seem to be ignoring this advice. SO: there are two solutions. One is to use acpi_osi="!Windows 2009" to force the old ACPI devices, which permits loading eeepc-laptop.

The other way is to not mess with acpi_osi (since it's also considered Very Bad for the same reasons) and write a new driver to handle the new ACPI devices. That's why eeepc-wmi was written, and if it wasn't for that write-only cpufv device I think it'd have feature parity with eeepc-laptop.

So, to clarify: Eee PC BIOSes originally exposed some ACPI devices that eeepc-laptop can drive. Then Windows 7 came out, Linux started reporting itself as Windows 7, Eee PC released BIOS updates to detect Windows 7 and present a different ACPI device set, and eeepc-laptop stopped working. People added acpi_osi="!Windows 2009" as a workaround to force the old BIOS behavior which permitted them to load eeepc-laptop. Then someone wrote an eeepc-wmi driver for Linux, which permits people to remove the acpi_osi="!Windows 2009" line and load eeepc-wmi instead, which I think is more future-proof.

Phew! As for your Fn+Space stuff, I had Fn+Space working on my 1005HA when I was using eeepc-laptop, acpi-eeepc-generic and laptop-mode-tools, though I had to hack up the acpi-eeepc-generic scripts a bit to get the SHE state reported somewhere useful (I used the "wall" command to write the status change on all my terminals). One way to check is to run acpi_listen and press Fn+Space. If you get output you can write a hook for that event in acpid. I think acpi-eeepc-generic handles it out of the box, but of course you need eeepc-laptop rather than eeepc-wmi if you go that route. If you don't get output on acpi_listen, well, I've never had to deal with that so I'm not sure what your next step would be smile

Me, I went to a lot of trouble to get eeepc-wmi to work because I was tired of my volume keys taking a full second to make an ACPI event (kinda makes them useless). Heck, I think Windows had the same problem whenever I dual-booted into XP smile But using the WMI devices with eeepc-wmi made them nice and snappy, I just had to manually edit /etc/acpi/handler.sh and of course strip out acpi-eeepc-generic. Wherever laptop-mode-tools has superhe.conf or whatever it's called, you may also want to change which device it's looking at if you want laptop-mode-tools to handle this. I'm not sure whether or not that actually works: laptop-mode-tools might choke if it can't read the value back out; I haven't checked.

As for the write-only problem, I don't think there's a way around that unless they update eeepc-wmi somehow. Maybe write something to /var every time you change it, and read from that? I'm not sure smile

Offline

#3 2012-05-02 06:46:59

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Kernel 2.6.37 and eeepc-wmi

This is great info, thanks.  I don't think many people realise there is a new version of the eeepc acpi drivers; it's certainly not mentioned on the Arch WIki at all.

This page gives a nice history of the drivers.

Offline

Board footer

Powered by FluxBB