My day off and kernel hacking.

I've just posted a patch to fix the toshiba_acpi kernel driver to emit INPUT events when the fn hotkeys are pressed. This means that the hardware works out of the box, and integrates nicely with KDE and GNOME without using oddball uinput-injecting system daemons such as FnFX to do the userspace polling. This also obsoletes my hal addon to do basically the same thing.

This is part of the “Unf*ck my keyboard” initiative, and allows us to kill lots of userspace bodges aquired over the years.

Hopefully the patch will get merged in the next merge window, and then that will be Toshiba sorted. My initial IBM patch should be merged soon, and then I can work on the NVRAM mixer interactions with thinkpad_acpi once again. I think Lennart is working on ASUS, and so that will be a good few laptops “just working” sometime soon.

Kernel driver for 3000 class lenovo

I've started to create a kernel driver for my 3000 series lenovo, to try and sort out some of the brokenness. At the moment, the driver just polls a bit of memory (0xb9) on the embedded controller and emits a KEY_BRIGHTNESS_XXX INPUT event when it changes. It also expresses a backlight class for the panel, although setting the value doesn't do much yet.

Now the question: for debugging I want to dump all 255 registers of the embedded controller to userspace. In thinkpad_acpi this is done using /proc/acpi/ibm/ecdump but I really don't want to hack proc support into my tiny driver. Should I be using the mem or misc kernel class for this? debugfs? relayfs? All I want to do is be able to read all 255 bytes, and also change them individually if needed.

Ideas? Thanks.

Backlight Brightness Fun

GNOME Power Manager trunk now does more with your backlight:

Interactions…

You'll notice the interactions are both subtle and complex.

Three significant new features:

  • Actually using the ambient light sensor on the Macbook Pro
  • Optionally using an integrated laptop webcam to sense ambient brightness
  • Learning when to dim on idle.

Using the webcam is more sane that you think. Using gstreamer, the webcam is turned on for about 300ms every minute, and a picture is taken. The luminance is used to find the ambient brightness. This means we can dim the screen when walking into a dark room, and also make the screen brighter when the sun comes out of the clouds. This uses about 5mW extra power, but saves many times that if we can automatically reduce the panel brightness by 15%.

Also in trunk we listen to GNOME Screensaver for the SessionPowerSave message which only fires when the session is momentarily idle. If on battery we reduce the brightness of the backlight and the split-second the session become non-idle (when the user touches the mouse or presses a key) the brightness comes back to what it was before. By default this timeout is 30 seconds, but if the backlight dims, and you immediately make the session non-idle, g-p-m learns that it should make the timeout longer.

Also, I'm now working for Red Hat UK for a couple of months during the summer. Without the help of Red Hat, and the flexibility to sometimes work on upstream stuff, none of this new coolness would be possible. Thanks.

IBM Customer Services

My new battery for my Lenovo arrived this morning. It works, and I'm happy. I might have bitched quite a bit about LENOVO in the past, but the IBM customer services experience was fantastic. I think the longest I was on hold was a couple of minutes, and they sorted out the courier to swap the batteries within one day. Nice one!

Unfuck my keyboard (from the PFY)

Yesterday I send a patch to hal-devel describing a patch to add nvram polling to HAL to abstract the buttons. I did this basically for comments, and so people can try the addon and see if nvram polling worked for them. And then, feeling less dirty, I wrote a kernel patch. I want to convert the thinkpad_acpi module to use INPUT rather than export random hotkeys using acpi events. The idea being the INPUT keycodes can be mapped using a keymap, and we can make the keys work for people without using some random custom session or system daemon. This means you can do KEY_FN_F2 and then you can map the button in gnome-keybinding-properties just as if it was any other normal AT button, or choose a keymap in gnome-keyboard-properties so all the buttons work. We need to automate this somehow, and I've a funny feeling it might involve HAL. The NVRAM keys (volume, mute, thinkpad) will have to be done a little more carefully as they are tied to hardware, although I think I can do that polling in the kernel quite cleanly. I intend on submitting patches for all the machines that I can get my hands on, first in my sights is toshiba_acpi. Plan?

Last exam

Today I finished my university education. I took my last ever exam (which went well) – I can't believe I've finished my masters. I think my blood pressure must have dropped 10mm. For the next few days I'm off-grid, relaxing. On Monday I start work for a couple of months with Red Hat UK, so I really haven't got much time to chill. So now, I sleep for a few hours, and I'll then grab some Chinese food and a bottle of wine for my girlfriend and myself. If I've been ignoring your email – apologies, I'll get back to you on Monday.

SoftIce

Long shot: Anybody got any advice on how to use a tool such as SoftIce to log all EC and ACPI accesses during the Windows XP suspend? I can't believe I'm reverse engineering a closed source windows DLL just to find out why resume won't work in Linux…

New macbook?

Hypothetically, if I was to buy a new laptop for geeky work I'm thinking I might go crazy: An Apple Macbook.
I'm avoiding the Macbook Pro due to the non-free video and significant price increase, and also that I could do with something more portable than what I have now.

So far, I'm thinking:

  • [X] Dual core, lots of memory
  • [X] Suspend and Hibernate work
  • [X] Screen brightness works
  • [?] Ambient light sensor
  • [X] DVD burner
  • [  ] Wireless without ndiswrapper
  • [?] Second monitor out working with VGA and DVI
  • [X] Intel GMA graphics card
  • [?] XRANDR support for video driver
  • [X] Bluetooth that works
  • [X] Integrated camera
  • [X] Can blast OSX off the drive completely.
  • [?] Can run xen or vmware

So, does anybody know if:

  1. You can retrofit another pcie wifi card?
  2. madwifi_ng will actually work reliably in F7?
  3. the super-reflective screen will annoy me?
  4. you can run vmware or xen on a macbook?
  5. the macbook has a brightness sensor like the pro?
  6. The keyboard is any good?
  7. You can actually cope in GNOME having one mouse button?

Now, I'm thinking I might buy this in the US rather than the UK… It's still significantly cheaper (about £200) even after taking into account the stonking exchange rate. Bad plan?

Anyone got any success or horror stories? Thanks.

p.s. two exams down, two to go. So far, so good.